-
Notifications
You must be signed in to change notification settings - Fork 2
87 lines (74 loc) · 2.64 KB
/
Copy pathsecurity.yml
File metadata and controls
87 lines (74 loc) · 2.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Security
on:
schedule:
- cron: "23 3 * * 1"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: security-${{ github.ref }}
cancel-in-progress: false
jobs:
codeql:
name: CodeQL (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
include:
- language: go
build-mode: manual
- language: javascript-typescript
build-mode: none
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Go
if: matrix.language == 'go'
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: packages/cli/go.mod
- name: Initialize CodeQL
uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended
- name: Build Go
if: matrix.language == 'go'
working-directory: packages/cli
run: go build ./...
- name: Analyze
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
category: "/language:${{ matrix.language }}"
dependencies:
name: Dependency vulnerabilities
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Setup Go
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: packages/cli/go.mod
- name: Run govulncheck
working-directory: packages/cli
run: go run golang.org/x/vuln/cmd/govulncheck@v1.1.4 ./...
- name: Download verified OSV Scanner
env:
OSV_SCANNER_SHA256: bc98e15319ed0d515e3f9235287ba53cdc5535d576d24fd573978ecfe9ab92dc
run: |
curl --proto '=https' --tlsv1.2 --location --fail --silent --show-error \
--max-time 120 \
--output "${RUNNER_TEMP}/osv-scanner" \
https://github.com/google/osv-scanner/releases/download/v2.3.8/osv-scanner_linux_amd64
echo "${OSV_SCANNER_SHA256} ${RUNNER_TEMP}/osv-scanner" | sha256sum --check --strict
chmod +x "${RUNNER_TEMP}/osv-scanner"
- name: Scan repository dependencies with OSV
run: '"${RUNNER_TEMP}/osv-scanner" scan source --recursive --allow-no-lockfiles .'