Skip to content

feat(#28): add harden-runner in audit mode to all CI jobs#39

Open
ms280690 wants to merge 4 commits into
mainfrom
issue-28-harden-runner
Open

feat(#28): add harden-runner in audit mode to all CI jobs#39
ms280690 wants to merge 4 commits into
mainfrom
issue-28-harden-runner

Conversation

@ms280690
Copy link
Copy Markdown
Collaborator

@ms280690 ms280690 commented Jun 1, 2026

Summary

  • Adds step-security/harden-runner@9af89fc7 (v2.19.4) as the first step in all 6 CI jobs (actionlint, zizmor, scorecard, dependency-review, terramate-opentofu-setup, storage-optimizer).
  • Runs with egress-policy: audit — logs all outbound network calls, blocks nothing. This builds the baseline domain allowlist needed before switching to enforce mode (phase 2).
  • Adds step-security/harden-runner to docs/approved-actions.md and step-security/* to the org allowlist patterns.

Why audit mode first

Switching directly to enforce with an incomplete allowlist would break legitimate traffic (package registries, scanner update feeds, cloud APIs). Audit mode runs silently for 2–4 weeks, surfacing all real domains. Once the list is stable, a follow-up PR switches to enforce with an explicit allowed-endpoints block.

Test plan

  • CI run passes on this PR — all jobs execute without harden-runner blocking anything
  • Check StepSecurity dashboard after first main-branch run to confirm egress data is flowing
  • After 2–4 weeks of audit data, open follow-up issue/PR to switch to enforce mode with explicit allowlist

Closes #28

Data from sample run on this branch: https://app.stepsecurity.io/github/sparkgeo/github-actions/actions/runs/26779096208

🤖 Generated with Claude Code

ms280690 and others added 3 commits June 1, 2026 11:52
Add step-security/harden-runner@9af89fc7 (v2.19.4) as the first step in
every CI job. Runs in egress-policy: audit — logs all outbound network
traffic without blocking. Provides the baseline dataset needed to build
an explicit allowlist before switching to enforce mode.

Jobs instrumented: actionlint, zizmor, scorecard, dependency-review,
terramate-opentofu-setup, storage-optimizer.

docs/approved-actions.md:
- Add step-security/harden-runner to approved actions table.
- Add step-security/* to org allowlist patterns.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: ms280690 <mehul@sparkgeo.com>
Signed-off-by: ms280690 <mehul@sparkgeo.com>
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 introduces StepSecurity runner hardening across the repository’s CI workflows in audit mode to capture outbound egress telemetry (as groundwork for a later enforce-mode allowlist), and updates the repo’s documentation/allowlist guidance accordingly.

Changes:

  • Adds step-security/harden-runner@9af89fc7… as the first step in all CI jobs with egress-policy: audit.
  • Updates the approved-actions registry to include step-security/harden-runner, expands org allowlist patterns to include step-security/*, and documents telemetry/data-handling implications.
  • Extends the README with example “consuming repo CI” setups for public vs private repos.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 10 comments.

File Description
.github/workflows/ci.yml Adds harden-runner audit step to each CI job.
docs/approved-actions.md Approves harden-runner, updates allowlist patterns, and documents telemetry/data handling.
README.md Documents recommended CI setup patterns for consuming repos (public vs private).

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

Comment thread README.md Outdated
Comment on lines +154 to +157
- uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with: { egress-policy: audit }
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: { persist-credentials: false }
Comment thread README.md Outdated
Comment on lines +164 to +167
- uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with: { egress-policy: audit }
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: { persist-credentials: false }
Comment thread README.md Outdated
Comment on lines +175 to +178
- uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with: { egress-policy: audit }
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: { persist-credentials: false }
Comment thread README.md Outdated
Comment on lines +186 to +189
- uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with: { egress-policy: audit }
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: { persist-credentials: false }
Comment thread README.md Outdated
Comment on lines +211 to +212
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: { persist-credentials: false }
Comment thread README.md Outdated
Comment on lines +220 to +221
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: { persist-credentials: false }
Comment thread README.md Outdated
Comment on lines +231 to +232
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: { persist-credentials: false }
Comment thread README.md Outdated
Comment on lines +211 to +212
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: { persist-credentials: false }
Comment thread README.md Outdated
Comment on lines +220 to +221
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: { persist-credentials: false }
Comment thread README.md Outdated
Comment on lines +231 to +232
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with: { persist-credentials: false }
Signed-off-by: ms280690 <mehul@sparkgeo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: runner egress control and isolation

2 participants