Skip to content

Commit 9753ac4

Browse files
committed
add workflow - docker container security check
1 parent b93aea4 commit 9753ac4

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/anchore.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# This workflow checks out code, builds an image, performs a container image
7+
# vulnerability scan with Anchore's Grype tool, and integrates the results with GitHub Advanced Security
8+
# code scanning feature. For more information on the Anchore scan action usage
9+
# and parameters, see https://github.com/anchore/scan-action. For more
10+
# information on Anchore's container image scanning tool Grype, see
11+
# https://github.com/anchore/grype
12+
name: Anchore Container Scan
13+
14+
on:
15+
push:
16+
branches: [ "master" ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ "master" ]
20+
schedule:
21+
- cron: '38 21 * * 6'
22+
23+
permissions:
24+
contents: read
25+
26+
jobs:
27+
Anchore-Build-Scan:
28+
permissions:
29+
contents: read # for actions/checkout to fetch code
30+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
31+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout the code
35+
uses: actions/checkout@v3
36+
- name: Build the Docker image
37+
run: docker build . --file scripts/Docker/Dockerfile --tag localbuild/testimage:latest
38+
- name: Run the Anchore scan action itself with GitHub Advanced Security code scanning integration enabled
39+
uses: anchore/scan-action@b08527d5ae7f7dc76f9621edb6e49eaf47933ccd
40+
with:
41+
image: "localbuild/testimage:latest"
42+
acs-report-enable: true
43+
fail-build: false
44+
- name: Upload Anchore Scan Report
45+
uses: github/codeql-action/upload-sarif@v2
46+
with:
47+
sarif_file: results.sarif

0 commit comments

Comments
 (0)