Chapter 32Lesson 01~240 minutes

Production Capstone: Govern a GitHub Organization and Build a Secure End-to-End Delivery System: Requirements, Constraints, and Target Architecture

Turn the GitHub course into an explicit production operating model by defining requirements, boundaries, identities, controls, evidence, failure assumptions, and a free-compatible target architecture before selecting features.

CapstoneArchitectureGovernanceThreat modelRecovery

Learning objectives

  • Translate the capstone goal into testable functional, security, governance, reliability, cost, recovery, and auditability requirements before selecting GitHub controls.
  • Design a target topology for repositories, roles, change governance, Actions trust, security automation, release identity, provenance, evidence, and recovery.
  • Separate the mandatory GitHub Free/public-repository implementation from organization, Team, Enterprise Cloud, GHES, Code Security, Secret Protection, package, and cloud extensions.
  • Explain how human identity, GITHUB_TOKEN, OIDC, runners, artifacts, rulesets, and consumer verification form distinct trust boundaries.
  • Define continuity assumptions for emergency change, credential and runner compromise, failed release, residual access, and repository/organization recovery.

1. The capstone problem: make GitHub operable, not merely configured

A production GitHub platform is not a pile of enabled features. It is a delivery system in which human identities, repository state, automation identities, release artifacts, security findings, and evidence all have explicit owners and boundaries. Earlier chapters introduced these pieces separately. The capstone starts by asking a harder question: what must remain true when they interact, fail, or are operated under time pressure?

Before choosing a ruleset, runner, package registry, secret store, or scanning feature, write requirements in observable terms. “Use secure CI” is not testable. “Pull-request jobs receive only read access to repository contents; release provenance is produced only from a manual run on main; consumers verify the exact artifact digest” is testable.

Mandatory implementation boundary: the runnable capstone uses one disposable public personal repository on GitHub.com and standard GitHub-hosted runners. Organization teams, enterprise audit streaming, private-repository advanced security, self-hosted runners, external cloud deployment, and private packages are extensions or fixtures. A solo personal repository cannot demonstrate real separation of duties; the lessons say so explicitly.

2. Convert goals into acceptance requirements

Dimension Requirement Independent evidence
Functional An issue becomes a PR; the PR produces the stable verify check; merged main can produce a release artifact. Issue/PR metadata, workflow run, commit SHA, release tag target.
Security PR automation is read-only; no long-lived release credential exists; public security scanning is enabled; fake secret exercise never bypasses protection. Workflow YAML at the commit, CodeQL settings/alerts, push rejection, repository secret inventory.
Governance Direct change to protected main is not the normal path; required checks and review policy are explicit; exceptions have an owner and expiry. Ruleset JSON/UI, PR review history, exception record fixture.
Reliability The release artifact is deterministic for one source SHA; reruns are bounded by concurrency; rollback identifies a known-good source/artifact pair. SHA-256 file, run metadata, release record, rollback runbook.
Cost/performance Standard hosted runner only; artifacts retained seven days; no permanent self-hosted fleet or cloud resource. Workflow runner label and retention config; Actions usage page if accessible.
Recovery Credential compromise, failed release, ruleset deadlock, residual access, and provenance mismatch have evidence-first procedures. Failure drill records with containment, recovery, verification, residual risk.
Auditability Every critical invariant can be re-derived from Git/API/workflow/attestation evidence rather than a screenshot alone. Evidence manifest and verification commands.

These requirements deliberately mix product controls and operating practices. GitHub can enforce some statements directly; others—such as who is allowed to invoke emergency procedure or how rapidly an exception expires—remain team policy and must be backed by evidence.

3. Target architecture: control plane, execution plane, artifact plane, evidence plane

Concept / workflow diagram
flowchart TD
I[Issue / requirement] --> PR[Pull request]
PR --> RS[Repository ruleset]
PR --> CI[Hosted Actions: verify]
RS --> M[Merge to main]
CI --> M
M --> RD[Manual release-evidence run]
RD --> A[Immutable artifact bytes + SHA-256]
RD --> AT[GitHub artifact attestation]
A --> R[GitHub Release]
AT --> V[Consumer verification]
R --> V
PR --> E[Evidence inventory]
CI --> E
RS --> E
RD --> E
R --> E

The issue and PR define change intent. The ruleset and stable verify check are the merge-control boundary. A separate manual release-evidence job runs only on main, receives OIDC/attestation authority that PR jobs do not have, and creates evidence for exact artifact bytes. Release consumers verify the digest and attestation; they do not trust the filename or a green UI badge alone.

The arrows are causal claims that the capstone will verify. A PR does not become a release merely because CI was green. Merge creates a source commit. A release run binds artifact bytes to that commit. A release record references those bytes. The consumer independently checks both the release tag target and the artifact attestation.

4. Identity and trust boundaries

Concept / workflow diagram
flowchart TB
H[Human account] -->|issue / PR / review| GH[GitHub repository]
GH -->|event| R[GitHub-hosted runner]
R -->|job-scoped| T[GITHUB_TOKEN]
R -->|release job only| O[GitHub OIDC identity]
O --> AT[Attestation signing service]
T --> API[Repository API]
AT --> C[Consumer verification]
EXT[Optional cloud / registry] -. not required .-> O

Human authorization controls repository changes. Each job gets a repository-scoped GITHUB_TOKEN whose effective permissions are constrained in workflow YAML. OIDC is granted only to the release-evidence job for artifact attestation; the mandatory lab does not exchange that identity for cloud credentials. Optional external systems are separate trust domains and must impose their own claim policy.

