Skip to content

Commit 9339fd2

Browse files
committed
Add anchore docker image scanning to pipeline
1 parent bb47bce commit 9339fd2

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/proxy.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on:
1717
paths-ignore:
1818
- '**/*.md'
1919

20+
permissions:
21+
contents: read
22+
security-events: write
23+
2024
concurrency:
2125
group: ${{ github.workflow }}-${{ github.ref }}
2226
cancel-in-progress: true
@@ -32,11 +36,14 @@ jobs:
3236

3337
steps:
3438
- name: Set tags
39+
id: set-tags
3540
run: |
3641
if [ -z "$TAG" ]; then
3742
echo "TAG=-t openremote/proxy:develop" >> $GITHUB_ENV
43+
echo "dockerImage=openremote/proxy:develop" >> $GITHUB_OUTPUT
3844
else
3945
echo "TAG=-t openremote/proxy:latest -t openremote/proxy:$TAG" >> $GITHUB_ENV
46+
echo "dockerImage=openremote/proxy:$TAG" >> $GITHUB_OUTPUT
4047
fi
4148
env:
4249
TAG: ${{ github.event.release.tag_name }}
@@ -67,3 +74,21 @@ jobs:
6774
- name: build and push images
6875
run: |
6976
docker build --build-arg GIT_COMMIT=${{ github.sha }} --push --platform $PLATFORM $TAG .
77+
78+
- name: Scan manager docker image
79+
uses: anchore/scan-action@3c9a191a0fbab285ca6b8530b5de5a642cba332f # v7.2.2
80+
id: anchore-scan
81+
with:
82+
image: ${{ steps.set-tags.outputs.dockerImage }}
83+
fail-build: false
84+
severity-cutoff: critical
85+
86+
- name: Upload Anchore scan SARIF report
87+
if: ${{ !cancelled() }}
88+
uses: github/codeql-action/upload-sarif@c8e3174949dcd2ceb71718aeaa53fee4dc9052f2 # v4.31.7
89+
with:
90+
sarif_file: ${{ steps.anchore-scan.outputs.sarif }}
91+
92+
- name: Inspect Anchore scan SARIF report
93+
if: ${{ !cancelled() }}
94+
run: cat ${{ steps.anchore-scan.outputs.sarif }}

0 commit comments

Comments
 (0)