Execute Shell - Build Step - command restriction

Dear Team,

How do i restrict or whitelist the commands to be used under “Execute Shell” build-step in Jenkins?

P.S: The Jenkins users are able to execute even “rm -rf …” command(s) via this build-step.

I do not think this is something you can configure on Jenkins. The pipeline runs a command using the user the Jenkins process was started with. You can restrict what this user can do from the underlying OS configuration, Linux in this case.

1 Like