Skip to content

Commit b5ad4da

Browse files
authored
Merge pull request #8 from servrox/supply-chain-sentinel/security-baseline
Add supply-chain security baseline
2 parents 58d25a1 + efdc434 commit b5ad4da

2 files changed

Lines changed: 186 additions & 0 deletions

File tree

.github/dependabot.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "monday"
8+
time: "05:10"
9+
timezone: "Etc/UTC"
10+
cooldown:
11+
default-days: 7
12+
labels:
13+
- dependencies
14+
- github-actions
15+
groups:
16+
github-actions:
17+
patterns:
18+
- "*"
19+
github-actions-security:
20+
applies-to: security-updates
21+
patterns:
22+
- "*"
23+
24+
- package-ecosystem: "npm"
25+
directory: "/"
26+
schedule:
27+
interval: "weekly"
28+
day: "tuesday"
29+
time: "05:10"
30+
timezone: "Etc/UTC"
31+
open-pull-requests-limit: 0
32+
labels:
33+
- dependencies
34+
- npm
35+
groups:
36+
npm-security-updates:
37+
applies-to: security-updates
38+
patterns:
39+
- "*"
40+
41+
- package-ecosystem: "pip"
42+
directory: "/"
43+
schedule:
44+
interval: "weekly"
45+
day: "wednesday"
46+
time: "05:10"
47+
timezone: "Etc/UTC"
48+
open-pull-requests-limit: 0
49+
labels:
50+
- dependencies
51+
- python
52+
groups:
53+
pip-security-updates:
54+
applies-to: security-updates
55+
patterns:
56+
- "*"
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: Security Baseline
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
schedule:
9+
- cron: "37 3 * * 1"
10+
workflow_dispatch:
11+
12+
permissions:
13+
actions: read
14+
contents: read
15+
16+
concurrency:
17+
group: security-baseline-${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
osv:
22+
name: OSV vulnerability scan
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
29+
with:
30+
persist-credentials: false
31+
32+
- name: Run OSV-Scanner
33+
uses: google/osv-scanner-action/osv-scanner-action@9a498708959aeaef5ef730655706c5a1df1edbc2 # v2.3.8
34+
with:
35+
scan-args: |-
36+
--recursive
37+
./
38+
39+
secrets:
40+
name: Secret scan
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
45+
with:
46+
fetch-depth: 0
47+
persist-credentials: false
48+
49+
- name: Run TruffleHog
50+
uses: trufflesecurity/trufflehog@37b77001d0174ebec2fcca2bd83ff83a6d45a3ab # v3.95.3
51+
with:
52+
extra_args: --results=verified,unknown
53+
path: ./
54+
version: 3.95.3
55+
56+
workflow-lint:
57+
name: GitHub Actions lint
58+
runs-on: ubuntu-latest
59+
steps:
60+
- name: Checkout repository
61+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
62+
with:
63+
persist-credentials: false
64+
65+
- name: Set up Go
66+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
67+
with:
68+
cache: false
69+
go-version: stable
70+
71+
- name: Run actionlint
72+
run: |
73+
if [ -d .github/workflows ]; then
74+
go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 \
75+
-ignore 'unknown permission scope "vulnerability-alerts"'
76+
fi
77+
78+
workflow-security:
79+
name: GitHub Actions security lint
80+
runs-on: ubuntu-latest
81+
permissions:
82+
actions: read
83+
contents: read
84+
steps:
85+
- name: Checkout repository
86+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
87+
with:
88+
persist-credentials: false
89+
90+
- name: Set up uv
91+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
92+
with:
93+
enable-cache: false
94+
95+
- name: Run zizmor
96+
run: |
97+
for attempt in 1 2 3; do
98+
set +e
99+
uvx --from zizmor==1.24.1 zizmor \
100+
--persona=auditor \
101+
--format=github \
102+
--min-severity=high \
103+
--min-confidence=medium \
104+
--color=always \
105+
-- ./
106+
status="$?"
107+
set -e
108+
109+
if [ "$status" -eq 0 ]; then
110+
exit 0
111+
fi
112+
113+
if [ "$status" -eq 3 ]; then
114+
echo "::warning::No inputs were collected by zizmor"
115+
exit 0
116+
fi
117+
118+
if [ "$status" -ge 11 ]; then
119+
exit "$status"
120+
fi
121+
122+
if [ "$attempt" -lt 3 ]; then
123+
sleep "$((attempt * 15))"
124+
continue
125+
fi
126+
127+
exit "$status"
128+
done
129+
env:
130+
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)