From 068c3cd04f03e1236196f646d793171633aea4e2 Mon Sep 17 00:00:00 2001 From: Christian Peper Date: Mon, 6 Jul 2026 16:12:42 +0200 Subject: [PATCH 1/3] feat(ci): add grype vuln scan of devcontainer --- .github/workflows/anchore.yml | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/anchore.yml diff --git a/.github/workflows/anchore.yml b/.github/workflows/anchore.yml new file mode 100644 index 0000000..a785a71 --- /dev/null +++ b/.github/workflows/anchore.yml @@ -0,0 +1,48 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# This workflow checks out code, builds an image, performs a container image +# vulnerability scan with Anchore's Grype tool, and integrates the results with GitHub Advanced Security +# code scanning feature. For more information on the Anchore scan action usage +# and parameters, see https://github.com/anchore/scan-action. For more +# information on Anchore's container image scanning tool Grype, see +# https://github.com/anchore/grype +name: Anchore Grype vulnerability scan + +on: + push: + branches: [ "main" ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ "main" ] + schedule: + - cron: '26 4 * * 1' + +permissions: + contents: read + +jobs: + Anchore-Build-Scan: + permissions: + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + runs-on: ubuntu-latest + steps: + - name: Check out the code + uses: actions/checkout@v4 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag localbuild/testimage:latest + - name: Run the Anchore Grype scan action + uses: anchore/scan-action@d5aa5b6cb9414b0c7771438046ff5bcfa2854ed7 + id: scan + with: + image: "localbuild/testimage:latest" + fail-build: true + severity-cutoff: critical + - name: Upload vulnerability report + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: ${{ steps.scan.outputs.sarif }} From 078fb44071fab9a22604c967bcee0f199298cd70 Mon Sep 17 00:00:00 2001 From: Christian Peper Date: Mon, 6 Jul 2026 16:16:11 +0200 Subject: [PATCH 2/3] fix(ci): use correct path to Dockerfile --- .github/workflows/anchore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/anchore.yml b/.github/workflows/anchore.yml index a785a71..d29d73d 100644 --- a/.github/workflows/anchore.yml +++ b/.github/workflows/anchore.yml @@ -34,7 +34,7 @@ jobs: - name: Check out the code uses: actions/checkout@v4 - name: Build the Docker image - run: docker build . --file Dockerfile --tag localbuild/testimage:latest + run: docker build . --file /dev-opentofu/.devcontainer/Dockerfile --tag localbuild/testimage:latest - name: Run the Anchore Grype scan action uses: anchore/scan-action@d5aa5b6cb9414b0c7771438046ff5bcfa2854ed7 id: scan From ab8b918914c1cc01d81f6b15095511e6a8a8eb75 Mon Sep 17 00:00:00 2001 From: Christian Peper Date: Mon, 6 Jul 2026 16:18:18 +0200 Subject: [PATCH 3/3] fix(ci): use correct path to Dockerfile --- .github/workflows/anchore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/anchore.yml b/.github/workflows/anchore.yml index d29d73d..361b658 100644 --- a/.github/workflows/anchore.yml +++ b/.github/workflows/anchore.yml @@ -34,7 +34,7 @@ jobs: - name: Check out the code uses: actions/checkout@v4 - name: Build the Docker image - run: docker build . --file /dev-opentofu/.devcontainer/Dockerfile --tag localbuild/testimage:latest + run: docker build . --file dev-opentofu/.devcontainer/Dockerfile --tag localbuild/testimage:latest - name: Run the Anchore Grype scan action uses: anchore/scan-action@d5aa5b6cb9414b0c7771438046ff5bcfa2854ed7 id: scan