Production Capstone: Govern a GitHub Organization and Build a Secure End-to-End Delivery System: Security, Governance, and Reliability Validation
Validate the capstone as a system: human and automation permissions, trust boundaries, plan compatibility, policy enforcement evidence, reliability, cost, and measurable acceptance criteria.
Learning objectives
- Build a human/machine permissions and trust-boundary matrix rather than relying on labels such as “least privilege.”
- Validate ruleset, review, merge, runner, credential, release, provenance, and rollback assumptions with independent evidence.
- Map policy objectives to enforcement mechanisms, evidence, accountable owners, exceptions, and plan/deployment availability.
- Compare Free, Pro, Team, Enterprise Cloud, and GHES boundaries without turning unavailable capabilities into mandatory steps.
- Define measurable acceptance criteria for security, governance, reliability, performance/cost, auditability, and recovery.
1. Validate claims as invariants
Validation asks a different question from implementation. Instead of
“did we configure a ruleset?”, ask “can a change reach
main without the expected review/check path, and what
evidence would reveal that?” Instead of “does the workflow use
OIDC?”, ask “which job can request OIDC, for what purpose, and which
consumer trusts that identity?”
Every production claim below therefore has four fields: policy objective → enforcement surface → independent evidence → accountable owner. If one field is missing, the control is incomplete even when the UI looks correct.
2. Personal ownership versus organization governance
| Question | Personal public capstone | Organization production model |
|---|---|---|
| Who owns the repository? | One learner account; adequate for disposable functional proof. | Organization owns critical repositories so continuity is not coupled to one employee account. |
| How is access granted? | Direct collaborator model if needed; keep the lab solo by default. | Persistent access through teams; direct grants exceptional and reviewable. |
| Can duties be separated? | No—not meaningfully with one person. | Engineering writes, security governs security controls, release role controls promotion according to policy. |
| How is emergency authority handled? | Fixture/runbook only. | Named break-glass authority, minimum scope, time limit, evidence, and post-use review. |
3. Permissions and trust-boundary matrix
| Principal / system | Authentication | Minimum authority in capstone | Trust boundary / evidence |
|---|---|---|---|
| Human contributor | GitHub account authentication | Issue/branch/PR operations; no owner-level capability needed for ordinary contribution. | PR author, commit SHA, review/check history. |
| Repository administrator | GitHub account + repo admin authorization | Configure ruleset/security settings; not used as routine bypass identity. | Ruleset state, settings evidence, audit/event evidence where available. |
verify GITHUB_TOKEN |
Per-job GitHub App installation token | contents: read. |
Workflow YAML at exact SHA + run permission metadata/logs. |
| Release job GITHUB_TOKEN | Per-job installation token |
contents: read,
attestations: write,
id-token: write.
|
Workflow YAML + attestation certificate/provenance + source SHA. |
| GitHub-hosted runner | Ephemeral hosted execution environment | Execute reviewed workflow; no production network is required. |
runs-on, job logs, attestation runner identity
policy.
|
| GitHub App / PAT | Not required in mandatory lab. | Prefer App installation token for integration; personal PAT only when an integration truly needs user-scoped authority. | App installation scope/token lifetime or PAT inventory/expiry. |
| Environment | GitHub deployment environment if used | Optional release gating; secrets only if a real external system requires them. | Environment rules/deployment record. |
| Package registry | Not required. | Optional GHCR package write only from release path; consumers read exact digest. | Package ACL, digest, provenance. |
| External cloud | Not required. | Optional short-lived OIDC federation with provider-side claim conditions. | Provider trust policy + deployment logs + GitHub OIDC claims. |
4. Validate ruleset, review, merge, and release governance
- Ruleset: retrieve the current ruleset via API and confirm it targets the intended branch, is Active, has no unintended bypass actor, and names the stable check that every relevant PR creates.
- Review: verify who actually approved the reviewed SHA. In the solo lab, explicitly mark independent approval as “not demonstrated.”
-
Merge identity: record the merge commit or squash
result that became
main. PR head SHA and final main SHA may differ. - Release identity: verify the tag resolves to the intended release SHA and the release assets match the attested digest.
- Rollback: identify a previous source SHA and artifact/release pair before you need it; do not invent rollback under incident pressure.
5. Hosted versus self-hosted execution and credential strategy
The mandatory capstone intentionally selects a standard GitHub-hosted runner because it removes the learner from runner registration, patching, persistence, and production-network governance. Public repositories also make standard hosted execution the no-paid path. This does not mean hosted runners are automatically “more secure” in every architecture; it means the trust and operating responsibilities differ.
| Choice | Benefit | New responsibility / risk |
|---|---|---|
| GitHub-hosted | Ephemeral managed image; no fleet lifecycle; easy public/free lab. | Pin actions, minimize token permissions, avoid trusting arbitrary PR code with privileged jobs. |
| Self-hosted | Private network/custom hardware/software. | Runner persistence, patching, isolation, registration tokens, label/group governance, network egress, credential reachability, cleanup. |
| Long-lived cloud secret | Simple compatibility. | Rotation, storage, blast radius, exfiltration risk; avoid when OIDC federation is supported. |
| OIDC federation | Short-lived provider credential based on workflow identity. |
Provider must validate
issuer/audience/repository/workflow/ref/environment claims
correctly; id-token: write alone is not
authorization.
|
6. Free security baseline versus enhanced controls
| Control area | Free/public proof | Enhanced production option |
|---|---|---|
| Dependencies | Dependabot config, graph/alerts where available, tests/review. | Org-wide policy/security configurations, private-registry controls, SLAs. |
| Code scanning | Public CodeQL default setup. | Private/internal Code Security entitlement; custom queries and policy gates. |
| Secrets | Public secret scanning/push protection path and dummy exercise. | Private/internal Secret Protection, custom patterns, delegated bypass where eligible. |
| Provenance | Public artifact attestation + consumer verification. | Private/internal Enterprise Cloud attestations; org/enterprise enforcement/verification policy. |
| Access | Personal-repo fixture. | Organization teams, delegated roles, enterprise identity/policy. |
| Audit | Git/API/workflow evidence. | Organization/enterprise audit API/export/streaming and external immutable retention. |
7. Monorepo/multi-repo and API/App automation boundaries
The capstone uses one repository because its components share one release and one learner. Production should split only when ownership, release cadence, visibility, compliance boundary, or operational independence outweigh cross-repository coordination cost. If a monorepo is chosen, path filtering must preserve cross-cutting/global changes and ownership rules must stay maintainable.
API automation follows the same identity rule. Use a first-class
gh command when it expresses the operation clearly; use
gh api/REST/GraphQL for structured automation; use a
GitHub App when a service needs durable installation-scoped identity
and events. Do not turn a human PAT into a pseudo-service account by
default.
8. Control → enforcement → evidence → owner map
| Objective | Enforcement / mechanism | Evidence | Owner |
|---|---|---|---|
| Only reviewed/tested changes reach main |
Ruleset + stable verify check + review policy.
|
Ruleset API, PR checks/review, merge SHA. | Repository maintainer; security validates exceptions. |
| PR code cannot request release identity | Job-level permissions and conditional release job. | Workflow YAML at PR/main SHA; run job permissions/logs. | Platform/CI owner. |
| Artifact maps to source | Deterministic build + SHA-256 + artifact attestation. | Digest file + attestation verification + release tag target. | Release owner; consumer verifies. |
| Known dependency changes are reviewed | Dependabot config + tests + review. | Dependabot PR, lockfile diff, test result. | Application owner. |
| Credential leak is contained quickly | Push protection + incident runbook. | Blocked push or alert; revoke/rotation evidence for real incidents. | Credential owner/security incident lead. |
| Exceptions do not become permanent | Exception owner, reason, expiry, restoration verification. | Exception register + post-expiry ruleset/settings evidence. | Control owner. |
| Costs do not drive bypass behavior | Standard runners, bounded artifact retention, concurrency, periodic usage review. | Workflow duration/storage/usage report and optimization backlog. | Platform owner. |
9. Plan and deployment compatibility matrix
| Capability | Free | Pro | Team | Enterprise Cloud | GHES / substitute |
|---|---|---|---|---|---|
| Public repository ruleset | Yes for public repo. | Yes; private personal coverage varies by feature. | Yes; org scope available according to plan. | Yes with broader enterprise policy. | Version/admin dependent; use local rules/branch controls fixture when unavailable. |
| Standard hosted Actions on public repo | Free/unlimited standard hosted usage for public repo. | Same public path. | Same public path. | Same public path plus enterprise controls. | GHES may use different runner architecture; simulate with hosted/public lab. |
| Public CodeQL | Yes. | Yes. | Yes. | Yes. | Version/license dependent; safe SARIF/CodeQL fixture substitute. |
| Private/internal Code Security | No mandatory path. | Not assumed. | Eligible with product entitlement. | Eligible with product entitlement. | Version/license dependent. |
| Public secret scanning/push protection | Yes public path. | Yes public path. | Yes public path. | Yes public path plus eligible advanced controls. | Version/license dependent; use dummy fixture. |
| Public artifact attestations | Yes. | Yes. | Yes. | Yes, including eligible private/internal use. | Version dependent; use official fixture if not available. |
| Custom org/repository roles | No. | No. | Not the mandatory assumption. | Yes where feature supports it. | Version/license dependent; role-matrix fixture. |
| Enterprise audit streaming | No. | No. | No. | Enterprise-owner feature; external sink required. | Different admin/audit model; fixture/existing logging platform. |
GitHub Enterprise Server capabilities change by server release and administrator policy. The matrix intentionally avoids pretending GitHub.com behavior is automatically present on every GHES instance; operators must check their deployed version and enabled features.
10. Measurable acceptance criteria
| Category | Pass condition |
|---|---|
| Security | PR job has no write/OIDC authority; no real secret is created; CodeQL runs; release provenance verifies under repository/workflow/ref/runner constraints. |
| Governance | Ruleset is Active, targets main, requires stable check; independent review gap is explicitly recorded in solo lab; exceptions have owner/expiry. |
| Reliability | One release source SHA maps to one recorded artifact digest; tampering is detected; rollback identifies previous known-good identity. |
| Performance/cost | Standard hosted runner only; concurrency cancels superseded same-ref runs; artifact retention is seven days; usage review has an owner. |
| Auditability | At least five critical invariants are provable from API/Git/workflow/attestation evidence and evidence files have their own SHA-256 manifest. |
| Recovery | Four controlled failures can be diagnosed without deleting evidence first; credential procedure starts with revoke/rotate; normal controls are restored after drill. |
Knowledge checks
Why is a permission matrix more useful than saying “CI has least privilege”?
It names each principal, credential mechanism, allowed operations, and evidence. That makes excess authority visible and testable.
A self-hosted runner has no repository write token but can reach the production database. Is the job low privilege?
No. Token permissions are only one authority dimension. Network reachability and ambient machine credentials can create a larger blast radius than the GitHub token.
Why must the control map include an owner?
Controls drift, exceptions arise, and evidence requires interpretation. Without an accountable owner there is no defined party to review, restore, or improve the control.
Can public CodeQL plus secret scanning substitute for a threat model?
No. Automated scanning detects classes of known patterns; architecture, authorization, business logic, abuse cases, and false negatives still require human security analysis.
What is the free-compatible substitute for enterprise audit streaming in this capstone?
Structured Git, REST/CLI, workflow, release, ruleset, and attestation evidence plus realistic audit fixtures. The lesson labels the limitation rather than fabricating an enterprise stream.
Summary
The implementation has now been challenged as an operating model. Human and machine identities have separate authority, each policy maps to evidence and ownership, plan-sensitive features have honest substitutes, and success criteria are measurable. Lesson 4 deliberately breaks these assumptions to prove the recovery model.
Official references
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.
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0
Send only Ethereum/ERC-20 compatible assets to this
address.