Chapter 04Lesson 05~120 minutes

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.

Checkpoint labThree rolesEvidence packetLeast privilegeSafe cleanup

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.

Lab boundary: loopback-only local controller, synthetic users, no real SCM, no real credentials, no production IdP, and no external side effects.

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

  1. Prove controller is local/disposable.
  2. Verify recovery-admin in a separate session.
  3. Record current authorization strategy/plugin versions.
  4. Take a stopped-controller snapshot of the disposable JENKINS_HOME.
  5. 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.
Evidence discipline: acting identity + full object name + requested action + server result + resulting Jenkins state is stronger than a screenshot. Never capture password fields or tokens.

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

Controller baseline

Core/LTS, Java, plugin versions, image identity.

Identity model

Usernames and intended roles, no secrets.

Authorization model

Strategy, grants, scope, inheritance.

Allowed actions

Principal, object, action, resulting state.

Denied actions

Principal, object, denial, no state change.

Build evidence

Full job name, build number/URL/cause, agent/workspace.

Recovery evidence

Verified admin session and snapshot reference.

Assumptions

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
Guarded cleanup: never replace the explicit disposable names with wildcards such as deleting all Jenkins volumes.

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.

Next chapter

Chapter 05 — Freestyle Projects, Build Steps, Post-Build Actions, Parameters, Triggers, and Legacy Job Maintenance

Carry the verified evidence and operating discipline from this chapter into the next chapter.

Knowledge check

What is strongest proof auditor cannot build?

Why deliberately add and remove Job/Configure?

Why keep recovery-admin in a separate session?

What credential data belongs in evidence?

Why retest Job/Build after removing Job/Configure?

Official references and version notes

Version and compatibility note

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.

Ethereum / ERC-20
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0Send only Ethereum/ERC-20 compatible assets to this address.