Skip to content

Commit 29ff245

Browse files
committed
Bonus
1 parent a61b8fc commit 29ff245

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

.github/workflows/sysdig-scan.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Sysdig Tech Assessment CI
1+
name: Sysdig Tech Assessment CI (CLI Scanner)
22

33
on:
44
push:
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
scan:
15-
name: Build & Scan Docker Images + IaC
15+
name: Scan vote/worker/result with CLI Scanner + IaC
1616
runs-on: ubuntu-latest
1717

1818
steps:
@@ -22,24 +22,40 @@ jobs:
2222
- name: Set up Docker Buildx
2323
uses: docker/setup-buildx-action@v2
2424

25-
- name: Build Docker images
25+
- name: Build and save Docker images
2626
run: |
2727
docker build -t vote-image ./vote
2828
docker build -t worker-image ./worker
2929
docker build -t result-image ./result
30+
docker save vote-image -o vote-image.tar
31+
docker save worker-image -o worker-image.tar
32+
docker save result-image -o result-image.tar
3033
31-
- name: Scan vote image
34+
- name: Download Sysdig CLI Scanner (latest Linux amd64)
3235
run: |
33-
docker run --rm quay.io/sysdig/secure-inline-scan:2 vote-image --sysdig-token ${{ secrets.SYSDIG_SECURE_TOKEN }} --sysdig-url ${{ secrets.SYSDIG_API_URL }}
36+
curl -LO "https://download.sysdig.com/scanning/bin/sysdig-cli-scanner/$(curl -s https://download.sysdig.com/scanning/sysdig-cli-scanner/latest_version.txt)/linux/amd64/sysdig-cli-scanner"
37+
chmod +x sysdig-cli-scanner
3438
35-
- name: Scan worker image
39+
- name: Scan vote image (.tar) with CLI Scanner
3640
run: |
37-
docker run --rm quay.io/sysdig/secure-inline-scan:2 worker-image --sysdig-token ${{ secrets.SYSDIG_SECURE_TOKEN }} --sysdig-url ${{ secrets.SYSDIG_API_URL }}
41+
./sysdig-cli-scanner --standalone --input-file vote-image.tar vote-image:ci
42+
env:
43+
SECURE_API_TOKEN: ${{ secrets.SYSDIG_SECURE_TOKEN }}
3844

39-
- name: Scan result image
45+
- name: Scan worker image (.tar) with CLI Scanner
4046
run: |
41-
docker run --rm quay.io/sysdig/secure-inline-scan:2 result-image --sysdig-token ${{ secrets.SYSDIG_SECURE_TOKEN }} --sysdig-url ${{ secrets.SYSDIG_API_URL }}
47+
./sysdig-cli-scanner --standalone --input-file worker-image.tar worker-image:ci
48+
env:
49+
SECURE_API_TOKEN: ${{ secrets.SYSDIG_SECURE_TOKEN }}
50+
51+
- name: Scan result image (.tar) with CLI Scanner
52+
run: |
53+
./sysdig-cli-scanner --standalone --input-file result-image.tar result-image:ci
54+
env:
55+
SECURE_API_TOKEN: ${{ secrets.SYSDIG_SECURE_TOKEN }}
4256

4357
- name: Scan IaC (k8s-specifications)
4458
run: |
45-
docker run --rm -e SECURE_API_TOKEN=${{ secrets.SYSDIG_SECURE_TOKEN }} -v ${{ github.workspace }}:/iac quay.io/sysdig/sysdig-cli-scanner:latest --apiurl ${{ secrets.SYSDIG_API_URL }} --iac scan /iac/k8s-specifications
59+
./sysdig-cli-scanner --apiurl ${{ secrets.SYSDIG_API_URL }} --iac scan ./k8s-specifications
60+
env:
61+
SECURE_API_TOKEN: ${{ secrets.SYSDIG_SECURE_TOKEN }}

0 commit comments

Comments
 (0)