Skip to content

Commit 2d458da

Browse files
[StepSecurity] ci: Harden GitHub Actions (#401)
* [StepSecurity] ci: Harden GitHub Actions in docker-image.yml * [StepSecurity] ci: Harden GitHub Actions in labeler.yml * [StepSecurity] ci: Harden GitHub Actions in lint.yml * [StepSecurity] ci: Harden GitHub Actions in super-linter.yml * [StepSecurity] ci: Harden GitHub Actions in codeql-analysis.yml
1 parent 9c91971 commit 2d458da

File tree

5 files changed

+25
-0
lines changed

5 files changed

+25
-0
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@ name: CodeQL
1313

1414
on: [pull_request]
1515

16+
permissions: # added using https://github.com/step-security/secure-workflows
17+
contents: read
18+
1619
jobs:
1720
analyze:
21+
permissions:
22+
actions: read # for github/codeql-action/init to get workflow details
23+
contents: read # for actions/checkout to fetch code
24+
security-events: write # for github/codeql-action/autobuild to send a status report
1825
name: Analyze
1926
runs-on: ubuntu-latest
2027

.github/workflows/docker-image.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches: [master]
66

7+
permissions: # added using https://github.com/step-security/secure-workflows
8+
contents: read
9+
710
jobs:
811
build-deploy:
912
name: Build and Publish Docker image

.github/workflows/labeler.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ name: Pull Request Labeler
22
on:
33
- pull_request_target
44

5+
permissions: # added using https://github.com/step-security/secure-workflows
6+
contents: read
7+
58
jobs:
69
triage:
10+
permissions:
11+
contents: read # for actions/labeler to determine modified files
12+
pull-requests: write # for actions/labeler to add labels to PRs
713
name: Triage
814
runs-on: ubuntu-latest
915
steps:

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Lint
22

33
on: [pull_request]
44

5+
permissions: # added using https://github.com/step-security/secure-workflows
6+
contents: read
7+
58
jobs:
69
markdown-link-check:
710
name: Check for broken links in Markdown files

.github/workflows/super-linter.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ name: Lint
22

33
on: [pull_request]
44

5+
permissions: # added using https://github.com/step-security/secure-workflows
6+
contents: read
7+
58
jobs:
69
build:
10+
permissions:
11+
contents: read # for actions/checkout to fetch code
12+
statuses: write # for github/super-linter/slim to mark status of each linter run
713
name: Super-Linter
814
runs-on: ubuntu-latest
915
steps:

0 commit comments

Comments
 (0)