From 685ecb951b4797ce137206ca9cb75f6d2d885273 Mon Sep 17 00:00:00 2001 From: Dennis Felsing Date: Mon, 11 Aug 2025 21:26:36 +0000 Subject: [PATCH] Add GitHub action to create SBOM --- .github/workflows/sbom.yml | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/sbom.yml diff --git a/.github/workflows/sbom.yml b/.github/workflows/sbom.yml new file mode 100644 index 0000000000000..e637043fec489 --- /dev/null +++ b/.github/workflows/sbom.yml @@ -0,0 +1,61 @@ +# Copyright 2024 Amazon.com, Inc. or its affiliates. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +# +# Portions of this file are derived from the README examples, retrieved on 2025-08-11 from +# https://github.com/aws-actions/vulnerability-scan-github-action-for-amazon-inspector/blob/4e74c0428eb3178778d186bf97daa347852858d1/README.md + +name: SBOM +on: + pull_request: + types: [opened, synchronize] +jobs: + daily_job: + runs-on: ubuntu-latest + + steps: + - name: Checkout this repository + uses: actions/checkout@v4 + + - name: Inspector Scan + id: inspector + uses: aws-actions/vulnerability-scan-github-action-for-amazon-inspector@v1.3.0 + with: + artifact_type: 'repository' + artifact_path: './' + display_vulnerability_findings: "enabled" + critical_threshold: 1 + high_threshold: 1 + medium_threshold: 1 + low_threshold: 1 + other_threshold: 1 + + - name: Display CycloneDX SBOM + run: cat ${{ steps.inspector.outputs.artifact_sbom }} + + - name: Display Inspector vulnerability scan results + run: cat ${{ steps.inspector.outputs.inspector_scan_results_markdown }} + + - name: Upload Scan Results + uses: actions/upload-artifact@v4 + with: + name: Inspector Vulnerability Scan Artifacts + path: | + ${{ steps.inspector.outputs.artifact_sbom }} + ${{ steps.inspector.outputs.inspector_scan_results_markdown }}