Interview Prep/Jenkins/Credentials & security

You need to give a release bot a token to call the Jenkins API. How?

BeginnerScenarioCredentials & security
Answer

Situation read → Machine identity with minimal permissions.

What I'd do →

  1. Create a service account user in the IdP or a local Jenkins user svc-release-bot.
  2. Grant only the permissions it needs on specific folders (Job/Build, Job/Read).
  3. Generate a named API token, store it in the bot's secret store, rotate periodically.
  4. Monitor token last-use and revoke unused ones.

Why → Separate identity makes audit clear and limits damage if leaked.

Interview tip → Mention that API tokens do not need CSRF crumbs.

All Jenkins questions Roadmap: Jenkins

More on Credentials & security