Skip to content

Commit 3e761d0

Browse files
step-security-botlalitbmarcalff
authored
[StepSecurity] ci: Harden GitHub Actions (#3378)
Signed-off-by: StepSecurity Bot <[email protected]> Co-authored-by: Lalit Kumar Bhasin <[email protected]> Co-authored-by: Marc Alff <[email protected]>
1 parent f6d16d2 commit 3e761d0

7 files changed

+25
-0
lines changed

.github/workflows/ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013

1114
# Commented 2024-11-06, lack of workers in github causes CI failures

.github/workflows/clang-tidy.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [main]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
clang-tidy:
1114
runs-on: ubuntu-24.04

.github/workflows/cmake_install.yml

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
pull_request:
88
branches: [ main ]
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
windows_2022_vcpkg_submodule:
1215
name: Windows 2022 vcpkg submodule versions cxx17 (static libs - dll)

.github/workflows/codeql-analysis.yml

+7
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,15 @@ on:
77
# The branches below must be a subset of the branches above
88
branches: [main]
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
CodeQL-Build:
15+
permissions:
16+
actions: read # for github/codeql-action/init to get workflow details
17+
contents: read # for actions/checkout to fetch code
18+
security-events: write # for github/codeql-action/autobuild to send a status report
1219
runs-on: ubuntu-latest
1320
steps:
1421
- name: Checkout repository

.github/workflows/cppcheck.yml

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
pull_request:
88
branches: [ main ]
99

10+
permissions:
11+
contents: read
12+
1013
jobs:
1114
cppcheck:
1215
runs-on: ubuntu-24.04

.github/workflows/dependencies_image.yml

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ on:
33
schedule:
44
- cron: "0 3 * * 6"
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
docker_image:
811
name: Docker Image

.github/workflows/project_management_comment.yml

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
issues:
55
types:
66
- labeled
7+
permissions:
8+
contents: read
9+
710
jobs:
811
add-comment:
912
if: github.event.label.name == 'help wanted'

0 commit comments

Comments
 (0)