Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-69606

Ability to whitelist steps in Jenkinsfiles while allowing all steps in global pipeline libraries

XMLWordPrintable

      We are attempting to block access to pipeline steps that we consider a security risk (e.g. the Kubernetes plugin steps) from user provided Jenkinsfiles, but allowing access to all the steps from global pipeline libraries. Ideally we would only allow access to steps within our global pipeline library.

      The only way we have come up with is to create StepListener extension. The extension uses reflection on the StepContext to check whether the step was executed via the Jenkinsfile or a global pipeline library.

      As I understand it, this is not considered good practice and may break in future.

      Is there some existing functionality to achieve what we need here or the possibility of extending the StepListener API to provide it?

       

            sag47 Sam Gleske
            matthewwalker Matthew Walker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: