Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/factory-code-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ name: Code Review
pull_request:
types:
- opened
- synchronize
- reopened
permissions:
contents: read
pull-requests: write
issues: write
id-token: write

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] [security] Avoid granting OIDC id-token: write to an unpinned third-party action

Adding id-token: write enables GitHub OIDC tokens for this job, which materially increases blast radius if Factory-AI/droid-action@main (unpinned) is ever compromised, since the action already receives sensitive credentials (FACTORY_API_KEY and a write-scoped GITHUB_TOKEN) and could mint an OIDC token to access any external cloud roles trusted for this repo. Remove id-token: write unless the workflow strictly needs OIDC, and pin Factory-AI/droid-action to a specific commit SHA (plus keep permissions as minimal as possible).

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 46eb829: pinned Factory-AI/droid-action to the immutable commit SHA 7c7bfea2aa3bb7ea87579402cc1d89dbcf6b13b3 (current main). id-token: write is required for the action's OIDC token, so pinning the action removes the unpinned-action blast-radius risk without changing functionality.

jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Factory droid-action
uses: Factory-AI/droid-action@main
uses: Factory-AI/droid-action@7c7bfea2aa3bb7ea87579402cc1d89dbcf6b13b3 # main
with:
org_id: ${{ secrets.FACTORY_ORG_ID }}
api_key: ${{ secrets.FACTORY_API_KEY }}
factory_api_key: ${{ secrets.FACTORY_API_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
automatic_review: true
automatic_security_review: true
allowed_bots: dependabot
prompt: Automatic code review with security review enabled on pull requests.
Loading