Skip to content

ci(security): add harden-runner (egress audit) to every job#274

Merged
devantler merged 1 commit into
mainfrom
claude/security-harden-runner-all-jobs
Jun 2, 2026
Merged

ci(security): add harden-runner (egress audit) to every job#274
devantler merged 1 commit into
mainfrom
claude/security-harden-runner-all-jobs

Conversation

@devantler
Copy link
Copy Markdown
Contributor

🤖 Generated by the Daily AI Assistant

Fixes #267Option A (apply the rule, harden the library).

What

AGENTS.md (Reusable Workflow Conventions, rule 3) requires step-security/harden-runner as the first step of every job with egress-policy: audit, but only publish-app.yaml actually had it (1 of 14 at audit time). This reconciles the doc-vs-reality drift by adding the canonical hardened step to all 21 remaining jobs that run steps, across 13 workflows.

Why Option A

Per the issue, both options close the gap; I took A (the issue's own lean) because it's the most defensible read of the current AGENTS.md wording, is low-risk and backward-compatible (audit mode only records egress — it never blocks), and gives every consumer egress telemetry. No AGENTS.md change is needed — the rule already says this; reality now matches it.

Scope notes

  • Reusable-call jobs are intentionally skipped. uses:-style caller jobs (e.g. all the test-* jobs in ci.yaml, the release job in .create-release.yaml) can't carry steps — harden-runner lives inside the called workflow, so those are correctly untouched.
  • .sync-labels.yaml is included even though the original audit table omitted it — its sync job runs steps and was missing the rule. (template-sync.yaml from the audit table has since been removed upstream, so it's no longer in scope.)
  • Pinned to the same SHA already used in publish-app.yaml: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4.

Validation

  • actionlint clean on the change — the only findings are pre-existing code-quality permission-scope warnings (from the Code Quality coverage migration; actionlint's version doesn't yet know that real GitHub scope) and are present on main unchanged.
  • Purely additive: 13 files, +105 lines (21 jobs × 5), no behavior change.

Acceptance criteria (from #267)

  • AGENTS.md and the workflows agree — every step-running job now has harden-runner (Option A).
  • actionlint-clean; one focused PR; no behavior change (audit mode).

AGENTS.md requires step-security/harden-runner as the first step of every
job (egress-policy: audit), but only publish-app.yaml had it. Reconcile the
doc-vs-reality drift by adding the canonical hardened step to all 21 remaining
jobs that run steps, across 13 workflows.

Audit mode is non-blocking — it only records egress for visibility — so this
is backward-compatible with no behavior change. Reusable-workflow caller jobs
(uses:) are intentionally skipped: harden-runner lives in the called workflow.

Also covers .sync-labels.yaml's sync job, which the original audit in #267
missed (it counted only the 14 non-dotfile workflows; template-sync.yaml has
since been removed).

Fixes #267

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 1, 2026 22:20
@github-project-automation github-project-automation Bot moved this to 🫴 Ready in 🌊 Project Board Jun 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aligns the repository’s workflow implementation with AGENTS.md rule 3 by adding step-security/harden-runner (with egress-policy: audit) as the first step in every job that executes steps across the affected workflows.

Changes:

  • Add step-security/harden-runner (pinned SHA, audit mode) as the first step to step-running jobs across the repository workflows.
  • Extend the same hardening step to internal maintenance workflows where jobs run steps (e.g. .sync-labels.yaml).
  • Keep behavior non-blocking by using egress-policy: audit consistently.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/validate-go-project.yaml Adds harden-runner as the first step to all step-running jobs in the Go validation workflow.
.github/workflows/update-agent-skills.yaml Adds harden-runner as the first step in the skill update job.
.github/workflows/sync-cluster-policies.yaml Adds harden-runner before token generation/checkout in the sync job.
.github/workflows/scan-for-workflow-vulnerabilities.yaml Adds harden-runner as the first step in the zizmor scan job.
.github/workflows/scan-for-todo-comments.yaml Adds harden-runner as the first step in the TODO scanning job.
.github/workflows/run-dotnet-tests.yaml Adds harden-runner as the first step in the .NET test job.
.github/workflows/publish-dotnet-library.yaml Adds harden-runner as the first step in the publish job.
.github/workflows/enable-auto-merge.yaml Adds harden-runner as the first step in the auto-merge job.
.github/workflows/deploy-github-pages.yaml Adds harden-runner as the first step in both build and deploy jobs.
.github/workflows/delete-workflow-runs.yaml Adds harden-runner as the first step in the cleanup job.
.github/workflows/create-release.yaml Adds harden-runner as the first step in the release job.
.github/workflows/ci.yaml Adds harden-runner to the step-running ci-required-checks aggregation job.
.github/workflows/.sync-labels.yaml Adds harden-runner as the first step in the internal label sync job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@devantler devantler marked this pull request as ready for review June 2, 2026 06:11
@devantler devantler merged commit bb641cc into main Jun 2, 2026
41 checks passed
@github-project-automation github-project-automation Bot moved this from 🫴 Ready to ✅ Done in 🌊 Project Board Jun 2, 2026
@devantler devantler deleted the claude/security-harden-runner-all-jobs branch June 2, 2026 06:46
@botantler
Copy link
Copy Markdown
Contributor

botantler Bot commented Jun 2, 2026

🎉 This PR is included in version 5.4.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@botantler botantler Bot added the released an issue that has been solved in a release label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released an issue that has been solved in a release

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

ci(security): reconcile harden-runner — AGENTS.md requires it on every job, only publish-app has it

2 participants