The security team asks you to prove that production builds come only from the main branch of approved repos.
AdvancedScenarioJenkins Shared Libraries, Credentials and Security
Answer
Situation read → Need verifiable build provenance.
What I'd do →
- Restrict prod-deploy credentials to a folder and job that only builds
mainof approved repos. - Generate SLSA-style provenance recording repo, commit, builder and parameters, and sign it (cosign attest).
- Verify the attestation at deploy time or in admission control (Kyverno
verifyImages, Sigstore policy-controller).
Why → Policy plus signed evidence is stronger than process rules.
Interview tip → Name SLSA and cosign; it shows you know the supply-chain vocabulary.
More on Jenkins Shared Libraries, Credentials and Security
Ten teams copy the same 80-line "build and push image" stage. What do you do?BeginnerA shared library change broke 50 pipelines at once. How do you prevent a repeat?AdvancedA pipeline needs an AWS secret key and a DB password. How do you provide them without exposing them in logs?BeginnerCredentials are stored in Jenkins; the security team wants no long-lived cloud keys at all.AdvancedA developer asks for admin access to Jenkins to "fix their job". How do you handle it?BeginnerA pipeline from a fork PR should not be able to read production credentials.Intermediate