From c8b7cf8fab002b5aafe2220397f6628b7e1f7483 Mon Sep 17 00:00:00 2001 From: eskwor <46821259+eskwor@users.noreply.github.com> Date: Thu, 30 Jan 2025 14:18:38 +0100 Subject: [PATCH 01/11] Update ci-spring-boot-build-publish-image.yml (#239) * Update ci-spring-boot-build-publish-image.yml * Update ci-spring-boot-build-publish-image.yml * Update ci-spring-boot-build-publish-image.yml --- .../ci-spring-boot-build-publish-image.yml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/ci-spring-boot-build-publish-image.yml b/.github/workflows/ci-spring-boot-build-publish-image.yml index c6096337..86a5f2f3 100644 --- a/.github/workflows/ci-spring-boot-build-publish-image.yml +++ b/.github/workflows/ci-spring-boot-build-publish-image.yml @@ -209,6 +209,20 @@ jobs: severity: "CRITICAL,HIGH" trivyignores: ${{ steps.set-trivyignore-path.outputs.trivyignore-path }} + - name: Run Trivy vulnerability scanner for Copa + uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # pin@v0.28.0 + id: trivy-copa + env: + TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db:2,public.ecr.aws/aquasecurity/trivy-db:2 + TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db:1,public.ecr.aws/aquasecurity/trivy-java-db:1 + with: + scan-type: "image" + format: "json" + output: "report.json" + ignore-unfixed: true + vuln-type: "os" + image-ref: ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} + - name: Create SBOM artifact name id: sbom-name run: | @@ -250,6 +264,19 @@ jobs: - name: Push image run: docker push ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} + - name: Run Copa Action + id: copa + uses: project-copacetic/copa-action@main + with: + image: creiddev.azurecr.io/${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} + image-report: "report.json" + patched-tag: "patched" + + - name: Push patched image + run: | + docker tag ${{ steps.copa.outputs.patched-image }} creiddev.azurecr.io/${{ steps.copa.outputs.patched-image }} + docker push creiddev.azurecr.io/${{ steps.copa.outputs.patched-image }} + - name: Set image digest id: set-image-digest run: | From 585eaa9693986d78323a61b10b41701422b438ce Mon Sep 17 00:00:00 2001 From: eskwor <46821259+eskwor@users.noreply.github.com> Date: Thu, 30 Jan 2025 14:34:38 +0100 Subject: [PATCH 02/11] Update ci-spring-boot-build-publish-image.yml --- .../ci-spring-boot-build-publish-image.yml | 33 ++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-spring-boot-build-publish-image.yml b/.github/workflows/ci-spring-boot-build-publish-image.yml index 86a5f2f3..8d9b393f 100644 --- a/.github/workflows/ci-spring-boot-build-publish-image.yml +++ b/.github/workflows/ci-spring-boot-build-publish-image.yml @@ -264,14 +264,39 @@ jobs: - name: Push image run: docker push ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} - - name: Run Copa Action + - name: Set up Docker + uses: docker/setup-docker-action@v4 + with: + daemon-config: | + { + "debug": true, + "experimental": true, + "features": { + "containerd-snapshotter": true + } + } + + - name: Install jq + run: sudo apt-get install -y jq + + - name: Get socket path + id: get-socket-path + run: | + url=$(docker context inspect | jq -r '.[0].Endpoints.docker.Host') + socket_path=$(echo "$url" | awk -F// '{print $2}') + echo "$socket_path" + echo "SOCKET=$socket_path" >> "$GITHUB_ENV" + echo "Docker Socket Path: $socket_path" + + - name: Run Copa action id: copa - uses: project-copacetic/copa-action@main + uses: project-copacetic/copa-action@v1.2.1 with: - image: creiddev.azurecr.io/${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} + image: ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} image-report: "report.json" patched-tag: "patched" - + custom-socket: $SOCKET + - name: Push patched image run: | docker tag ${{ steps.copa.outputs.patched-image }} creiddev.azurecr.io/${{ steps.copa.outputs.patched-image }} From dc7eb5030fd68fd74bd6e3c03c30a8bcaf8b78e9 Mon Sep 17 00:00:00 2001 From: eskwor <46821259+eskwor@users.noreply.github.com> Date: Thu, 30 Jan 2025 15:54:53 +0100 Subject: [PATCH 03/11] Update ci-spring-boot-build-publish-image.yml --- .../workflows/ci-spring-boot-build-publish-image.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-spring-boot-build-publish-image.yml b/.github/workflows/ci-spring-boot-build-publish-image.yml index 8d9b393f..e1c1ab37 100644 --- a/.github/workflows/ci-spring-boot-build-publish-image.yml +++ b/.github/workflows/ci-spring-boot-build-publish-image.yml @@ -288,6 +288,12 @@ jobs: echo "SOCKET=$socket_path" >> "$GITHUB_ENV" echo "Docker Socket Path: $socket_path" + - name: Pull Docker image + run: docker pull ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} + + - name: List Docker images + run: docker images + - name: Run Copa action id: copa uses: project-copacetic/copa-action@v1.2.1 @@ -299,8 +305,8 @@ jobs: - name: Push patched image run: | - docker tag ${{ steps.copa.outputs.patched-image }} creiddev.azurecr.io/${{ steps.copa.outputs.patched-image }} - docker push creiddev.azurecr.io/${{ steps.copa.outputs.patched-image }} + #docker tag ${{ steps.copa.outputs.patched-image }} creiddev.azurecr.io/${{ steps.copa.outputs.patched-image }} + docker push ${{ steps.copa.outputs.patched-image }} - name: Set image digest id: set-image-digest From 66a62987351e63af46e4cc41d8ebe1942a1e3319 Mon Sep 17 00:00:00 2001 From: eskwor <46821259+eskwor@users.noreply.github.com> Date: Thu, 30 Jan 2025 16:16:40 +0100 Subject: [PATCH 04/11] Update ci-spring-boot-build-publish-image.yml --- .../workflows/ci-spring-boot-build-publish-image.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ci-spring-boot-build-publish-image.yml b/.github/workflows/ci-spring-boot-build-publish-image.yml index e1c1ab37..f44c7cf9 100644 --- a/.github/workflows/ci-spring-boot-build-publish-image.yml +++ b/.github/workflows/ci-spring-boot-build-publish-image.yml @@ -293,8 +293,19 @@ jobs: - name: List Docker images run: docker images + + - name: Display report.json content + run: cat report.json + - name: Check vulnerability count + id: vuln_count + run: | + report_file="report.json" + vuln_count=$(jq 'if .Results then [.Results[] | select(.Class=="os-pkgs" and .Vulnerabilities!=null) | .Vulnerabilities[]] | length else 0 end' "$report_file") + echo "vuln_count=$vuln_count" >> $GITHUB_OUTPUT + - name: Run Copa action + if: steps.vuln_count.outputs.vuln_count != '0' id: copa uses: project-copacetic/copa-action@v1.2.1 with: From 4e354c55e4447b1bccaca83b66f3bc04ffe3b688 Mon Sep 17 00:00:00 2001 From: eskwor <46821259+eskwor@users.noreply.github.com> Date: Thu, 30 Jan 2025 16:19:54 +0100 Subject: [PATCH 05/11] Update ci-spring-boot-build-publish-image.yml (#240) --- .github/workflows/ci-spring-boot-build-publish-image.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-spring-boot-build-publish-image.yml b/.github/workflows/ci-spring-boot-build-publish-image.yml index f44c7cf9..a1444343 100644 --- a/.github/workflows/ci-spring-boot-build-publish-image.yml +++ b/.github/workflows/ci-spring-boot-build-publish-image.yml @@ -296,13 +296,13 @@ jobs: - name: Display report.json content run: cat report.json - + - name: Check vulnerability count id: vuln_count run: | report_file="report.json" vuln_count=$(jq 'if .Results then [.Results[] | select(.Class=="os-pkgs" and .Vulnerabilities!=null) | .Vulnerabilities[]] | length else 0 end' "$report_file") - echo "vuln_count=$vuln_count" >> $GITHUB_OUTPUT + echo "vuln_count=$vuln_count" >> "$GITHUB_OUTPUT" - name: Run Copa action if: steps.vuln_count.outputs.vuln_count != '0' From f73933628368868d90e20cfe0f3cdfa7b32a2b85 Mon Sep 17 00:00:00 2001 From: eskwor <46821259+eskwor@users.noreply.github.com> Date: Thu, 30 Jan 2025 17:36:56 +0100 Subject: [PATCH 06/11] Update ci-spring-boot-build-publish-image.yml --- .github/workflows/ci-spring-boot-build-publish-image.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-spring-boot-build-publish-image.yml b/.github/workflows/ci-spring-boot-build-publish-image.yml index a1444343..13e73c00 100644 --- a/.github/workflows/ci-spring-boot-build-publish-image.yml +++ b/.github/workflows/ci-spring-boot-build-publish-image.yml @@ -315,8 +315,9 @@ jobs: custom-socket: $SOCKET - name: Push patched image + if: steps.vuln_count.outputs.vuln_count != '0' run: | - #docker tag ${{ steps.copa.outputs.patched-image }} creiddev.azurecr.io/${{ steps.copa.outputs.patched-image }} + docker tag ${{ steps.copa.outputs.patched-image }} ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} docker push ${{ steps.copa.outputs.patched-image }} - name: Set image digest From ed852ff8406e3fea1ff826e2a140ad71cbb42e08 Mon Sep 17 00:00:00 2001 From: eskwor <46821259+eskwor@users.noreply.github.com> Date: Thu, 30 Jan 2025 18:26:46 +0100 Subject: [PATCH 07/11] Adding Copacetic (Copa) action to patch vulnerable container images. --- .github/workflows/ci-spring-boot-build-publish-image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-spring-boot-build-publish-image.yml b/.github/workflows/ci-spring-boot-build-publish-image.yml index 13e73c00..daac5a85 100644 --- a/.github/workflows/ci-spring-boot-build-publish-image.yml +++ b/.github/workflows/ci-spring-boot-build-publish-image.yml @@ -317,7 +317,7 @@ jobs: - name: Push patched image if: steps.vuln_count.outputs.vuln_count != '0' run: | - docker tag ${{ steps.copa.outputs.patched-image }} ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} + #docker tag ${{ steps.copa.outputs.patched-image }} ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} docker push ${{ steps.copa.outputs.patched-image }} - name: Set image digest From e0e12dd5b16086d2244b40879fbba1cdc3bf3157 Mon Sep 17 00:00:00 2001 From: eskwor <46821259+eskwor@users.noreply.github.com> Date: Fri, 31 Jan 2025 12:13:05 +0100 Subject: [PATCH 08/11] Update ci-spring-boot-build-publish-image.yml (#242) --- .../ci-spring-boot-build-publish-image.yml | 138 +++++++++--------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/.github/workflows/ci-spring-boot-build-publish-image.yml b/.github/workflows/ci-spring-boot-build-publish-image.yml index daac5a85..9ef2d3f0 100644 --- a/.github/workflows/ci-spring-boot-build-publish-image.yml +++ b/.github/workflows/ci-spring-boot-build-publish-image.yml @@ -179,6 +179,36 @@ jobs: scope: '@felleslosninger' env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + ## Copa config starts here# + - name: Set up Docker + uses: docker/setup-docker-action@v4 + with: + daemon-config: | + { + "debug": true, + "experimental": true, + "features": { + "containerd-snapshotter": true + } + } + - name: Install jq + run: sudo apt-get install -y jq + - name: Get socket path + id: get-socket-path + run: | + url=$(docker context inspect | jq -r '.[0].Endpoints.docker.Host') + socket_path=$(echo "$url" | awk -F// '{print $2}') + echo "$socket_path" + echo "SOCKET=$socket_path" >> "$GITHUB_ENV" + echo "Docker Socket Path: $socket_path" + + # name: Pull Docker image + # run: docker pull ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} + + #- name: List Docker images + # run: docker images + - name: Build image with Maven/Spring Boot run: | @@ -188,6 +218,40 @@ jobs: -Dspring-boot.build-image.builder=paketobuildpacks/${{ inputs.image-pack }} \ -Dspring-boot.build-image.createdDate=now + - name: Run Trivy vulnerability scanner for Copa + uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # pin@v0.28.0 + id: trivy-copa + env: + TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db:2,public.ecr.aws/aquasecurity/trivy-db:2 + TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db:1,public.ecr.aws/aquasecurity/trivy-java-db:1 + with: + scan-type: "image" + format: "json" + output: "report.json" + ignore-unfixed: true + vuln-type: "os" + image-ref: ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} + + - name: Display report.json content + run: cat report.json + + - name: Check vulnerability count + id: vuln_count + run: | + report_file="report.json" + vuln_count=$(jq 'if .Results then [.Results[] | select(.Class=="os-pkgs" and .Vulnerabilities!=null) | .Vulnerabilities[]] | length else 0 end' "$report_file") + echo "vuln_count=$vuln_count" >> "$GITHUB_OUTPUT" + + - name: Run Copa action + if: steps.vuln_count.outputs.vuln_count != '0' + id: copa + uses: project-copacetic/copa-action@v1.2.1 + with: + image: ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} + image-report: "report.json" + patched-tag: "patched" + custom-socket: $SOCKET + - name: Set trivyignore env if file exists id: set-trivyignore-path run: | @@ -209,20 +273,6 @@ jobs: severity: "CRITICAL,HIGH" trivyignores: ${{ steps.set-trivyignore-path.outputs.trivyignore-path }} - - name: Run Trivy vulnerability scanner for Copa - uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # pin@v0.28.0 - id: trivy-copa - env: - TRIVY_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-db:2,public.ecr.aws/aquasecurity/trivy-db:2 - TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db:1,public.ecr.aws/aquasecurity/trivy-java-db:1 - with: - scan-type: "image" - format: "json" - output: "report.json" - ignore-unfixed: true - vuln-type: "os" - image-ref: ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} - - name: Create SBOM artifact name id: sbom-name run: | @@ -264,61 +314,11 @@ jobs: - name: Push image run: docker push ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} - - name: Set up Docker - uses: docker/setup-docker-action@v4 - with: - daemon-config: | - { - "debug": true, - "experimental": true, - "features": { - "containerd-snapshotter": true - } - } - - - name: Install jq - run: sudo apt-get install -y jq - - - name: Get socket path - id: get-socket-path - run: | - url=$(docker context inspect | jq -r '.[0].Endpoints.docker.Host') - socket_path=$(echo "$url" | awk -F// '{print $2}') - echo "$socket_path" - echo "SOCKET=$socket_path" >> "$GITHUB_ENV" - echo "Docker Socket Path: $socket_path" - - - name: Pull Docker image - run: docker pull ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} - - - name: List Docker images - run: docker images - - - name: Display report.json content - run: cat report.json - - - name: Check vulnerability count - id: vuln_count - run: | - report_file="report.json" - vuln_count=$(jq 'if .Results then [.Results[] | select(.Class=="os-pkgs" and .Vulnerabilities!=null) | .Vulnerabilities[]] | length else 0 end' "$report_file") - echo "vuln_count=$vuln_count" >> "$GITHUB_OUTPUT" - - - name: Run Copa action - if: steps.vuln_count.outputs.vuln_count != '0' - id: copa - uses: project-copacetic/copa-action@v1.2.1 - with: - image: ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} - image-report: "report.json" - patched-tag: "patched" - custom-socket: $SOCKET - - - name: Push patched image - if: steps.vuln_count.outputs.vuln_count != '0' - run: | - #docker tag ${{ steps.copa.outputs.patched-image }} ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} - docker push ${{ steps.copa.outputs.patched-image }} + #- name: Push patched image + # if: steps.vuln_count.outputs.vuln_count != '0' + # run: | + # #docker tag ${{ steps.copa.outputs.patched-image }} ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} + # docker push ${{ steps.copa.outputs.patched-image }} - name: Set image digest id: set-image-digest From e2c7b8466ffcf2c55fbaf51e17af099ec07770a2 Mon Sep 17 00:00:00 2001 From: eskwor <46821259+eskwor@users.noreply.github.com> Date: Fri, 31 Jan 2025 12:20:23 +0100 Subject: [PATCH 09/11] Update ci-spring-boot-build-publish-image.yml --- .../ci-spring-boot-build-publish-image.yml | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-spring-boot-build-publish-image.yml b/.github/workflows/ci-spring-boot-build-publish-image.yml index 9ef2d3f0..678797a3 100644 --- a/.github/workflows/ci-spring-boot-build-publish-image.yml +++ b/.github/workflows/ci-spring-boot-build-publish-image.yml @@ -180,6 +180,14 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Build image with Maven/Spring Boot + run: | + mvn -B spring-boot:build-image \ + --file ${{ inputs.application-path }}pom.xml \ + -Dspring-boot.build-image.imageName=${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} \ + -Dspring-boot.build-image.builder=paketobuildpacks/${{ inputs.image-pack }} \ + -Dspring-boot.build-image.createdDate=now + ## Copa config starts here# - name: Set up Docker uses: docker/setup-docker-action@v4 @@ -203,20 +211,11 @@ jobs: echo "SOCKET=$socket_path" >> "$GITHUB_ENV" echo "Docker Socket Path: $socket_path" - # name: Pull Docker image - # run: docker pull ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} - - #- name: List Docker images - # run: docker images - - - - name: Build image with Maven/Spring Boot - run: | - mvn -B spring-boot:build-image \ - --file ${{ inputs.application-path }}pom.xml \ - -Dspring-boot.build-image.imageName=${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} \ - -Dspring-boot.build-image.builder=paketobuildpacks/${{ inputs.image-pack }} \ - -Dspring-boot.build-image.createdDate=now + # name: Pull Docker image + # run: docker pull ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} + + #- name: List Docker images + # run: docker images - name: Run Trivy vulnerability scanner for Copa uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # pin@v0.28.0 From 0f3a8756d82ff8d7cbd1f84fea4ca1439fce7240 Mon Sep 17 00:00:00 2001 From: eskwor <46821259+eskwor@users.noreply.github.com> Date: Fri, 31 Jan 2025 13:27:07 +0100 Subject: [PATCH 10/11] Update ci-spring-boot-build-publish-image.yml --- .../workflows/ci-spring-boot-build-publish-image.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/ci-spring-boot-build-publish-image.yml b/.github/workflows/ci-spring-boot-build-publish-image.yml index 678797a3..3c49f760 100644 --- a/.github/workflows/ci-spring-boot-build-publish-image.yml +++ b/.github/workflows/ci-spring-boot-build-publish-image.yml @@ -241,15 +241,7 @@ jobs: vuln_count=$(jq 'if .Results then [.Results[] | select(.Class=="os-pkgs" and .Vulnerabilities!=null) | .Vulnerabilities[]] | length else 0 end' "$report_file") echo "vuln_count=$vuln_count" >> "$GITHUB_OUTPUT" - - name: Run Copa action - if: steps.vuln_count.outputs.vuln_count != '0' - id: copa - uses: project-copacetic/copa-action@v1.2.1 - with: - image: ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} - image-report: "report.json" - patched-tag: "patched" - custom-socket: $SOCKET + - name: Set trivyignore env if file exists id: set-trivyignore-path From 7b564f4902afb7c0b09a600e72d2c43138ce077a Mon Sep 17 00:00:00 2001 From: eskwor <46821259+eskwor@users.noreply.github.com> Date: Fri, 31 Jan 2025 13:36:00 +0100 Subject: [PATCH 11/11] Update ci-spring-boot-build-publish-image.yml --- .../ci-spring-boot-build-publish-image.yml | 33 +------------------ 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/.github/workflows/ci-spring-boot-build-publish-image.yml b/.github/workflows/ci-spring-boot-build-publish-image.yml index 3c49f760..e7a4aec2 100644 --- a/.github/workflows/ci-spring-boot-build-publish-image.yml +++ b/.github/workflows/ci-spring-boot-build-publish-image.yml @@ -188,35 +188,6 @@ jobs: -Dspring-boot.build-image.builder=paketobuildpacks/${{ inputs.image-pack }} \ -Dspring-boot.build-image.createdDate=now - ## Copa config starts here# - - name: Set up Docker - uses: docker/setup-docker-action@v4 - with: - daemon-config: | - { - "debug": true, - "experimental": true, - "features": { - "containerd-snapshotter": true - } - } - - name: Install jq - run: sudo apt-get install -y jq - - name: Get socket path - id: get-socket-path - run: | - url=$(docker context inspect | jq -r '.[0].Endpoints.docker.Host') - socket_path=$(echo "$url" | awk -F// '{print $2}') - echo "$socket_path" - echo "SOCKET=$socket_path" >> "$GITHUB_ENV" - echo "Docker Socket Path: $socket_path" - - # name: Pull Docker image - # run: docker pull ${{ steps.set-image-name.outputs.image-name }}:${{ steps.set-image-tag.outputs.image-tag }} - - #- name: List Docker images - # run: docker images - - name: Run Trivy vulnerability scanner for Copa uses: aquasecurity/trivy-action@915b19bbe73b92a6cf82a1bc12b087c9a19a5fe2 # pin@v0.28.0 id: trivy-copa @@ -240,9 +211,7 @@ jobs: report_file="report.json" vuln_count=$(jq 'if .Results then [.Results[] | select(.Class=="os-pkgs" and .Vulnerabilities!=null) | .Vulnerabilities[]] | length else 0 end' "$report_file") echo "vuln_count=$vuln_count" >> "$GITHUB_OUTPUT" - - - + - name: Set trivyignore env if file exists id: set-trivyignore-path run: |