Authentication answers “which identity made this request?” Authorization answers “what may it do?” A valid workflow identity is not automatically trusted to deploy production. Likewise, a valid artifact attestation proves a signed provenance statement about bytes; consumer policy still decides whether the repository, workflow, ref, runner class, and digest are acceptable.

5. Repository and organization topology

Model Mandatory Free path Organization extension
Ownership One disposable public personal repository. Disposable organization owns repositories; at least two owners for continuity in a real organization, with routine work delegated.
Teams Simulated role matrix because personal repos do not have org teams. engineering, security, and release teams; persistent access granted through teams.
Repositories One repo contains source, workflow, governance docs, and evidence index. Split application, platform policy, and documentation/release tooling only when ownership/lifecycle justify it.
Rules Repository ruleset on public repo. Organization rulesets can standardize multiple repositories when plan/policy permits.
Audit Git/API/workflow evidence + fixture for organization audit events. Organization/enterprise audit log, export/API/streaming when available.

Multi-repository architecture is not inherently more mature. Splitting repositories adds independent permissions, releases, dependency edges, API calls, and incident scope. A monorepo adds path ownership and selective-CI complexity. The capstone keeps the free path intentionally small so each control can be proved.

6. Change and release governance

  • Issue: captures requirement, risk, acceptance criteria, and owner before implementation.
  • Pull request: carries a bounded diff and exposes the exact head SHA under review.
  • Ruleset: makes the intended merge policy machine-enforced. The capstone requires a pull request and a stable verify status check after that check has run successfully in the repository.
  • Review: in the solo mandatory lab, review is a recorded checklist rather than independent approval. In an organization, require qualified reviewers/CODEOWNERS where supported and operationally appropriate.
  • Release: a release points to a known source commit and publishes exact artifact/digest evidence. Mutable labels are not substituted for immutable identity.
  • Emergency path: never assume “admins can bypass” is a recovery plan. Define who may invoke emergency procedure, what evidence must be preserved, what temporary relaxation is allowed, how long it lasts, and how normal policy is restored.

7. Security baseline and incident responsibilities

Control Mandatory public path Responsible response
Dependency automation Dependabot version-update configuration; dependency graph/alerts inspected where available. Application maintainer evaluates compatibility; security owner defines vulnerability SLA.
Code scanning CodeQL default setup for harmless JavaScript. Developer remediates; security reviewer validates risk and dismissal rationale.
Secret protection GitHub-documented dummy secret triggers push protection; learner cancels rather than bypasses. For a real leak: revoke/rotate first, assess use, migrate dependents, remove exposure, then evaluate history rewrite.
Artifact attestation Release artifact receives GitHub artifact attestation. Release owner publishes; consumer independently verifies repository/workflow/ref/digest policy.
Packages Not required. Optional GHCR promotion can reuse the same digest/provenance model. Package owner manages package ACL/lifecycle; consumer pins digest/version.

8. Business continuity assumptions

Recovery is designed before the incident. The capstone defines six continuity cases:

  1. Ruleset/required-check deadlock: inspect which rule and check are blocking; repair the check or use a pre-authorized, time-bounded emergency procedure rather than improvising a bypass.
  2. Failed release: stop promotion, identify last known-good commit and artifact digest, and publish/restore from known evidence. Do not move an existing release tag silently.
  3. Credential compromise: revoke/rotate first. Git history cleanup is secondary containment because deleting bytes does not invalidate a credential already copied.
  4. Runner compromise: stop affected jobs, revoke reachable credentials/tokens, isolate the runner/network, preserve logs, and rebuild on a trusted runner. The mandatory lab uses hosted runners and simulates this scenario.
  5. Residual access: resolve all additive access paths—direct grant, teams, base permission, app installation, deploy keys/tokens—then verify effective access independently.
  6. Repository/organization loss: source history alone is not the whole service. Preserve release artifacts/evidence, policy-as-code, runbooks, ownership contacts, external dependencies, and restore procedures.

9. Availability map before implementation

Capability Free/public mandatory path Optional / plan-sensitive extension
Repository rulesets Use repository ruleset on public repository. Organization-wide multi-repository rulesets require an eligible organization plan.
Hosted Actions Use standard GitHub-hosted Ubuntu runner. Larger runners/private usage can have billing/plan implications.
Code scanning CodeQL on public repository. Private/internal advanced security requires eligible Code Security entitlement.
Secret scanning/push protection Public-repository/user protection path. Private/internal org coverage and advanced controls require eligible Secret Protection entitlement.
Artifact attestations Public repository path. Private/internal repository support requires eligible Enterprise Cloud context.
Organization teams/custom roles Not required; use role fixture. Teams are organization features; custom org/repo roles are Enterprise Cloud features.
Audit API/streaming Use Git/API/workflow evidence + fixtures. Rich organization/enterprise audit APIs and streaming are enterprise/role dependent.
External OIDC deployment Not required; OIDC is used only by attestation action. Optional cloud provider must validate issuer/audience/repository/workflow/ref claims.

Knowledge checks

Why does the capstone define requirements before selecting GitHub features?

A release artifact has a valid GitHub attestation. Is deployment now automatically authorized?

Why is a solo public repository an incomplete model of production governance?

What is the first containment action for a real credential committed to Git?

What would make an emergency bypass credible?

Summary

The capstone architecture is deliberately evidence-centered. It has separate change, execution, release, provenance, and evidence planes; explicit human and automation identities; a mandatory public/free implementation; and an extension map for controls that need an organization, paid product, or external system. Lesson 2 now builds the disposable system and proves each state transition.

Next lesson

Production Capstone: Govern a GitHub Organization and Build a Secure End-to-End Delivery System: Implementation and Automation Build-Out

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.

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