Checkpoint Lab — Users, Authentication Realms, Authorization Strategies, Matrix Permissions, Folders, and Least Privilege
Checkpoint lab: implement a three-role Jenkins access model, prove allow/deny behavior, repair an over-broad matrix entry, and capture safe evidence.
Learning objectives
- Implement a complete three-role disposable Jenkins access model with a preserved recovery administrator.
- Predict and verify allowed and denied operations for each role on an explicit folder/job path.
- Introduce one intentionally over-broad matrix grant, prove its blast radius, and repair only the causal entry.
- Collect a reviewable evidence packet without exposing passwords, tokens, or credential values.
- Verify cleanup and recovery assumptions leave no hidden production dependency.
1. Checkpoint mission
Build and test three roles on a disposable controller:
administrator (recovery-admin with
Overall/Administer), builder (dev-builder
with read/build on training/dev/*), and
auditor (read-only on the same hierarchy).
Then intentionally add one excessive permission, prove the capability appears, and repair it without losing administrative recovery.
2. Version and resource assumptions
| Component | Pinned assumption | Evidence |
|---|---|---|
| Jenkins | 2.568.3 LTS | X-Jenkins / System Information. |
| Runtime | Java 21 | java -version. |
| Matrix Authorization | 3.3 | Installed plugin inventory. |
| Folders | 6.1106.v3a_d9a_6d2465e | Installed plugin inventory. |
| Credentials | 1511.v2e3cb_0008ef0 | Installed plugin inventory; no real secret needed. |
| Network | 127.0.0.1:8080 | Docker port binding. |
| State | jenkins_ch04_home |
Disposable volume and snapshot. |
3. Preflight and recovery guard
- Prove controller is local/disposable.
- Verify
recovery-adminin a separate session. - Record current authorization strategy/plugin versions.
-
Take a stopped-controller snapshot of the disposable
JENKINS_HOME. - Confirm no production secret, webhook, IdP, cloud, registry, or SCM organization is connected.
docker ps --filter name=jenkins-ch04
curl -fsSI http://127.0.0.1:8080/login | grep -i '^X-Jenkins:'
docker stop jenkins-ch04
docker run --rm -v jenkins_ch04_home:/source:ro -v "$PWD":/backup alpine:3.22 sh -lc 'cd /source && tar -czf /backup/jenkins-ch04-pre-matrix.tgz .'
docker start jenkins-ch04
4. Write predictions before changing the matrix
| Role | Allowed prediction | Denied prediction |
|---|---|---|
| recovery-admin | Manage Jenkins and edit matrix. | No intentional admin denial in this lab. |
| dev-builder | Read/build training/dev/hello. |
Configure job, Manage Jenkins, credential administration. |
| auditor | Read job and permitted history. | Start build, configure job, Manage Jenkins. |
Also predict state: a successful builder action creates a new build number/cause but does not modify job configuration; a denied auditor build creates no new build number.
5. Implement the baseline policy
Use Jenkins’ internal user database for this disposable checkpoint
and Project-based Matrix Authorization Strategy. Keep anonymous
empty. Preserve recovery-admin globally. Give non-admin
users only the global read prerequisite and folder-scoped job grants
they need.
| Principal | Global | training/dev |
|---|---|---|
| recovery-admin | Overall/Administer | Inherited admin capability |
| dev-builder | Overall/Read | Job/Read + Job/Build |
| auditor | Overall/Read | Job/Read |
| anonymous | None | None |
6. Prove one allowed and one denied action per role
Use separate sessions. For build tests capture full item name, build number, URL, cause, and agent/node. For denials capture non-sensitive status/message and confirm protected state did not change.
| Role | Allowed proof | Denied proof |
|---|---|---|
| administrator | Open Security and view current strategy. | Instead verify only recovery-admin has this role. |
| builder |
Start training/dev/hello and record build.
|
Configure/Manage Jenkins rejected; config unchanged. |
| auditor | Read job/build history. | Build rejected; no new build number. |
7. Introduce one controlled over-broad permission
Grant Job/Configure to dev-builder on
training/dev. Predict that the user can now modify
executable job configuration. Save, sign in as dev-builder, and
verify Configure becomes authorized.
Make only one harmless description change. Do not add a secret,
external endpoint, privileged agent, or destructive build step.
Record that configuration changed even though
Overall/Administer remained absent.
8. Repair the causal entry without losing recovery
As recovery-admin, remove only
Job/Configure from dev-builder. Preserve Read and
Build. Retest: builder still reads/builds; builder can no longer
configure; auditor stays read-only; recovery-admin still
administers.
This is causal repair, not “reset everything.”
9. Required evidence packet
Core/LTS, Java, plugin versions, image identity.
Usernames and intended roles, no secrets.
Strategy, grants, scope, inheritance.
Principal, object, action, resulting state.
Principal, object, denial, no state change.
Full job name, build number/URL/cause, agent/workspace.
Verified admin session and snapshot reference.
Loopback only; no real external systems; verification date.
Redact cookies, CSRF crumbs, API tokens, password hashes, encrypted credentials, and controller secret keys.
10. Cleanup and rollback
docker stop jenkins-ch04
docker rm jenkins-ch04
docker volume inspect jenkins_ch04_home
docker volume rm jenkins_ch04_home
docker image rm jenkins-ch04:2.568.3
11. Production bridge
You have demonstrated the core operating discipline for Jenkins access control: attributable identities, rare/recoverable administration, scoped item permissions, positive and negative tests, Configure as code-execution authority, and credential administration separated from job visibility.
Chapter 05 moves into Freestyle jobs, build steps, post-build actions, parameters, and triggers. The access-control model from this chapter becomes the guardrail around those job operations.
Knowledge check
What is strongest proof auditor cannot build?
A server-side denied Build action plus confirmation that no new build number exists.
Why deliberately add and remove Job/Configure?
To demonstrate how one permission changes trust level and to practice causal repair.
Why keep recovery-admin in a separate session?
It protects against self-lockout while the matrix is being changed.
What credential data belongs in evidence?
Permission/scope metadata and assumptions only—never password/token/secret values.
Why retest Job/Build after removing Job/Configure?
To prove the repair removed only the unwanted capability while legitimate builder access still works.
Official references and version notes
- Jenkins Access Control — authentication via a security realm and authorization via an authorization strategy are separate decisions.
- Jenkins Permissions — current definitions for Overall, Job, Run, View, Credentials, and Pipeline-related permissions.
- Managing Security — realms, authorization modes, matrix security, and controller-wide security settings.
- Matrix Authorization Strategy Plugin — global/project matrices, inheritance modes, and item-configuration caveats.
- Folders Plugin — folder-based item organization used by the scoped-access examples.
- Jenkins Credentials security guidance — credential scope and access minimization.
- Controller Isolation — why users who influence build code must not run routine builds on the built-in node.
Rechecked against Jenkins primary documentation on
2026-09-15. The disposable examples assume
Jenkins 2.568.3 LTS on Java 21,
matrix-auth:3.3,
cloudbees-folder:6.1106.v3a_d9a_6d2465e, and
credentials:1511.v2e3cb_0008ef0. These plugin
releases declare minimum Jenkins baselines below 2.568.3. Future
readers must re-check plugin health, advisories, dependencies, and
minimum core requirements before installation or upgrade.
Keep the academy open
Support free, practical DevOps education.
Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0Send only Ethereum/ERC-20 compatible assets to this
address.