Skip to content

v1.3.0 #123

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_scan_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}

- name: Scan built image with Inspector
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1.3.0
id: inspector
with:
artifact_type: 'container'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/example_display_findings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
# modify this block to scan your intended artifact
- name: Inspector Scan
id: inspector
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1.3.0
with:
# change artifact_type to either 'repository', 'container', 'binary', or 'archive'.
# this example scans a container image
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

# Inspector scan
- name: Scan container with Inspector
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1.3.0
id: inspector
with:
artifact_type: 'container' # configure Inspector for scanning a container
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Test archive scan
id: inspector
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1.3.0
with:
artifact_type: 'archive'
artifact_path: 'entrypoint/tests/test_data/artifacts/archives/testData.zip'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Test binary scan
id: inspector
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1.3.0
with:
artifact_type: 'binary'
artifact_path: 'entrypoint/tests/test_data/artifacts/binaries/inspector-sbomgen'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Test container scan
id: inspector
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1.3.0
with:
artifact_type: 'container'
artifact_path: 'ubuntu:14.04'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_dockerfile_vulns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Scan Dockerfiles
id: inspector
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1.3.0
with:
artifact_type: 'repository'
artifact_path: './'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_installation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}

- name: Test Amazon Inspector GitHub Actions plugin
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1.3.0
with:
artifact_type: 'container'
artifact_path: 'alpine:latest'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_no_vulns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

- name: Test binary scan
id: inspector
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1.3.0
with:
artifact_type: 'binary'
artifact_path: 'entrypoint/tests/test_data/artifacts/binaries/test_go_binary'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_reports_no_vulns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Test container scan
id: inspector
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1.3.0
with:
artifact_type: 'container'
artifact_path: 'alpine:latest'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_repository.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Test repository scan
id: inspector
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1.3.0
with:
artifact_type: 'repository'
artifact_path: './'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test_vuln_thresholds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}

- name: Scan artifact with Inspector
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1
uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1.3.0
id: inspector
with:
artifact_type: 'archive'
Expand All @@ -45,8 +45,8 @@ jobs:
low_threshold: 1
other_threshold: 1
sbomgen_version: "latest"
threshold_fixable_only: true
show_only_fixable_vulns: true

- name: Fail if vulnerability threshold is exceeded
run: if [[ ${{ steps.inspector.outputs.vulnerability_threshold_exceeded }} != "1" ]]; then echo "test failed"; else echo "test passed"; fi

# TODO: handle failure case
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,4 +372,6 @@ See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more inform

This project is licensed under the MIT license.

Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved
This project leverages the [Amazon Inspector SBOM Generator](https://docs.aws.amazon.com/inspector/latest/user/sbom-generator.html), which is distributed under the [AWS Intellectual Property License](https://aws.amazon.com/legal/aws-ip-license-terms/).

Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved
14 changes: 14 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ inputs:
description: "Specifies the OS and CPU arch of the container image you wish to scan. Valid inputs are of the form 'os/cpu/variant' for example, 'linux/amd64', 'linux/arm64/v8', etc. If no platform is specified, the system will use the same platform as the host that is performing the scan. This argument only affects container image scans. Requires inspector-sbomgen 1.5.1 or later."
required: False

threshold_fixable_only:
description: 'If set to true, only count vulnerabilities with a fix towards threshold exceeded condition.'
required: False
default: false
type: boolean

show_only_fixable_vulns:
description: "If set to true, this action will show only fixed vulnerabilities in the GitHub Actions step summary page. All vulnerability metadata is still retained in the raw Inspector scan files."
required: False
default: false
type: boolean

outputs:
artifact_sbom:
description: "The filepath to the artifact's software bill of materials."
Expand Down Expand Up @@ -148,6 +160,8 @@ runs:
- --out-dockerfile-scan-md=${{ inputs.output_inspector_dockerfile_scan_path_markdown }}
- --sbomgen-version=${{ inputs.sbomgen_version }}
- --thresholds
- ${{ inputs.threshold_fixable_only == 'true' && '--threshold-fixable-only' || '--no-op' }}
- ${{ inputs.show_only_fixable_vulns == 'true' && '--show-only-fixable-vulns'|| '--no-op' }}
- --critical=${{ inputs.critical_threshold }}
- --high=${{ inputs.high_threshold }}
- --medium=${{ inputs.medium_threshold }}
Expand Down
6 changes: 6 additions & 0 deletions entrypoint/entrypoint/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,19 @@ def init(sys_argv=None) -> argparse.Namespace:
help="Specifies one or more files and/or directories that should NOT be inventoried.")
parser.add_argument("--timeout", type=str, default="600",
help="The amount of time in seconds that inspector-sbomgne will run. When this timeout is exceeded, sbomgen will gracefully conclude and present any findings discovered up to that point.")
parser.add_argument("--show-only-fixable-vulns", action="store_true", default=False,
help="Only show fixed vulnerabilities in the GitHub Actions job summary page.")
parser.add_argument("--threshold-fixable-only", action="store_true", default=False,
help="Only count vulnerabilities with a fix towards threshold exceeded condition.")

parser.add_argument("--platform", type=str,
help="Specifies the OS and CPU arch of the container image you wish to scan. Valid inputs are "
"of the form 'os/cpu/variant' for example, 'linux/amd64', 'linux/arm64/v8', etc. If no platform is "
"specified, the system will use the same platform as the host that is performing the "
"scan. This argument only affects container image scans. Requires inspector-sbomgen "
"1.5.1 or later.")
parser.add_argument("--no-op", action="store_true", default=False,
help="A no operation argument, used as the default from the GitHub Actions caller when boolean arguments are not set. This is a workaround because GitHub Actions doesn't have a clean way to invoke or not invoke action='store_true' arguments")

args = ""
if sys_argv:
Expand Down
10 changes: 10 additions & 0 deletions entrypoint/entrypoint/fixed_vulns.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from dataclasses import dataclass


@dataclass
class FixedVulns:
criticals: int
highs: int
mediums: int
lows: int
others: int
Loading