Skip to content

Commit 3f9b636

Browse files
step-security-botrajkumar-rangarajcijothomas
authored
[StepSecurity] ci: Harden GitHub Actions (#6286)
Signed-off-by: StepSecurity Bot <[email protected]> Co-authored-by: Rajkumar Rangaraj <[email protected]> Co-authored-by: Cijo Thomas <[email protected]>
1 parent 6209ed8 commit 3f9b636

File tree

9 files changed

+34
-0
lines changed

9 files changed

+34
-0
lines changed

.github/workflows/automation.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
OPENTELEMETRYBOT_GITHUB_TOKEN:
1616
required: false
1717

18+
permissions:
19+
contents: read
20+
1821
jobs:
1922
resolve-automation:
2023

.github/workflows/codeql-analysis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@ on:
1010
- cron: '0 0 * * *' # once in a day at 00:00
1111
workflow_dispatch:
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
analyze:
18+
permissions:
19+
actions: read # for github/codeql-action/init to get workflow details
20+
contents: read # for actions/checkout to fetch code
21+
security-events: write # for github/codeql-action/analyze to upload SARIF results
1522
name: Analyze
1623
runs-on: windows-latest
1724

.github/workflows/concurrency-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ name: Concurrency Tests
55
on:
66
workflow_call:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
run-concurrency-tests:
1013

.github/workflows/docfx.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ name: Build docfx
55
on:
66
workflow_call:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
run-docfx-build:
1013
runs-on: windows-latest

.github/workflows/dotnet-format.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ name: Lint - dotnet format
55
on:
66
workflow_call:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
run-dotnet-format-stable:
1013
runs-on: windows-latest

.github/workflows/package-validation.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ name: Package Validation
55
on:
66
workflow_call:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
run-package-validation-stable:
1013
runs-on: windows-latest

.github/workflows/sanitycheck.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ name: Lint - Spelling & Encoding
55
on:
66
workflow_call:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
run-misspell:
1013
runs-on: ubuntu-22.04

.github/workflows/stale.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ on:
66
schedule:
77
- cron: "12 3 * * *" # arbitrary time not to DDOS GitHub
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
stale:
14+
permissions:
15+
issues: write # for actions/stale to close stale issues
16+
pull-requests: write # for actions/stale to close stale PRs
1117
runs-on: ubuntu-22.04
1218
steps:
1319
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0

.github/workflows/verifyaotcompat.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ name: Publish & Verify AOT Compatibility
55
on:
66
workflow_call:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
run-verify-aot-compat:
1013

0 commit comments

Comments
 (0)