Skip to content

Commit 7995c39

Browse files
Use allowlist for author_association, point --ref to main
- Switch author_association from denylist (!= NONE) to allowlist (COLLABORATOR, MEMBER, OWNER) for defense in depth. - Point workflow dispatch --ref to main (eng-dev-ecosystem PR will be merged first). See: https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/ Co-authored-by: Isaac
1 parent e6ecd80 commit 7995c39

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/claude-code.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,20 @@ jobs:
4545
run: |
4646
gh workflow run cli-claude-code.yml \
4747
-R databricks-eng/eng-dev-ecosystem \
48-
--ref add-claude-code-workflow \
48+
--ref main \
4949
-F pull_request_number=${{ github.event.pull_request.number }} \
5050
-F event_type=review
5151
env:
5252
GH_TOKEN: ${{ steps.token.outputs.token }}
5353

5454
# Interactive @claude mentions (PRs only, trusted authors only).
55+
# Restrict to collaborators/members/owners to prevent untrusted users from
56+
# triggering Claude with write access to the repo. See:
57+
# https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/
5558
assist:
5659
if: |
5760
github.event.comment.user.type != 'Bot' &&
58-
github.event.comment.author_association != 'NONE' &&
61+
contains(fromJson('["COLLABORATOR","MEMBER","OWNER"]'), github.event.comment.author_association) &&
5962
(
6063
(github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@claude')) ||
6164
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude'))

0 commit comments

Comments
 (0)