A developer printed a credential with `echo $TOKEN | base64` and it appeared unmasked in the log. What do you do now and later?
IntermediateScenarioCredentials & security
Answer
Situation read → Masking only matches the exact value; the secret is exposed.
What I'd do →
- Rotate the credential immediately; treat it as compromised.
- Delete the affected build logs (or the builds) and check who viewed them.
- Tighten who can modify pipelines that bind that credential: folder-scoped credentials, PR review for Jenkinsfiles, no Replay for non-admins.
- Add a log scan (e.g. gitleaks over archived logs) for leaked patterns.
Why → Anyone who can run code with a secret can exfiltrate it; masking is not a control.
Interview tip → Say "rotate first, investigate second".
More on Credentials & security
What credential types does Jenkins support out of the box?BeginnerWhat is the difference between Global and System credential scope?IntermediateHow do folder-scoped credentials help multi-team controllers?IntermediateHow does Jenkins mask secrets in logs and what are its limits?AdvancedWhat authorization strategies are available?IntermediateWhat are the key permissions to understand in matrix auth?Intermediate