Skip to content

Commit d09e323

Browse files
authored
Merge pull request #153 from puppetlabs/cdpe-7069/update-trivy-workflow-to-use-cache
(CDPE-7069) Update trivy calls to use cache
2 parents 948cf7c + 3aaf049 commit d09e323

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

.github/workflows/build-test-push.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ jobs:
1919
run: ./build-rootless.sh $(echo $GITHUB_REPOSITORY |cut -d '/' -f1)
2020
- name: Build standard image
2121
run: ./build.sh $(echo $GITHUB_REPOSITORY |cut -d '/' -f1)
22+
- name: Trivy scan
23+
uses: aquasecurity/trivy-action@master
24+
with:
25+
image-ref: puppet-dev-tools:latest
26+
exit-code: 1
27+
ignore-unfixed: true
28+
severity: 'CRITICAL,HIGH,MEDIUM'
29+
vuln-type: os
30+
timeout: 10m0s
31+
skip-files: "/root/.pdk/cache/ruby/*/gems/aws-sdk-core-*/lib/aws-sdk-ssooidc/client.rb"
32+
env:
33+
TRIVY_SKIP_DB_UPDATE: true
34+
TRIVY_SKIP_JAVA_DB_UPDATE: true
2235
- name: Run tests
2336
run: cd tests; ./run_tests.sh
2437
- name: Tag Docker images

.github/workflows/build-test.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,19 @@ jobs:
1818
- name: Show Docker image labels
1919
run: |
2020
docker inspect --format='{{json .Config.Labels}}' ${{ secrets.DOCKERHUB_USERNAME }}/puppet-dev-tools
21+
- name: Trivy scan
22+
uses: aquasecurity/trivy-action@master
23+
with:
24+
image-ref: puppet-dev-tools:latest
25+
exit-code: 1
26+
ignore-unfixed: true
27+
severity: 'CRITICAL,HIGH,MEDIUM'
28+
vuln-type: os
29+
timeout: 10m0s
30+
skip-files: "/root/.pdk/cache/ruby/*/gems/aws-sdk-core-*/lib/aws-sdk-ssooidc/client.rb"
31+
env:
32+
TRIVY_SKIP_DB_UPDATE: true
33+
TRIVY_SKIP_JAVA_DB_UPDATE: true
2134
- name: Run tests
2235
working-directory: ${{ github.workspace }}/tests
2336
run: ./run_tests.sh

.github/workflows/publish-4x-image.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ jobs:
2323
IMAGE_TAG: ${{ github.event.inputs.image_tag }}
2424
run: |
2525
docker pull ${IMAGE_BASE}:${IMAGE_TAG}
26+
- name: Trivy scan
27+
uses: aquasecurity/trivy-action@master
28+
with:
29+
image-ref: ${{ env.IMAGE_BASE }}:${{ github.event.inputs.image_tag }}
30+
exit-code: 1
31+
ignore-unfixed: true
32+
severity: 'CRITICAL,HIGH,MEDIUM'
33+
vuln-type: os
34+
timeout: 10m0s
35+
skip-files: "/root/.pdk/cache/ruby/*/gems/aws-sdk-core-*/lib/aws-sdk-ssooidc/client.rb"
36+
env:
37+
TRIVY_SKIP_DB_UPDATE: true
38+
TRIVY_SKIP_JAVA_DB_UPDATE: true
2639
- name: Publish standard image to 4.x
2740
env:
2841
IMAGE_TAG: ${{ github.event.inputs.image_tag }}

0 commit comments

Comments
 (0)