From c9c1792aa4bc6cebd2213bef4e0a4afde944a8be Mon Sep 17 00:00:00 2001 From: Matthew Watkins Date: Thu, 27 Feb 2025 09:28:47 +0000 Subject: [PATCH] Feat: Add security scan workflow Issue-ID: CIMAN-33 Change-Id: I00eb1ce90039e3dc43a9654b423b78e0acaae6cb Signed-off-by: Matthew Watkins --- .github/workflows/sonatype-audits.yaml | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/sonatype-audits.yaml diff --git a/.github/workflows/sonatype-audits.yaml b/.github/workflows/sonatype-audits.yaml new file mode 100644 index 0000000..5573e5c --- /dev/null +++ b/.github/workflows/sonatype-audits.yaml @@ -0,0 +1,50 @@ +--- +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2024 The Linux Foundation + +# This workflow uses actions that are not certified by GitHub. They are provided +# by a third-party and are governed by separate terms of service, privacy +# policy, and support documentation. + +name: 🔐 Security Scans +on: + workflow_dispatch: + # For Branch-Protection check. Only the default branch is supported. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection + branch_protection_rule: + # To guarantee Maintained check is occasionally updated. See + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained + schedule: + - cron: "31 3 * * 0" + push: + branches: ["main", "master"] + paths: + - "**" + - "!.github/**" + +# Declare default permissions as none. +permissions: {} + +jobs: + sonatype-lifecycle: + name: "Sonatype Lifecycle" + # yamllint disable-line rule:line-length + uses: lfit/releng-reusable-workflows/.github/workflows/reuse-sonatype-lifecycle.yaml@c418a28fa6ec695a726365dc236aad0fd0aa7e49 # v0.2.6 + secrets: + NEXUS_IQ_PASSWORD: ${{ secrets.NEXUS_IQ_PASSWORD }} + + # Scan results are found at: https://sonarcloud.io/login + sonarqube-cloud: + name: "SonarQube Cloud" + # yamllint disable-line rule:line-length + uses: lfit/releng-reusable-workflows/.github/workflows/reuse-sonarqube-cloud.yaml@c418a28fa6ec695a726365dc236aad0fd0aa7e49 # v0.2.6 + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + # Needed to publish results and get a badge (see publish_results below). + id-token: write + # Uncomment the permissions below if installing in a private repository. + # contents: read + # actions: read + secrets: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} -- 2.16.6