-
New Feature
-
Resolution: Unresolved
-
Minor
-
None
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?