title: Preventing unsanctioned deploys in Jenkinsfile (Multibranch Pipeline)
body: <p>We're running Jenkins with multibranch pipeline plugin attached to GitHub organization's repository with Jenkinsfile in some of its branches. Jenkins has access to multiple other agents &amp; nodes where it deploys code after it's successfully built.</p>
  
  <p>The problem: I want to <strong>prevent other devs from running builds with modified Jenkinsfile in their branches and pull requests</strong>.</p>
  
  <ul>
  <li><em>Solution 1:</em> <code>when</code> statement in Jenkinsfile: <strong>poor security</strong>. Anyone can modify it, remove the <code>when</code> clause and break production.</li>
  <li><em>Solution 2:</em> locked files on repo: <strong>not available on GitHub</strong>. I'm seriously considering moving to GitLab because they have this function.</li>
  <li><em>Solution 3:</em> seperate job in Jenkins for deployment: <strong>overkill</strong>. I think there should be a Pipeline-ish solution for this.</li>
  </ul>
  
  <p>How can I make sure that the used Jenkinsfile is authentic and not modified? Is there any solution to this that I'm missing? I want this to be secure enough to prevent anyone with push access from intentionally breaking things, e. g. git pre-push hooks are not a solution.</p>