Skip to content

Commit f44962a

Browse files
authored
respond to pull_request_target concerns (#247)
1 parent 4b74747 commit f44962a

File tree

4 files changed

+41
-5
lines changed

4 files changed

+41
-5
lines changed

.github/workflows/assigned.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@ name: Issue Assigned
33
on:
44
issues:
55
types: [assigned]
6+
permissions: {} # let's not use any permissions we don't need here
67
jobs:
78
send-mattermost-message:
89
runs-on: ubuntu-latest
910
steps:
10-
- uses: mattermost/action-mattermost-notify@master
11+
# issue triggers in github actions can be dangerous like
12+
# pull_request_target because they run with additional privileges in an
13+
# environment containing values that can be controlled by an attacker.
14+
# because of this, please take extra caution when modifying the steps taken
15+
# by this workflow. for additional information, see
16+
# https://github.com/certbot/certbot/pull/10490
17+
#
18+
# we pin this action to a version tested and audited by certbot's
19+
# maintainers for extra security. the full hash is used as doing so is
20+
# recommended by zizmor
21+
- uses: mattermost/action-mattermost-notify@b7d118e440bf2749cd18a4a8c88e7092e696257a
1122
with:
1223
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_ASSIGN_WEBHOOK }}
1324
TEXT: >

.github/workflows/check.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
schedule:
99
# Run at 4pm UTC or 9am PST
1010
- cron: "0 16 * * *"
11-
11+
permissions: {} # let's not use any permissions we don't need here
1212
jobs:
1313
build:
1414
runs-on: ubuntu-latest
@@ -64,6 +64,9 @@ jobs:
6464
run: |
6565
WORKFLOW_RUN_URL="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
6666
echo "{\"text\":\"** :warning: $GITHUB_REPOSITORY: Build failed :warning: ** | [(see details)]($WORKFLOW_RUN_URL) \"}" > mattermost.json
67-
- uses: mattermost/action-mattermost-notify@main
67+
# we pin this action to a version tested and audited by certbot's
68+
# maintainers for extra security. the full hash is used as doing so is
69+
# recommended by zizmor
70+
- uses: mattermost/action-mattermost-notify@b7d118e440bf2749cd18a4a8c88e7092e696257a
6871
env:
6972
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}

.github/workflows/merged.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,23 @@ on:
55
types:
66
- closed
77

8+
permissions: {} # let's not use any permissions we don't need here
89
jobs:
910
if_merged:
1011
if: github.event.pull_request.merged == true
1112
runs-on: ubuntu-latest
1213
steps:
13-
- uses: mattermost/action-mattermost-notify@master
14+
# github actions workflows triggered by pull_request_target can be
15+
# dangerous because they run with additional privileges in an environment
16+
# containing values that can be controlled by an attacker. because of
17+
# this, please take extra caution when modifying the steps taken by this
18+
# workflow. for additional information, see
19+
# https://github.com/certbot/certbot/pull/10490
20+
#
21+
# we pin this action to a version tested and audited by certbot's
22+
# maintainers for extra security. the full hash is used as doing so is
23+
# recommended by zizmor
24+
- uses: mattermost/action-mattermost-notify@b7d118e440bf2749cd18a4a8c88e7092e696257a
1425
with:
1526
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_MERGE_WEBHOOK }}
1627
TEXT: >

.github/workflows/review_requested.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,24 @@ name: Review Requested
33
on:
44
pull_request_target:
55
types: [review_requested]
6+
permissions: {} # let's not use any permissions we don't need here
67
jobs:
78
send-mattermost-message:
89
# Don't notify for the interim step of certbot/eff-devs being assigned
910
if: ${{ github.event.requested_reviewer.login != ''}}
1011
runs-on: ubuntu-latest
1112
steps:
12-
- uses: mattermost/action-mattermost-notify@master
13+
# github actions workflows triggered by pull_request_target can be
14+
# dangerous because they run with additional privileges in an environment
15+
# containing values that can be controlled by an attacker. because of
16+
# this, please take extra caution when modifying the steps taken by this
17+
# workflow. for additional information, see
18+
# https://github.com/certbot/certbot/pull/10490
19+
#
20+
# we pin this action to a version tested and audited by certbot's
21+
# maintainers for extra security. the full hash is used as doing so is
22+
# recommended by zizmor
23+
- uses: mattermost/action-mattermost-notify@b7d118e440bf2749cd18a4a8c88e7092e696257a
1324
with:
1425
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_ASSIGN_WEBHOOK }}
1526
TEXT: >

0 commit comments

Comments
 (0)