-
-
Notifications
You must be signed in to change notification settings - Fork 16
55 lines (54 loc) · 1.46 KB
/
security-ci.yaml
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
name: Go Security CI
on:
push:
branches:
- "master"
pull_request:
branches:
- "*"
workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
default: "warning"
jobs:
govulncheck:
name: govulncheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
check-latest: "true"
go-version: "1.22.x"
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Run vulnerability checks
run: govulncheck ./...
gosec:
name: GoSec Security Scanner
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
check-latest: "true"
go-version: "1.22.x"
- name: install gosec
run: curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
- name: Run Gosec Security Scanner
run: $(go env GOPATH)/bin/gosec -exclude=G115 -severity=high -confidence=medium ./...
trivy:
name: trivy
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
exit-code: '1'
scan-type: 'fs'
scan-ref: './'
severity: 'HIGH,CRITICAL'