Skip to content

Conversation

@fproulx-boostsecurity
Copy link
Contributor

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:

Code Enhancements:

Utility Functions:

  • opa/rego/poutine/utils.rego: Added utility functions job_steps_after, job_steps_before, and find_first_uses_in_job to 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.

@fproulx-boostsecurity fproulx-boostsecurity requested a review from a team as a code owner May 30, 2025 18:35
Copy link

Copilot AI left a 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, and find_first_uses_in_job helpers in utils.rego
  • Implemented the confused_deputy_auto_merge rule in rules.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\]`
Copy link
Contributor

@rgmz rgmz May 30, 2025

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?

Copy link
Contributor Author

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 !

@fproulx-boostsecurity fproulx-boostsecurity merged commit 16c6972 into main Jun 2, 2025
10 checks passed
@fproulx-boostsecurity fproulx-boostsecurity deleted the feature/add-new-rule_confused_deputy branch June 2, 2025 13:45
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.

4 participants