You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Five focused trims:
- Cron-time bug: header callout said 07:13 UTC; the cron is
21 4 * * * (04:21 UTC). Match the doc to the code.
- AUDIT_PAT pre-check heredoc compresses from 16 lines to 5; the
failure report links back to SECURITY.md instead of inlining
provisioning steps.
- Define "agent-managed workflows" once near the top of GitHub
Actions Policies, drop the parenthetical enumeration from the
two later FAIL IFs that referenced it.
- Audit prompt drops a duplicated $GH_TOKEN description and a
redundant "available environment" trailer; same instructions in
~30 lines instead of ~50.
- "Audit visibility" paragraph reduced from 4 sentences to 2 —
the gap-resistant timestamp mechanism doesn't need to live in
SECURITY.md, it's an implementation detail of the workflow.
Net: -36 lines across the two files, same behavior.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .github/workflows/security-audit.yaml
+30-66Lines changed: 30 additions & 66 deletions
Original file line number
Diff line number
Diff line change
@@ -49,27 +49,10 @@ jobs:
49
49
env:
50
50
AUDIT_PAT: ${{ secrets.AUDIT_PAT }}
51
51
run: |
52
-
if [ -n "$AUDIT_PAT" ]; then
53
-
echo "AUDIT_PAT present."
54
-
exit 0
55
-
fi
52
+
[ -n "$AUDIT_PAT" ] && exit 0
56
53
echo "FAIL" > audit-status.txt
57
-
cat > audit-report.md <<'EOF'
58
-
## Summary
59
-
60
-
**Overall status: FAIL.** `AUDIT_PAT` is not present in the
61
-
`security-audit` environment.
62
-
63
-
The audit refuses to run without `AUDIT_PAT`. It needs read-only
64
-
`Administration`, `Secrets`, and `Environments` access to
65
-
verify the ruleset, secret, and environment FAIL IFs.
66
-
67
-
Provision per `SECURITY.md` > CI Validation Contract: mint a
68
-
fine-grained PAT scoped to this repository only, then run
69
-
`gh secret set AUDIT_PAT --env security-audit --repo
70
-
diffplug/dormouse`.
71
-
EOF
72
-
echo "::error::AUDIT_PAT secret is not set in the security-audit environment."
54
+
echo "**FAIL** — \`AUDIT_PAT\` is not present in the \`security-audit\` environment. See [SECURITY.md > CI Validation Contract](https://github.com/$GITHUB_REPOSITORY/blob/main/SECURITY.md#ci-validation-contract) for provisioning." > audit-report.md
Copy file name to clipboardExpand all lines: SECURITY.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Security
2
2
3
-
> **Audited automatically.** This spec is checked against the repository by [`security-audit.yaml`](.github/workflows/security-audit.yaml) on a 24-hour schedule (07:13 UTC) and as a required gate before every VS Code release. Each failure is filed as an issue labeled [`security-audit-failure`](https://github.com/diffplug/dormouse/issues?q=is%3Aissue+label%3Asecurity-audit-failure) — open ones are live, closed ones are the historical record of what tripped past audits and what changed to clear them.
3
+
> **Audited automatically.** This spec is checked against the repository by [`security-audit.yaml`](.github/workflows/security-audit.yaml) on a 24-hour schedule (04:21 UTC) and as a required gate before every VS Code release. Each failure is filed as an issue labeled [`security-audit-failure`](https://github.com/diffplug/dormouse/issues?q=is%3Aissue+label%3Asecurity-audit-failure) — open ones are live, closed ones are the historical record of what tripped past audits and what changed to clear them.
4
4
5
5
Dormouse is a terminal, so users trust it with shells, source trees, credentials, and local files. The dependency graph and release pipeline is part of the product's security boundary.
6
6
@@ -23,7 +23,7 @@ New npm package versions are not adopted immediately. The workspace uses pnpm's
23
23
24
24
GitHub Actions are always pinned by commit hash, not version tag. Dependabot will update the hashes as necessary.
25
25
26
-
The agent-managed workflows (`tend-*.yaml`, `workflow-audit.yaml`, and `security-audit.yaml`) are exempt from the two rules below because they run Claude-powered automation that requires modifying issues, PRs, or code, or fetching an OIDC token. Their scope is bounded separately in the "Automated Maintainer" section.
26
+
**Agent-managed workflows** are `tend-*.yaml`, `workflow-audit.yaml`, and `security-audit.yaml`. They implement the repo's automation and self-audit infrastructure, and are exempt from the two rules below because they need to modify issues, PRs, or code, or fetch an OIDC token. Their bounded scope is defined in the "Automated Maintainer" section.
27
27
28
28
- FAIL IF `pull_request_target` appears in any `.github/workflows/**` file other than `tend-*.yaml`.
29
29
- FAIL IF a non-agent-managed workflow grants write permissions other than the explicitly scoped release provenance permissions `id-token: write` and `attestations: write`.
@@ -40,7 +40,7 @@ This repository runs the [tend](https://github.com/max-sixty/tend) agent harness
40
40
41
41
**Upstream compromise.** Tend's action is pinned by commit SHA (`max-sixty/tend@<sha>`) in every generated workflow, so silent updates to the running setup are not possible. `uvx tend@latest` runs only at install and during nightly regen; a compromise of that path would affect the next re-run, not the in-flight workflows.
42
42
43
-
**Audit visibility.**`workflow-audit.yaml` is a nightly job that walks every commit touching `.github/workflows/` since its previous successful run (using the GitHub API's timestamp as the lower bound, so a failed run pushes the window forward rather than dropping commits). It opens an issue summarizing each commit's author, refs, and changed files. A bot push that adds a new workflow file is visible in the next successful audit even if the bot tries to silently modify the audit workflow — the modification itself appears in the audit.
43
+
**Audit visibility.**`workflow-audit.yaml` is a nightly job that walks every commit touching `.github/workflows/` since its previous successful run, opening an issue summarizing each. A bot push that disables or modifies the audit itself is caught in the next successful run's diff window.
44
44
45
45
- FAIL IF the repository ruleset named `Merge access` is missing, doesn't target `~DEFAULT_BRANCH`, blocks anything other than `update`, or doesn't have admin (`RepositoryRole` actor `5`) as its sole bypass actor.
46
46
- FAIL IF the repository ruleset named `Tag operations` is missing, doesn't target `~ALL` tags, doesn't block both `creation` and `update`, or doesn't have admin-only bypass.
@@ -50,8 +50,8 @@ This repository runs the [tend](https://github.com/max-sixty/tend) agent harness
50
50
- FAIL IF `AUDIT_PAT` is missing from the `security-audit` environment, or is present at the repo level instead. The audit refuses to run without it, and it must be env-scoped so a bot-pushed feature branch cannot reach it.
51
51
- FAIL IF `CHROMATIC_PROJECT_TOKEN` is missing from `secrets.allowed` in `.config/tend.yaml`. The allowlist entry is an explicit acknowledgment that the bot can read this token.
52
52
- FAIL IF `.github/workflows/workflow-audit.yaml` is missing, disabled, or has not produced a successful run in the last 48 hours.
53
-
- FAIL IF any `tend-*.yaml` workflow uses an unpinned action reference (e.g. `@main`, no version). Inside `tend-*.yaml`, both tag pins (`@v6`, `@0.0.25`) and SHA pins are accepted because the file is owned by the upstream generator (`max-sixty/tend`), which currently uses tag pins. All actions in every other workflow — including `workflow-audit.yaml` and `security-audit.yaml` — must follow the SHA-pin rule in "GitHub Actions Policies".
54
-
- FAIL IF any agent-managed workflow (`tend-*.yaml`, `workflow-audit.yaml`, `security-audit.yaml`) grants a permission beyond `contents: write`, `pull-requests: write`, `issues: write`, `id-token: write`, `actions: read`, or any `read` permission.
53
+
- FAIL IF any `tend-*.yaml` workflow uses an unpinned action reference (e.g. `@main`, no version). Tag pins are accepted inside `tend-*.yaml`because the file is owned by the upstream generator; every other workflow — agent-managed or not — must SHA-pin per the rule above.
54
+
- FAIL IF any agent-managed workflow grants a permission beyond `contents: write`, `pull-requests: write`, `issues: write`, `id-token: write`, `actions: read`, or any `read` permission.
0 commit comments