Skip to main content

Webhook Triggers

Playbooks can also be triggered via webhooks. When a webhook is configured, mission-control listens on the specified endpoint and any calls to the endpoint triggers the playbook. By default, the webhook calls are not protected via authentication. However, there are various authentication methods available.

/webhook/<webhook-path>
webhook-trigger.yaml
apiVersion: mission-control.flanksource.com/v1
kind: Playbook
metadata:
name: create-file-on-webhook
spec:
description: Create a file specified by the webhook
components:
- type: KubernetesCluster
'on':
webhook:
path: my-webhook
authentication:
basic:
username:
value: my-username
password:
value: my-password
parameters:
- name: path
label: Absolute path of the file to create
actions:
- name: Create the file
exec:
script: touch {{.params.path}}

Spec

A webhook can simply be defined by a path - which must be unique.

FieldDescriptionSchemeRequired
pathUnique endpoint for the webhook.stringtrue
authenticationSpecify approvers of approval.[]Authentication

Authentication

FieldDescriptionSchemeRequired
basicBasic AuthBasicAuth
githubGithub AuthGithubAuth
svixSvix AuthSvixAuth
jwtJWT AuthJWTAuth
note

If multiple authentication methods are specified, all of them will be used.

Basic Auth

FieldDescriptionSchemeRequired
usernameUsernametypes.EnvVartrue
passwordPathtypes.EnvVartrue

Github Auth

If the webhook is being called by Github, you can use GitHub's webhook verification to ensure that the webhook calls are really from GitHub.

FieldDescriptionSchemeRequired
tokenSecret token for the webhooktypes.EnvVartrue

Svix Auth

FieldDescriptionSchemeRequired
secretSigning secrettypes.EnvVartrue
verifyTimestampSpecify the tolerance for the timestamp verificationstring

JWT Auth

FieldDescriptionSchemeRequired
jwksUriJWKS URIstringtrue