Skip to content

Security

42Atomys edited this page Mar 7, 2022 · 7 revisions

Built-ins

42School

- name: gitlab
  entrypointUrl: /webhooks/42
  security:
  - header:
      inputs:
      - name: headerName
        value: X-Secret
  - compare:
      inputs:
      - name: first
        value: '{{ .Outputs.header.value }}'
      - name: second
        valueFrom:
          envRef: FT_WEBHOOK_SECRET
  storage:
  - type: redis
    specs:
      host: localhost
      port: '6379'
      database: 0
      key: 42

Github

- 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

Gitlab

- 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
Clone this wiki locally