Skip to content

Commit ce2b425

Browse files
authored
ci: scope down GitHub Token permissions (#1371)
## Scope Down GitHub Token Permissions This PR updates GitHub Actions workflows to use minimal required permissions instead of the default elevated permissions. ### Why This Matters Following the principle of least privilege, workflows should only have the specific permissions they need to function. ### Changes This PR adds explicit `permissions:` blocks to workflows that currently rely on default permissions, scoping them down to only what's required for their operations. Please review the changes to ensure the specified permissions match your workflow requirements.
1 parent 3a8b554 commit ce2b425

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

.github/workflows/audit.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ env:
2222
# serde_cbor is being imported by criterion, a benchmarking crate. More info here https://github.com/awslabs/smithy-rs/issues/1044
2323
cargo_audit_flags: --ignore RUSTSEC-2020-0071 --ignore RUSTSEC-2020-0159 --ignore RUSTSEC-2021-0127
2424

25+
permissions:
26+
contents: read
27+
2528
jobs:
2629
audit-latest:
2730
name: Audit Latest Dependencies

.github/workflows/ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ env:
1313
RUST_VERSIONS: "stable"
1414
RUST_VERSION: "stable"
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
generate-test-sdk-matrix:
1821
runs-on: ubuntu-latest

.github/workflows/closed-issue-message.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Closed Issue Message
22
on:
33
issues:
44
types: [closed]
5+
permissions:
6+
issues: write
7+
58
jobs:
69
auto_comment:
710
runs-on: ubuntu-latest

.github/workflows/release-checks.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66

77
name: Release Configuration Checks
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
check-config:
1114
runs-on: ubuntu-latest

.github/workflows/stale_issue.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ on:
55
schedule:
66
- cron: "*/60 * * * *"
77

8+
permissions:
9+
issues: write
10+
pull-requests: write
11+
812
jobs:
913
cleanup:
1014
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)