Skip to content

Commit 72af093

Browse files
committed
final Sysdig image scan
1 parent 6348a8d commit 72af093

File tree

1 file changed

+29
-18
lines changed

1 file changed

+29
-18
lines changed

.github/workflows/scan.yml

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
name: Sysdig Image Scan
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- main
7-
workflow_dispatch:
88

99
jobs:
1010
image-scan:
1111
runs-on: ubuntu-latest
1212

13-
# 🧪 環境変数の注入(Secretsから取得)
1413
env:
1514
SECURE_API_TOKEN: ${{ secrets.SECURE_API_TOKEN }}
1615
SYS_DIG_SECURE_URL: https://app.au1.sysdig.com
@@ -19,39 +18,51 @@ jobs:
1918
- name: 🛎️ Checkout code
2019
uses: actions/checkout@v3
2120

22-
- name: 🏗️ Build Docker images
21+
- name: 🧱 Build Docker images
2322
run: |
2423
docker build -t voting-app ./vote
2524
docker build -t worker ./worker
2625
docker build -t result ./result
2726
28-
- name: 🔍 Run Sysdig Scan (voting-app)
27+
- name: 🔍 Scan voting-app with Sysdig
2928
run: |
3029
docker run --rm \
30+
--platform linux/amd64 \
31+
--user 0 \
32+
-v "${{ github.workspace }}/scan-logs:/home/nonroot/scan-logs" \
3133
-v /var/run/docker.sock:/var/run/docker.sock \
34+
-e SECURE_API_TOKEN=${{ secrets.SECURE_API_TOKEN }} \
3235
quay.io/sysdig/sysdig-cli-scanner:1.22.4 \
33-
scan \
34-
--apiurl $SYS_DIG_SECURE_URL \
35-
--token $SECURE_API_TOKEN \
36-
docker://voting-app
36+
--apiurl $SYS_DIG_SECURE_URL \
37+
--loglevel debug \
38+
--skiptlsverify \
39+
docker://voting-app
3740
38-
- name: 🔍 Run Sysdig Scan (worker)
41+
- name: 🔍 Scan worker with Sysdig
3942
run: |
4043
docker run --rm \
44+
--platform linux/amd64 \
45+
--user 0 \
46+
-v "${{ github.workspace }}/scan-logs:/home/nonroot/scan-logs" \
4147
-v /var/run/docker.sock:/var/run/docker.sock \
48+
-e SECURE_API_TOKEN=${{ secrets.SECURE_API_TOKEN }} \
4249
quay.io/sysdig/sysdig-cli-scanner:1.22.4 \
43-
scan \
44-
--apiurl $SYS_DIG_SECURE_URL \
45-
--token $SECURE_API_TOKEN \
46-
docker://worker
50+
--apiurl $SYS_DIG_SECURE_URL \
51+
--loglevel debug \
52+
--skiptlsverify \
53+
docker://worker
4754
48-
- name: 🔍 Run Sysdig Scan (result)
55+
- name: 🔍 Scan result with Sysdig
4956
run: |
5057
docker run --rm \
58+
--platform linux/amd64 \
59+
--user 0 \
60+
-v "${{ github.workspace }}/scan-logs:/home/nonroot/scan-logs" \
5161
-v /var/run/docker.sock:/var/run/docker.sock \
62+
-e SECURE_API_TOKEN=${{ secrets.SECURE_API_TOKEN }} \
5263
quay.io/sysdig/sysdig-cli-scanner:1.22.4 \
53-
scan \
54-
--apiurl $SYS_DIG_SECURE_URL \
55-
--token $SECURE_API_TOKEN \
56-
docker://result
64+
--apiurl $SYS_DIG_SECURE_URL \
65+
--loglevel debug \
66+
--skiptlsverify \
67+
docker://result
5768

0 commit comments

Comments
 (0)