How do you secure the webhook endpoint?
AdvancedConceptMultibranch, organization folders & webhooks
Answer
- Configure a shared secret so Jenkins validates the
X-Hub-Signature-256HMAC on each delivery. - Expose only
/github-webhook/publicly through the reverse proxy or a dedicated ingress path; keep the UI behind VPN/SSO. - Allowlist GitHub's webhook IP ranges (from
https://api.github.com/meta) at the load balancer. - Remember the webhook only triggers indexing; Jenkins then fetches from GitHub with its own credentials, so a forged payload cannot inject code.
More on Multibranch, organization folders & webhooks
How does a multibranch pipeline work?BeginnerWhat is branch indexing and what triggers it?BeginnerWhat are the discovery traits in the GitHub branch source?IntermediateWhat does the fork PR trust setting protect against?AdvancedWhat environment variables are set for PR builds?BeginnerWhat is an organization folder?Intermediate