team-b folder under shared-infrastructure and then add a pipeline to illustrate how folder-scoped credentials are inherited (or not).
1. Create the team-b Folder and Pipeline
- In Jenkins UI, navigate to shared-infrastructure.
- Click New Item, enter
team-b, select Folder, and hit OK. - Inside team-b, click New Item again, name it
team-b-pipeline, choose Pipeline, then OK. - Under Pipeline → Definition, point to the same Jenkinsfile:
Jenkins uses folder-based permission checks to isolate credentials. Anything defined in a parent folder is inherited by its subfolders.
2. Trigger the Pipeline
Click Build Now onteam-b-pipeline. The job will start but ultimately fail:
2.1 Console Output
team-b-pipeline cannot retrieve team-a-creds. Credentials scoped to team-a are invisible to team-b, which is a sibling folder.3. Understanding Folder-Scoped Credential Inheritance
| Credential Location | Visible To |
|---|---|
| shared-infrastructure | team-a, team-b (and any subfolders) |
| team-a | Items in team-a only |
| team-b | Items in team-b only |
- Shared folder credentials (
shared-db-creds) are inherited by all child folders. - Folder-specific credentials (
team-a-creds) only apply within their own folder.