Skip to content

Commit 26d384f

Browse files
committed
Github action to scan docker image with lacework (close #72)
1 parent 4356daa commit 26d384f

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/lacework.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: lacework
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
scan:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: coursier/cache-action@v3
14+
- name: Set up JDK
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: 11
18+
- name: Get current version
19+
id: ver
20+
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
21+
22+
- name: Install lacework scanner
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get -y install curl
26+
curl -L https://github.com/lacework/lacework-vulnerability-scanner/releases/latest/download/lw-scanner-linux-amd64 -o lw-scanner
27+
chmod +x lw-scanner
28+
29+
- name: Build docker images
30+
run: sbt docker:publishLocal
31+
32+
- name: Scan snowplow-postgres-loader
33+
env:
34+
LW_ACCESS_TOKEN: ${{ secrets.LW_ACCESS_TOKEN }}
35+
LW_ACCOUNT_NAME: ${{ secrets.LW_ACCOUNT_NAME }}
36+
LW_SCANNER_SAVE_RESULTS: ${{ !contains(steps.version.outputs.tag, 'rc') }}
37+
run: ./lw-scanner image evaluate snowplow/snowplow-postgres-loader ${{ steps.ver.outputs.tag }} --build-id ${{ github.run_id }} --no-pull

0 commit comments

Comments
 (0)