Added new Confused Deputy Auto-Merge rule#304
Merged
Conversation
…utility functions
There was a problem hiding this comment.
Pull Request Overview
This PR adds detection for the "Confused Deputy" auto-merge vulnerability in GitHub Actions workflows by introducing documentation, utility helpers, and a new OPA rule.
- Added detailed docs explaining the vulnerability and remediation strategies
- Introduced
job_steps_after,job_steps_before, andfind_first_uses_in_jobhelpers inutils.rego - Implemented the
confused_deputy_auto_mergerule inrules.confused_deputy_auto_merge.rego
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| docs/content/en/rules/confused_deputy_auto_merge.md | New documentation for the Confused Deputy Auto-Merge rule |
| opa/rego/poutine/utils.rego | Added job order utilities and a finder for bot-uses steps |
| opa/rego/rules/confused_deputy_auto_merge.rego | New detection rule for Confused Deputy auto-merge flows |
rgmz
reviewed
May 30, 2025
| "dependabot": `dependabot\[bot\]`, | ||
| "dependabot-preview": `dependabot-preview\[bot\]`, | ||
| "renovate": `renovate\[bot\]`, | ||
| "github-actions": `github-actions\[bot\]` |
Contributor
There was a problem hiding this comment.
Worth including copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> or does that only respond to authorized users?
Contributor
Author
There was a problem hiding this comment.
Thanks for the head up !
SUSTAPLE117
approved these changes
Jun 2, 2025
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.
This pull request introduces documentation and code changes to address the "Confused Deputy" vulnerability in GitHub Actions workflows. It provides remediation guidelines, adds a new rule to detect the vulnerability, and introduces utility functions to assist with job step analysis.
Documentation Updates:
docs/content/en/rules/confused_deputy_auto_merge.md: Added detailed documentation explaining the "Confused Deputy Auto-Merge" vulnerability, remediation strategies, recommended GitHub Actions, anti-pattern examples, and references to related articles.Code Enhancements:
Utility Functions:
opa/rego/poutine/utils.rego: Added utility functionsjob_steps_after,job_steps_before, andfind_first_uses_in_jobto analyze job steps in workflows, enabling detection of specific patterns or dependencies.Vulnerability Detection Rule:
opa/rego/rules/confused_deputy_auto_merge.rego: Introduced a new rule to detect "Confused Deputy" vulnerabilities in GitHub Actions workflows. The rule identifies cases where workflows rely on bot actors (e.g.,dependabot[bot]) for privileged actions without verifying the origin of changes, and provides metadata for findings.