How do you secure the connection between a webhook sender and Jenkins?
AdvancedConceptJenkins
Answer
Put Jenkins behind HTTPS and validate who is calling. For GitHub, set a webhook secret and use a plugin that verifies X-Hub-Signature-256 (the Generic Webhook Trigger plugin supports a token and header-based filters). Restrict the ingress to the SCM provider's IP ranges where published, and avoid exposing the full Jenkins UI publicly: expose only the /github-webhook/ or /generic-webhook-trigger/invoke paths via a reverse proxy. Keep CSRF protection enabled, and use API tokens instead of passwords for remote calls.
More on Jenkins
What is Jenkins and how is its architecture organised?BeginnerWhat are executors, nodes and labels in Jenkins?IntermediateWhy should you not run builds on the Jenkins controller?BeginnerHow do inbound (JNLP/WebSocket) and SSH agents connect to the controller?IntermediateWhat is a Jenkinsfile and where does it live?BeginnerDeclarative versus Scripted Pipeline: what are the differences?Intermediate