feat(security/pipeline): Add Pipeline to add more possibilities to the security builder#38
Merged
feat(security/pipeline): Add Pipeline to add more possibilities to the security builder#38
Conversation
Owner
Author
|
Config to allow IP based on security:
- header:
inputs:
- name: headerName
value: X-Forwarded-For
- hasPrefix:
inputs:
- name: text
value: '{{ .Outputs.header.value }}'
- name: prefix
values: ['127.0.0.1', '[::1]']Config to allow IP based on RemoteAddr security:
- hasPrefix:
inputs:
- name: text
value: '{{ .Inputs.request.RemoteAddr }}'
- name: prefix
values: ['127.0.0.1', '[::1]']Config to reject (only add security:
- hasPrefix:
inverse: true
inputs:
- name: text
value: '{{ .Inputs.request.RemoteAddr }}'
- name: prefix
values: ['127.0.0.1', '[::1]'] |
Owner
Author
|
Webhook configuration for Github (Tested OK | Security OK) - name: github
entrypointUrl: /webhooks/github
security:
- generate_hmac_256:
id: signature
inputs:
- name: payload
value: '{{ .Inputs.payload }}'
- name: secret
valueFrom:
envRef: GITHUB_WEBHOOK_SECRET
- header:
id: headerSignature
inputs:
- name: headerName
value: X-Hub-Signature-256
- compare:
inputs:
- name: first
value: '{{ .Outputs.headerSignature.value }}'
- name: second
value: 'sha256={{ .Outputs.signature.value }}'
storage:
- type: redis
specs:
host: localhost
port: '6379'
database: 0
key: github |
Owner
Author
|
Webhook configuration for Gitlab (Tested OK | Security OK) - name: gitlab
entrypointUrl: /webhooks/gitlab
security:
- header:
inputs:
- name: headerName
value: X-Gitlab-Token
- compare:
inputs:
- name: first
value: '{{ .Outputs.header.value }}'
- name: second
valueFrom:
envRef: GITLAB_WEBHOOK_TOKEN
storage:
- type: redis
specs:
host: localhost
port: '6379'
database: 0
key: gitlab |
rgaiffe
reviewed
Mar 7, 2022
rgaiffe
reviewed
Mar 7, 2022
rgaiffe
reviewed
Mar 7, 2022
rgaiffe
approved these changes
Mar 7, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relative Issues: Resolve #22 , resolve #21, resolve #9, resolve #10, resolve #11
Describe the pull request
The current version of the security factories works in a very basic way and does not allow advanced uses like comparing several objects of different steps or allowing later the comparison of HMAC which is for example useful for the webhook of GitHub or Twitch.
For this we had to rewrite version 1 of the
factory builderto add a so-calledPipelineoverlayTODO
headerandcomparefactory in this versionChecklist
Breaking changes ?
yes
Additional context
Concrete example, actual static comparaison of an header with
factory/v1.BuilderNew version builder with
factory/v2.Pipeline