Architecture as Code · Module 3 · Security, Governance & Assurance

Governance as Code

The lesson treats governance itself as code. It covers the assure once, comply many principle, the five-stage approval workflow for governance artefacts built on pull requests, the competency gaps that appear when governance professionals move into repositories and how to close them, tooling for non-developers, policies for encryption at rest and tag compliance evaluated against a plan and tested in CI, and six metrics of governance effectiveness.

Lesson 14 of 31Chapter 1175 minutes

Read the chapterThe whitepaperThe slides

All courses / Architecture as Code / Module 3 / Chapter 11

Learning objectives

After the lesson the participant can:

Key concepts

Assure once, comply many
The principle that governance guardrails are expressed, tested and evidenced once, then reused across frameworks such as ISO 27001, SOC 2, NIST 800-53, GDPR and internal control catalogues.
Governance workflow stages
Draft and proposal on feature branches, review and approval through pull requests with templates, validation and testing in the CI pipeline, documentation and traceability through ADR linking, and production deployment by merge to a protected main branch.
Competency gaps in transition
The skills governance owners, risk managers and compliance leads lack when work moves into repositories. The chapter answers with explicit repository roles, targeted training, pairing with engineers and starting with low-risk components.
Tooling for non-developers
Low-code policy editors that generate policy language from guided forms, template-driven pull requests, documentation portals, chat integrations for review and approval, and automated policy explainers in natural language.
Governance effectiveness metrics
Policy coverage (at least 95 per cent), policy pass rate (at least 90 per cent), time to policy adoption (at most 5 business days), exception rate (decreasing), audit readiness score (at least 80 per cent) and remediation lead time (at most 48 hours).

Interactive exercises

Do them here and get feedback at once. Choose a card and then where it belongs, or drag it.

Interactive exercise 1 · Match

Stages of the governance workflow

Match each stage of the governance workflow to the participants and the outcome the chapter's table gives for it.

Interactive exercise 2 · Scenario

The compliance lead and the repository

Read the situation and choose what the chapter's reasoning leads to. Each choice gives feedback.

Teaching plan

10 minTeacher presents the governance pipeline around a single repository and the assure once, comply many principle.
15 minWalk through the five workflow stages. Participants role-play a pull request for a new tagging policy as policy author, security officer and business sponsor.
15 minTeacher covers competency gaps, tooling for non-developers, the two policy examples and the testing of policies with a test runner.
25 minExercise: design the approval workflow and the metric set for one governance artefact.
10 minPlenary: which targets are realistic today, and what the backlog of state backend controls shows about sequencing.

Discussion

  1. How can a pull request give a more formal audit trail than a signed approval document, and what must be configured for that to hold?
  2. The chapter keeps governance owners' expertise at the centre by giving them folders and review rights. What would they need before they could use those rights with confidence?
  3. Why must governance policies themselves be tested, and what could go wrong with an untested policy that blocks or passes everything?

Written exercise

Exercise · 25 minutes

An approval workflow for one governance artefact

Choose one governance rule from your own organisation, for example that all storage must be encrypted at rest with an approved key, or that every resource carries tags for owner and cost centre. Design its journey through the chapter's five stages. For each stage name the mechanism, the stakeholders, the automated controls and the outcome. Write the pull request template fields a reviewer must see, including risk assessment and the mapping to control identifiers. Describe one positive and one negative test case for the policy. Finally pick three of the six effectiveness metrics, set a target for each and say where the data comes from.

Deliverable: A five-row workflow table for the chosen rule, a pull request template outline, two policy test cases, and three metrics with targets and data sources.

Self-test

Choose an answer to see whether it is right, or open the answer below each question.

  1. What target does the chapter set for time to policy adoption, from proposal to production merge?

    Show the answer

    C. At most 5 business days
    The metrics table sets time to policy adoption at no more than 5 business days. The 48-hour target belongs to remediation lead time.

  2. Which mechanism does the chapter assign to the review and approval stage of the governance workflow?

    Show the answer

    B. Pull requests with templates
    Review and approval uses pull requests with templates, with policy-as-code validations, required reviewers and signed commits as automated controls, giving formal approval gates.

  3. How does the chapter recommend staging the transition to Governance as Code?

    Show the answer

    D. Start with low-risk governance components and scale after feedback
    The chapter advises starting with low-risk governance components so the organisation can gather feedback and fine-tune the approach before scaling to critical controls.