This repository was archived by the owner on Nov 14, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +60
-2
lines changed Expand file tree Collapse file tree 3 files changed +60
-2
lines changed Original file line number Diff line number Diff line change 9
9
branches :
10
10
- main
11
11
12
+ schedule :
13
+ # Run daily at 10:15 am UTC (3:15am PT/5:15am CT)
14
+ - cron : " 15 10 * * *"
15
+
12
16
workflow_dispatch :
13
17
14
18
permissions :
@@ -25,7 +29,7 @@ permissions:
25
29
26
30
jobs :
27
31
build :
28
- name : Build
32
+ name : build
29
33
runs-on : ubuntu-20.04
30
34
steps :
31
35
- name : Cancel Previous Runs
57
61
distribution : goreleaser
58
62
version : latest
59
63
args : release --rm-dist --snapshot --skip-publish
64
+
65
+ scan-source :
66
+ name : scan/source
67
+ runs-on : ubuntu-20.04
68
+ steps :
69
+ - name : Cancel previous runs
70
+ if : github.event_name == 'pull_request'
71
+ uses : styfle/cancel-workflow-action@0.9.1
72
+
73
+ - name : Checkout
74
+ uses : actions/checkout@v2
75
+
76
+ - name : Install Go
77
+ uses : actions/setup-go@v2
78
+ with :
79
+ go-version : ' ^1.16.7'
80
+
81
+ - name : Install dependencies
82
+ run : ./scripts/install_deps.sh
83
+
84
+ - name : Scan with AquaSec Trivy
85
+ run : ./scripts/scan.sh
86
+ continue-on-error : true
Original file line number Diff line number Diff line change @@ -51,11 +51,17 @@ GORELEASER_VERSION="0.178.0"
51
51
run_trace false curl " ${curl_flags[@]} " " https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION} /goreleaser_Linux_x86_64.tar.gz" \| \
52
52
tar --extract --gzip --directory=" $TMPBIN " --file=- " goreleaser"
53
53
54
+ # trivy to scan container images
55
+ TRIVY_VERSION=" 0.19.2"
56
+ run_trace false curl " ${curl_flags[@]} " " https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION} /trivy_${TRIVY_VERSION} _Linux-64bit.tar.gz" \| \
57
+ tar --extract --gzip --directory=" $TMPBIN " --file=- " trivy"
58
+
54
59
run_trace false sudo install --mode=0755 --target-directory=" $BINDIR " " $TMPBIN /*"
55
60
56
61
run_trace false command -v \
57
62
golangci-lint \
58
63
goreleaser \
59
- gotestsum
64
+ gotestsum \
65
+ trivy
60
66
61
67
run_trace false sudo rm --verbose --recursive --force " $TMPDIR "
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ #
3
+ # Check dependencies and configuration for security issues
4
+
5
+ set -euo pipefail
6
+ PROJECT_ROOT=$( git rev-parse --show-toplevel)
7
+ cd " $PROJECT_ROOT "
8
+ source " ./scripts/lib.sh"
9
+
10
+ run_trace false trivy --version
11
+
12
+ trivy_flags=(
13
+ " --vuln-type=os,library"
14
+ " --severity=MEDIUM,HIGH,CRITICAL"
15
+ " --exit-code=1"
16
+ " --security-checks=vuln,config"
17
+ )
18
+
19
+ if [ -n " ${CI:- } " ]; then
20
+ trivy_flags+=(
21
+ " --no-progress"
22
+ )
23
+ fi
24
+
25
+ run_trace false trivy filesystem " ${trivy_flags[@]} " " $PROJECT_ROOT "
You can’t perform that action at this time.
0 commit comments