Security control matrix
One row per control, with where it is enforced and how to prove it is still enforced. Phase numbers refer to the organization setup phases in deployment-runbook.md.
The evidence column is meant to be run, not read. If a command cannot produce a result, the control is not in place, whatever the settings page suggests.
[object Object]
Access and identity
| ID | Control | Phase | Enforced by | Evidence | Owner |
|---|
| AC-1 | 2FA required for every member | 1 | org.json → two_factor_requirement_enabled | gh api orgs/<org> --jq .two_factor_requirement_enabled | security |
| AC-2 | Two or three owners, named | 0 | teams.yaml → owners | gh api orgs/<org>/members?role=admin --jq '.[].login' | eng lead |
| AC-3 | No default repository permission | 1 | org.json → default_repository_permission: none | gh api orgs/<org> --jq .default_repository_permission | security |
| AC-4 | Access flows through teams only | 2 | teams.yaml, applied by apply.sh | gh api orgs/<org>/teams/<slug>/repos/<org>/<repo> --jq .permission | platform |
| AC-5 | Agents have their own identity, never a person | 6 | agent-register.yaml, GitHub App installation on selected repos | gh api orgs/<org>/installations --jq '.[].app_slug' | ai lead |
| AC-6 | Agents hold write, never admin or maintain | 6 | teams.yaml (ai-agents: write) | gh api orgs/<org>/teams/ai-agents/repos/<org>/<repo> --jq .permission | security |
| AC-7 | Leavers removed the day they leave | 7 | Runbook offboarding checklist | gh api orgs/<org>/members --jq '.[].login' against the roster | security |
| AC-8 | Company login (SSO/SCIM) | 8 | Enterprise Cloud + IdP | gh api orgs/<org> --jq .saml_sso_enabled — false until Phase 8 | eng lead |
Branch and release integrity
| ID | Control | Phase | Enforced by | Evidence | Owner |
|---|
| BR-1 | No direct push to the default branch | 3 | rulesets/protect-main.json (pull_request rule) | gh api orgs/<org>/rulesets --jq '.[].name' | platform |
| BR-2 | One human approval, stale approvals dismissed | 3 | required_approving_review_count: 1, dismiss_stale_reviews_on_push | gh api orgs/<org>/rulesets/<id> --jq '.rules[] \| select(.type=="pull_request")' | platform |
| BR-3 | Last push approved by someone else | 3 | require_last_push_approval: true | same as BR-2 | platform |
| BR-4 | Code Owners must approve owned paths | 3 | require_code_owner_review + .github/CODEOWNERS | gh api repos/<org>/<repo>/contents/.github/CODEOWNERS --jq .path | eng lead |
| BR-5 | Deletions and force pushes blocked | 3 | deletion, non_fast_forward rules | gh api orgs/<org>/rulesets/<id> --jq '[.rules[].type]' | platform |
| BR-6 | Bypass list is OrganizationAdmin only | 3 | bypass_actors in both rulesets | gh api orgs/<org>/rulesets/<id> --jq '.bypass_actors' | security |
| BR-7 | Release tags immutable | 3 | rulesets/protect-release-tags.json | gh api orgs/<org>/rulesets --jq '.[] \| select(.target=="tag")' | platform |
| BR-8 | Stable releases use annotated tags | 5 | release.yml "Stable release tag must be annotated" | Run log for the release workflow | platform |
| BR-9 | Auto-merge disabled | 3 | repository.json → allow_auto_merge: false | gh api repos/<org>/<repo> --jq .allow_auto_merge | platform |
Code and dependency scanning
| ID | Control | Phase | Enforced by | Evidence | Owner |
|---|
| SC-1 | CodeQL on every PR and weekly | 4 | security.yml job security / codeql | gh api repos/<org>/<repo>/code-scanning/analyses --jq '.[0]' | security |
| SC-2 | High-severity alerts block merge | 3, 4 | code_scanning rule in protect-main.json | gh api orgs/<org>/rulesets/<id> --jq '.rules[] \| select(.type=="code_scanning")' | security |
| SC-3 | Dependabot alerts and security updates | 4 | org.json defaults + .github/dependabot.yml | gh api repos/<org>/<repo>/vulnerability-alerts -i → 204 | security |
| SC-4 | Dependency review on every PR | 4 | security.yml job security / dependency review | PR check run named security / dependency review | security |
| SC-5 | SBOM per package root, attached to releases | 4 | security.yml job security / sbom, provenance.yml | gh release view <tag> --json assets | platform |
| SC-6 | Shipped skill has zero runtime dependencies | 4 | security.yml "Shipped skill must declare no runtime dependencies" | node -p "Object.keys(require('./archify/package.json').dependencies||{})" | platform |
| SC-7 | Actions pinned to commit SHAs | 5 | test/workflow-action-pinning.test.mjs, security / action pins | node --test test/workflow-action-pinning.test.mjs | platform |
| SC-8 | Release provenance is verifiable (public repos; Team) | 5 | provenance.yml → actions/attest-build-provenance | gh attestation verify archify.zip --repo <org>/archify | platform |
Secrets
| ID | Control | Phase | Enforced by | Evidence | Owner |
|---|
| SE-1 | Secret scanning on private repos | 4 | repository.json → secret_scanning | gh api repos/<org>/<repo> --jq .security_and_analysis.secret_scanning.status | security |
| SE-2 | Push protection blocks a secret before it lands | 4 | repository.json → secret_scanning_push_protection | gh api repos/<org>/<repo> --jq .security_and_analysis.secret_scanning_push_protection.status | security |
| SE-3 | Non-provider patterns and validity checks | 4 | secret_scanning_non_provider_patterns, secret_scanning_validity_checks | same endpoint | security |
| SE-4 | Production secrets only on a protected environment | 5 | environments/cloudflare-pages.json | gh api repos/<org>/<repo>/environments --jq '.environments[].name' | platform |
| SE-5 | Secret inventory with owners and rotation | 5 | secrets-inventory.yaml | grep -c 'name:' enterprise/governance/secrets-inventory.yaml | security |
| SE-6 | Private vulnerability reporting open | 4 | repository.json → private_vulnerability_reporting | gh api repos/<org>/<repo>/private-vulnerability-reporting --jq .enabled | security |
CI/CD execution
| ID | Control | Phase | Enforced by | Evidence | Owner |
|---|
| CI-1 | Default token is read-only | 5 | top-level permissions: contents: read in every workflow | grep -n 'permissions:' .github/workflows/*.yml | platform |
| CI-2 | Actions limited to GitHub-verified creators + named | 5 | Org Settings → Actions → General (UI, Phase 5) | Screenshot in the phase record; gh api orgs/<org>/actions/permissions | platform |
| CI-3 | No workflow can create or approve PRs | 5 | Org Settings → Actions → General (UI) | gh api orgs/<org>/actions/permissions/workflow --jq .default_workflow_permissions | platform |
| CI-4 | Outside contributors need approval to run workflows | 5 | Org Settings → Actions → General (UI) | gh api repos/<org>/<repo>/actions/permissions/fork-pr-contributor-approval | platform |
| CI-5 | Production release waits for a human (public repos on Team) | 5 | environment: production in release.yml | gh api repos/<org>/<repo>/environments/production --jq '.protection_rules' | platform |
| CI-6 | No deploy from a pull request | 5 | if: guards on deploy-pages, deploy-cloudflare | grep -n "refs/heads/main" .github/workflows/ci.yml | platform |
| CI-7 | Privileged pull_request_target never runs PR code | 5 | contributor-cards.yml checks out the default branch | Run log for the card workflow | platform |
Oversight
| ID | Control | Phase | Enforced by | Evidence | Owner |
|---|
| OV-1 | Configuration drift detected daily | 7 | governance.yml + verify.sh | Latest governance / drift run | platform |
| OV-2 | Alerts reviewed weekly | 4, 7 | Rota, recorded in the review log | Review log entry per week | security |
| OV-3 | Agent register reviewed quarterly | 7 | agent-register.yaml → review_due | grep review_due enterprise/governance/agent-register.yaml | ai lead |
| OV-4 | Spend limits on Actions, Copilot, security products | 7 | Billing → spending limits (UI) | Screenshot in the phase record | eng lead |
| OV-5 | Audit log reviewed monthly (UI on Team; API needs Enterprise) | 7 | Org Settings → Logs | Monthly review entry | security |
| OV-6 | Team membership reviewed quarterly | 7 | Roster vs gh api orgs/<org>/teams/<slug>/members | Review log entry | security |
Residual risks
Recorded because pretending they are closed is worse than naming them.
| Risk | Why it remains | Mitigation | Accepted by |
|---|
A contributor with write can push to a non-default branch, including one a workflow trusts by name. | Branch protection covers the default branch; other branches are working space. | No workflow deploys or publishes from a non-default branch. Deploy jobs check refs/heads/main. | platform |
| Fork PRs do not get CodeQL results. | GitHub does not grant security-events: write to fork workflows. | Post-merge analysis on main plus the code_scanning ruleset rule; the aggregate test (22) gate still runs on forks. | security |
| Secret scanning on private repositories needs a paid product. | Plan limit, not a configuration mistake. | verify.sh reports the status; the runbook records the plan decision. Public repositories get it free. | eng lead |
| An agent's pull request can contain prompt-injected content from an issue it read. | Agent behaviour is not fully deterministic. | Agents never merge, never hold production secrets, and workflows triggered by their PRs need approval. | ai lead |
| The Cloudflare token is shared by production and preview. | One project, one token scope. | Separated by environment so a fork PR cannot read it; rotation is 90 days. | platform |
governance.yml cannot read org settings without a long-lived token. | GITHUB_TOKEN is repository-scoped. | Read-only token, 90-day rotation, prefer a GitHub App installation token. | security |
archify.zip is committed to the repository. | It is the install artifact for agents that cannot run a build. | zip-freshness proves it is the deterministic build; provenance.yml attests the published bytes against the tagged blob. | platform |
Evidence collection
For a review, a release, or an audit, collect one file:
{
echo "# Control evidence $(date -u +%FT%TZ)"
echo
echo '## Drift'
enterprise/governance/verify.sh --org <org> --repo <org>/archify
echo
echo '## Rulesets'
gh api orgs/<org>/rulesets --jq '.[] | {name, target, enforcement}'
echo
echo '## Environments'
gh api repos/<org>/<repo>/environments --jq '.environments[] | {name, protection_rules}'
echo
echo '## Scanning'
gh api repos/<org>/<repo> --jq .security_and_analysis
echo
echo '## Latest release provenance'
gh release view --json tagName,assets --jq '{tagName, assets: [.assets[].name]}'
} > "evidence/controls-$(date -u +%Y%m%d).md"
Store it with the release record. A control with no evidence line is open, even if this table says otherwise.