Interview Prep/Jenkins/Credentials & security

Your script approval list contains `method hudson.model.Run getLog` and `staticMethod jenkins.model.Jenkins getInstance`. What do you do?

AdvancedScenarioCredentials & security
Answer

Situation read → These approvals give every Jenkinsfile author access to Jenkins internals: Jenkins.getInstance leads to credentials and configuration.

What I'd do →

  1. Find which pipelines use them (search Jenkinsfiles and recent RejectedAccessException history).
  2. Replace with safe alternatives: library steps that do the specific job, or plugin steps.
  3. Revoke the dangerous approvals in In-process Script Approval.
  4. Audit recent builds for abuse; rotate high-value credentials if exploitation is plausible.

Why → Approving internal API access effectively makes all pipeline authors admins.

Interview tip → Demonstrate that you know which signatures are dangerous, not just "approve carefully".

All Jenkins questions Roadmap: Jenkins

More on Credentials & security