|
1 |
| -name: Sysdig Tech Assessment CI (CLI Scanner) |
| 1 | +name: Sysdig Scan (Official Action) |
2 | 2 |
|
3 | 3 | on:
|
4 | 4 | push:
|
|
12 | 12 |
|
13 | 13 | jobs:
|
14 | 14 | scan:
|
15 |
| - name: Scan vote/worker/result with CLI Scanner + IaC |
| 15 | + name: Docker + IaC Scan via Sysdig Action |
16 | 16 | runs-on: ubuntu-latest
|
17 | 17 |
|
18 | 18 | steps:
|
19 |
| - - name: Checkout repository |
| 19 | + - name: Checkout source |
20 | 20 | uses: actions/checkout@v3
|
21 | 21 |
|
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 |
58 | 23 | 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