-
Notifications
You must be signed in to change notification settings - Fork 30
Added new Confused Deputy Auto-Merge rule #304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new Confused Deputy Auto-Merge rule #304
Conversation
…utility functions
There was a problem hiding this 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 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 |
| "dependabot": `dependabot\[bot\]`, | ||
| "dependabot-preview": `dependabot-preview\[bot\]`, | ||
| "renovate": `renovate\[bot\]`, | ||
| "github-actions": `github-actions\[bot\]` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth including copilot-swe-agent[bot] <[email protected]> or does that only respond to authorized users?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the head up !
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.