test threshold failure #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push] | ||
jobs: | ||
inspector: | ||
runs-on: ubuntu-latest | ||
name: "Amazon Inspector Scan" | ||
environment: | ||
name: plugin-development | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-region: ${{ secrets.AWS_REGION }} | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
- name: Scan image with Amazon Inspector | ||
uses: ./ | ||
id: inspector | ||
with: | ||
artifact_type: 'container' | ||
artifact_path: 'ubuntu:14.04' | ||
output_sbom_path: 'sbom.json' | ||
output_inspector_scan_path: 'inspector_scan.json' | ||
output_inspector_scan_path: 'inspector_scan.csv' | ||
critical_threshold: 1 | ||
high_threshold: 1 | ||
medium_threshold: 1 | ||
low_threshold: 1 | ||
other_threshold: 1 | ||
- name: Display SBOM Output | ||
run: cat ${{ steps.inspector.outputs.artifact_sbom }} | ||
- name: Display Inspector Scan (JSON) | ||
run: cat ${{ steps.inspector.outputs.inspector_scan_results }} | ||
- name: Display Inspector Scan (CSV) | ||
run: cat ${{ steps.inspector.outputs.inspector_scan_results_csv }} | ||
- name: Upload Inspector Scan Results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Inspector Scan SBOM Results | ||
path: | | ||
sbom.json | ||
inspector_scan.json | ||
inspector_scan.csv | ||
- name: Fail if vulnerability threshold is exceeded | ||
run: exit ${{ steps.inspector.outputs.vulnerability_threshold_exceeded }} |