Skip to content

Commit

Permalink
make into action
Browse files Browse the repository at this point in the history
  • Loading branch information
abiju-czi committed Jul 2, 2024
1 parent 1ce88b6 commit 6fd73e9
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 38 deletions.
53 changes: 53 additions & 0 deletions .github/actions/container-scanning/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Container Scanning
description: 'A GitHub Action to scan a container image for security vulnerabilities that follows CZI Best Practices'
inputs:
image-tag:
description: 'which image to scan'
required: true
critical_threshold:
description: 'number of critical vulnerabilities that will cause the action to fail'
required: false
default: "1"
high_threshold:
description: 'number of high vulnerabilities that will cause the action to fail'
required: false
default: "1"
medium_threshold:
description: 'number of medium vulnerabilities that will cause the action to fail'
required: false
default: "1"
low_threshold:
description: 'number of low vulnerabilities that will cause the action to fail'
required: false
default: "1"
other_threshold:
description: 'number of other vulnerabilities that will cause the action to fail'
required: false
default: "0"
runs:
using: "composite"
steps:
- uses: aws-actions/configure-aws-credentials@v3
with:
aws-region: us-west-2
role-to-assume: arn:aws:iam::871040364337:role/ci/github-actions-inspector
role-duration-seconds: 1800
role-session-name: github-actions-inspector
- name: Scan built image with Inspector
uses: aws-actions/[email protected]
id: inspector
with:
artifact_type: 'container'
artifact_path: ${{ inputs.image-tag }} # make sure this matches the image you built
critical_threshold: ${{ inputs.critical_threshold }}
high_threshold: ${{ inputs.high_threshold }}
medium_threshold: ${{ inputs.medium_threshold }}
low_threshold: ${{ inputs.low_threshold }}
other_threshold: ${{ inputs.other_threshold }}
display_vulnerability_findings: "enabled"
- name: Display Inspector vulnerability scan results (markdown)
shell: bash
run: cat ${{ steps.inspector.outputs.inspector_scan_results_markdown }}
- name: Fail job if vulnerability threshold is exceeded
shell: bash
run: exit ${{ steps.inspector.outputs.vulnerability_threshold_exceeded }}
38 changes: 0 additions & 38 deletions .github/workflows/linux-container-scanning.yml

This file was deleted.

0 comments on commit 6fd73e9

Please sign in to comment.