Skip to content

Fix stale artifact race and rename bypass in agent-files workflows - #53

Merged
glevi-rh merged 1 commit into
mainfrom
agent-files-defense-v2
Sep 3, 2026
Merged

Fix stale artifact race and rename bypass in agent-files workflows#53
glevi-rh merged 1 commit into
mainfrom
agent-files-defense-v2

Conversation

@glevi-rh

@glevi-rh glevi-rh commented Sep 3, 2026

Copy link
Copy Markdown
Owner

Two security fixes:

  1. Stale artifact race condition

    • Enforce workflow now verifies workflow_run.head_sha matches PR head
    • Skips label mutation if artifact describes different commit
    • Prevents approved stale run from labeling newer protected commit
  2. Workflow rename bypass

    • Detect workflow uses --name-status to catch old paths in renames
    • Enforce workflow checks previous_filename in GitHub API
    • Blocks rename/move of policy workflows themselves

Summary

Resolves: KFLUXINFRA-XXXX

Changes

Testing

  • make fmt passes
  • make lint passes
  • make test passes
  • CI checks pass (go-ci, mpc-test, test-e2e)

Coverage

Notes

Two security fixes:

1. Stale artifact race condition
   - Enforce workflow now verifies workflow_run.head_sha matches PR head
   - Skips label mutation if artifact describes different commit
   - Prevents approved stale run from labeling newer protected commit

2. Workflow rename bypass
   - Detect workflow uses --name-status to catch old paths in renames
   - Enforce workflow checks previous_filename in GitHub API
   - Blocks rename/move of policy workflows themselves

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Gal Levi <glevi@redhat.com>
@glevi-rh
glevi-rh merged commit 07e948e into main Sep 3, 2026
17 of 22 checks passed
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.

1 participant