-
Notifications
You must be signed in to change notification settings - Fork 0
New: [AEA-0000] - add syft and grype #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
aad17bc
dd4c7de
2e3d943
3afa9b6
07b4ad2
3410a72
cd72fa6
8c2f0a0
5dbf583
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -63,18 +63,16 @@ jobs: | |||||||||||||||||||||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| fetch-depth: 0 | ||||||||||||||||||||||
| # - name: setup trivy | ||||||||||||||||||||||
| # run: | | ||||||||||||||||||||||
| # mkdir -p "$RUNNER_TEMP/bin" | ||||||||||||||||||||||
| # docker build --output="$RUNNER_TEMP/bin" -f "src/base/.devcontainer/Dockerfile.trivy.${ARCH}" . | ||||||||||||||||||||||
| # echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH" | ||||||||||||||||||||||
| # env: | ||||||||||||||||||||||
| # ARCH: '${{ matrix.arch }}' | ||||||||||||||||||||||
| - name: setup node | ||||||||||||||||||||||
| uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| node-version: '24.14.0' | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - name: setup syft and grype | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| mkdir -p "$RUNNER_TEMP/bin" | ||||||||||||||||||||||
| docker build --output="$RUNNER_TEMP/bin" -f "src/base/.devcontainer/Dockerfile.syft" src/base/.devcontainer/ | ||||||||||||||||||||||
| docker build --output="$RUNNER_TEMP/bin" -f "src/base/.devcontainer/Dockerfile.grype" src/base/.devcontainer/ | ||||||||||||||||||||||
| echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH" | ||||||||||||||||||||||
| - name: make install | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| make install-node | ||||||||||||||||||||||
|
|
@@ -99,32 +97,28 @@ jobs: | |||||||||||||||||||||
| CONTAINER_NAME: '${{ inputs.container_name }}' | ||||||||||||||||||||||
| BASE_FOLDER: "${{ inputs.base_folder }}" | ||||||||||||||||||||||
| IMAGE_TAG: "${{ inputs.docker_tag }}-${{ matrix.arch }}" | ||||||||||||||||||||||
| EXIT_CODE: 0 | ||||||||||||||||||||||
| EXTRA_COMMON: "${{ inputs.extra_common }}" | ||||||||||||||||||||||
| # - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f | ||||||||||||||||||||||
| # name: Upload scan results | ||||||||||||||||||||||
| # with: | ||||||||||||||||||||||
| # name: "scan_results_docker_${{ inputs.container_name }}_${{ matrix.arch }}.json" | ||||||||||||||||||||||
| # path: .out/scan_results_docker.json | ||||||||||||||||||||||
| # - name: Check docker vulnerabilities - table output | ||||||||||||||||||||||
| # run: | | ||||||||||||||||||||||
| # make scan-image | ||||||||||||||||||||||
| # env: | ||||||||||||||||||||||
| # CONTAINER_NAME: '${{ inputs.container_name }}' | ||||||||||||||||||||||
| # BASE_FOLDER: "${{ inputs.base_folder }}" | ||||||||||||||||||||||
| # IMAGE_TAG: "${{ inputs.docker_tag }}-${{ matrix.arch }}" | ||||||||||||||||||||||
| # EXIT_CODE: "1" | ||||||||||||||||||||||
| # EXTRA_COMMON: "${{ inputs.extra_common }}" | ||||||||||||||||||||||
| # - name: Show docker vulnerability output | ||||||||||||||||||||||
| # if: always() | ||||||||||||||||||||||
| # run: | | ||||||||||||||||||||||
| # echo "Scan output for ghcr.io/nhsdigital/eps-devcontainers/base:${DOCKER_TAG}-${ARCHITECTURE}" | ||||||||||||||||||||||
| # if [ -f .out/scan_results_docker.txt ]; then | ||||||||||||||||||||||
| # cat .out/scan_results_docker.txt | ||||||||||||||||||||||
| # fi | ||||||||||||||||||||||
| # env: | ||||||||||||||||||||||
| # ARCHITECTURE: '${{ matrix.arch }}' | ||||||||||||||||||||||
| # DOCKER_TAG: '${{ inputs.docker_tag }}' | ||||||||||||||||||||||
| - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f | ||||||||||||||||||||||
| name: Upload scan results | ||||||||||||||||||||||
| with: | ||||||||||||||||||||||
| name: "grype_${{ inputs.container_name }}_${{ matrix.arch }}.json" | ||||||||||||||||||||||
| path: .grype_out/grype_${{ inputs.container_name }}_${{ matrix.arch }}.json | ||||||||||||||||||||||
| - name: Check docker vulnerabilities - text output | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| make scan-image | ||||||||||||||||||||||
| env: | ||||||||||||||||||||||
| CONTAINER_NAME: '${{ inputs.container_name }}' | ||||||||||||||||||||||
| BASE_FOLDER: "${{ inputs.base_folder }}" | ||||||||||||||||||||||
| IMAGE_TAG: "${{ inputs.docker_tag }}-${{ matrix.arch }}" | ||||||||||||||||||||||
| - name: Show docker vulnerability output | ||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||
| run: | | ||||||||||||||||||||||
| echo "Scan output for ghcr.io/nhsdigital/eps-devcontainers/base:${DOCKER_TAG}-${ARCHITECTURE}" | ||||||||||||||||||||||
| if [ -f .out/scan_results_docker.txt ]; then | ||||||||||||||||||||||
| cat .out/scan_results_docker.txt | ||||||||||||||||||||||
| fi | ||||||||||||||||||||||
| env: | ||||||||||||||||||||||
| ARCHITECTURE: '${{ matrix.arch }}' | ||||||||||||||||||||||
| DOCKER_TAG: '${{ inputs.docker_tag }}' | ||||||||||||||||||||||
|
Comment on lines
+112
to
+121
|
||||||||||||||||||||||
| - name: Show docker vulnerability output | |
| if: always() | |
| run: | | |
| echo "Scan output for ghcr.io/nhsdigital/eps-devcontainers/base:${DOCKER_TAG}-${ARCHITECTURE}" | |
| if [ -f .out/scan_results_docker.txt ]; then | |
| cat .out/scan_results_docker.txt | |
| fi | |
| env: | |
| ARCHITECTURE: '${{ matrix.arch }}' | |
| DOCKER_TAG: '${{ inputs.docker_tag }}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The filename produced by
scan-image-jsonis./.grype_out/grype_${CONTAINER_NAME}_${IMAGE_TAG}.json, but the workflow later uploads.grype_out/grype_${container_name}_${matrix.arch}.json. WithIMAGE_TAGset to${docker_tag}-${arch}, these paths won’t match, so the upload step will fail. Align the Makefile output name with the workflow expectation (or update the workflow to use the Makefile naming).