Skip to content

Harden CI/CD workflows against expression injection and over-scoped permissions#406

Merged
JAORMX merged 3 commits intomainfrom
harden-ci-workflows
Mar 6, 2026
Merged

Harden CI/CD workflows against expression injection and over-scoped permissions#406
JAORMX merged 3 commits intomainfrom
harden-ci-workflows

Conversation

@JAORMX
Copy link
Collaborator

@JAORMX JAORMX commented Mar 6, 2026

Summary

  • Add explicit least-privilege permissions: blocks to ci.yml and renovate-validation.yml
  • Add top-level permissions: {} to build-containers.yml and periodic-security-scan.yml with per-job permissions declarations
  • Move all ${{ }} expressions out of run: blocks into env: variables to prevent shell injection (matrix.config, github.base_ref, github.event_name, step outputs)
  • Add CODEOWNERS to protect .claude/ directory requiring @stacklok/maintain review

Based on a CI agent hardening audit informed by Clinejection and hackerbot-claw attack patterns.

Test plan

  • Verify ci.yml lint and build jobs still pass
  • Verify build-containers.yml discover-configs, verify-provenance, mcp-security-scan, and build-containers jobs still pass
  • Verify renovate-validation.yml config validation and dry run still pass
  • Verify periodic-security-scan.yml scheduled scan still works (can trigger manually)
  • Confirm CODEOWNERS applies to .claude/ directory changes

🤖 Generated with Claude Code

JAORMX and others added 3 commits March 6, 2026 14:47
…ermissions

- Add explicit least-privilege permissions: blocks to ci.yml and renovate-validation.yml
- Add top-level permissions: {} to build-containers.yml and periodic-security-scan.yml
  with per-job permissions declarations
- Move all ${{ }} expressions out of run: blocks into env: variables to prevent
  shell injection (matrix.config, github.base_ref, github.event_name, step outputs)
- Add CODEOWNERS to protect .claude/ directory requiring maintainer review

Based on CI agent hardening audit informed by Clinejection and hackerbot-claw
attack patterns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add URL allowlist validation (validatePyPIURL) that checks all outbound
HTTP requests target HTTPS and an allowed PyPI host before execution.
This prevents SSRF if package metadata ever contains a malicious URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add URL allowlist validation (validateNpmURL) that checks all outbound
HTTP requests target HTTPS and registry.npmjs.org before execution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JAORMX JAORMX merged commit a917145 into main Mar 6, 2026
4 checks passed
@JAORMX JAORMX deleted the harden-ci-workflows branch March 6, 2026 13:12
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.

2 participants