Harden CI/CD workflows against expression injection and over-scoped permissions#406
Merged
Harden CI/CD workflows against expression injection and over-scoped permissions#406
Conversation
…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>
rdimitrov
approved these changes
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
permissions:blocks toci.ymlandrenovate-validation.ymlpermissions: {}tobuild-containers.ymlandperiodic-security-scan.ymlwith per-job permissions declarations${{ }}expressions out ofrun:blocks intoenv:variables to prevent shell injection (matrix.config,github.base_ref,github.event_name, step outputs)CODEOWNERSto protect.claude/directory requiring@stacklok/maintainreviewBased on a CI agent hardening audit informed by Clinejection and hackerbot-claw attack patterns.
Test plan
ci.ymllint and build jobs still passbuild-containers.ymldiscover-configs, verify-provenance, mcp-security-scan, and build-containers jobs still passrenovate-validation.ymlconfig validation and dry run still passperiodic-security-scan.ymlscheduled scan still works (can trigger manually).claude/directory changes🤖 Generated with Claude Code