Security Layer
Security is not optional. Always authenticate webhooks in production environments.
Last updated
security:
type: github
specs:
secret: # Valuable - see doc "Sourcing (Valuable)" for more info
valueFrom:
envRef: GITHUB_WEBHOOK_SECRETwebhooks:
- name: github-push
entrypointUrl: /github/push
security:
type: github
specs:
secret:
valueFrom:
envRef: GITHUB_SECRET
response:
statusCode: 200
formatting:
templateString: |
{
"status": "validated",
"event": "{{ .Request.Header.Peek "X-GitHub-Event" | toString }}",
"delivery": "{{ .Request.Header.Peek "X-GitHub-Delivery" | toString }}"
}security:
type: custom
specs:
condition: |
{{ eq (.Request.Header.Peek "X-API-Key" | toString) (env "API_KEY") }}security:
type: custom
specs:
condition: |
{{ and
(eq (.Request.Header.Peek "X-API-Key" | toString) (env "API_KEY"))
(eq (.Request.Header.Peek "X-Tenant-ID" | toString) "tenant-123")
(contains (.Request.Header.Peek "User-Agent" | toString) "MyApp")
}}security:
type: noop