Skip to content

Commit fd44838

Browse files
committed
Bonus
1 parent 29ff245 commit fd44838

File tree

1 file changed

+23
-42
lines changed

1 file changed

+23
-42
lines changed

.github/workflows/sysdig-scan.yml

Lines changed: 23 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Sysdig Tech Assessment CI (CLI Scanner)
1+
name: Sysdig Scan (Official Action)
22

33
on:
44
push:
@@ -12,50 +12,31 @@ on:
1212

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

1818
steps:
19-
- name: Checkout repository
19+
- name: Checkout source
2020
uses: actions/checkout@v3
2121

22-
- name: Set up Docker Buildx
23-
uses: docker/setup-buildx-action@v2
24-
25-
- name: Build and save Docker images
26-
run: |
27-
docker build -t vote-image ./vote
28-
docker build -t worker-image ./worker
29-
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
33-
34-
- name: Download Sysdig CLI Scanner (latest Linux amd64)
35-
run: |
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
38-
39-
- name: Scan vote image (.tar) with CLI Scanner
40-
run: |
41-
./sysdig-cli-scanner --standalone --input-file vote-image.tar vote-image:ci
42-
env:
43-
SECURE_API_TOKEN: ${{ secrets.SYSDIG_SECURE_TOKEN }}
44-
45-
- name: Scan worker image (.tar) with CLI Scanner
46-
run: |
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 }}
56-
57-
- name: Scan IaC (k8s-specifications)
22+
- name: Build vote Docker image
5823
run: |
59-
./sysdig-cli-scanner --apiurl ${{ secrets.SYSDIG_API_URL }} --iac scan ./k8s-specifications
60-
env:
61-
SECURE_API_TOKEN: ${{ secrets.SYSDIG_SECURE_TOKEN }}
24+
docker build ./vote -t vote-app:${{ github.sha }}
25+
26+
- name: Scan vote image with Sysdig
27+
uses: sysdiglabs/scan-action@v6
28+
with:
29+
image-tag: vote-app:${{ github.sha }}
30+
sysdig-secure-token: ${{ secrets.SYSDIG_SECURE_TOKEN }}
31+
sysdig-secure-url: ${{ secrets.SYSDIG_API_URL }}
32+
stop-on-processing-error: true
33+
34+
- name: Scan Kubernetes IaC manifests
35+
uses: sysdiglabs/scan-action@v6
36+
with:
37+
mode: iac
38+
cli-scanner-version: 1.24.2
39+
iac-scan-path: k8s-specifications
40+
sysdig-secure-token: ${{ secrets.SYSDIG_SECURE_TOKEN }}
41+
sysdig-secure-url: ${{ secrets.SYSDIG_API_URL }}
42+
stop-on-processing-error: true

0 commit comments

Comments
 (0)