diff --git a/.github/workflows/build-and-push-services.yml b/.github/workflows/build-and-push-services.yml index c9e5f4cd..e257ce27 100644 --- a/.github/workflows/build-and-push-services.yml +++ b/.github/workflows/build-and-push-services.yml @@ -14,6 +14,21 @@ name: Build and push OADA images +permissions: + packages: write + security-events: write + id-token: write + actions: read + checks: read + contents: read + deployments: read + issues: read + discussions: read + pages: read + pull-requests: read + repository-projects: read + statuses: read + on: push: pull_request: @@ -40,7 +55,7 @@ jobs: id: services run: | SERVICES=$(ls -1 oada/services | tr '\n' ',' | sed 's/,/","/g' | sed 's/^/["/' | sed 's/,"$/]/') - echo ::set-output name=list::${SERVICES} + echo list="${SERVICES}" >> "$GITHUB_OUTPUT" - name: Parse Ref id: ref @@ -78,8 +93,8 @@ jobs: exit 1 fi - echo ::set-output name=version::${VERSION} - echo ::set-output name=release::${RELEASE} + echo version="${VERSION}" >> "$GITHUB_OUTPUT" + echo release="${RELEASE}" >> "$GITHUB_OUTPUT" - name: Parse Semver id: semver @@ -111,7 +126,6 @@ jobs: version: latest - name: Cache docker layers - if: ${{ !env.ACT }} # Awaiting ACT version after 0.2.17 for this feature uses: actions/cache@v4 id: cache with: @@ -175,7 +189,6 @@ jobs: version: latest - name: Cache docker layers - if: ${{ !env.ACT }} # Awaiting ACT version after 0.2.17 for this feature uses: actions/cache@v4 id: cache with: @@ -195,8 +208,8 @@ jobs: # Name on GHCR GHCR_IMAGE=ghcr.io/${OWNER}/${{ matrix.service}} - echo ::set-output name=dockerhub::${DOCKER_IMAGE} - echo ::set-output name=ghcr::${GHCR_IMAGE} + echo dockerhub="${DOCKER_IMAGE}" >> "$GITHUB_OUTPUT" + echo ghcr="${GHCR_IMAGE}" >> "$GITHUB_OUTPUT" - name: Login to DockerHub #if: github.event_name != 'pull_request' @@ -300,9 +313,9 @@ jobs: fi fi - echo ::set-output name=tag::${TAG} - echo ::set-output name=org::${OWNER} - echo ::set-output name=cur::${GHCR_IMAGE}:sha-${GITHUB_SHA::8} + echo tag="${TAG}" >> "$GITHUB_OUTPUT" + echo org="${OWNER}" >> "$GITHUB_OUTPUT" + echo cur="${GHCR_IMAGE}:sha-${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT" - name: Monitor Service image with Snyk uses: snyk/actions/docker@master @@ -325,6 +338,11 @@ jobs: image: ${{ steps.tag.outputs.tag }} args: --org=${{ steps.tag.outputs.org }} --file=${{ matrix.context }}/Dockerfile + - name: Replace security-severity undefined for license-related findings + run: | + sed -i 's/"security-severity": "undefined"/"security-severity": "0"/g' snyk.sarif + sed -i 's/"security-severity": "null"/"security-severity": "0"/g' snyk.sarif + - name: Secure Code Warrior uses: SecureCodeWarrior/github-action-add-sarif-contextual-training@v1 with: @@ -381,7 +399,7 @@ jobs: RELEASE_VERSION="${{ needs.setup.outputs.version }}" \ ./release/make.sh | tee $RELEASE - echo ::set-output name=composefile::$RELEASE + echo composefile="${RELEASE}" >> "$GITHUB_OUTPUT" # TODO: More detailed check? - name: Verify Compose File diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index e18cedcd..00000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,67 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: CodeQL - -on: - push: - branches: [master] - pull_request: - # The branches below must be a subset of the branches above - branches: [master] - schedule: - - cron: 25 20 * * 4 - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - language: [javascript] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/helm-chart.yml b/.github/workflows/helm-chart.yml index 0ad8b7ad..670556dd 100644 --- a/.github/workflows/helm-chart.yml +++ b/.github/workflows/helm-chart.yml @@ -14,6 +14,8 @@ name: Release Helm charts +permissions: read-all + on: push: branches: @@ -21,6 +23,8 @@ on: jobs: release: + permissions: + contents: write runs-on: ubuntu-latest steps: - name: Checkout @@ -35,6 +39,8 @@ jobs: - name: Install Helm uses: azure/setup-helm@v4 + env: + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' with: version: v3.8.1 diff --git a/.github/workflows/semgrep-analysis.yml b/.github/workflows/semgrep-analysis.yml index 03e2704f..237fc0ef 100644 --- a/.github/workflows/semgrep-analysis.yml +++ b/.github/workflows/semgrep-analysis.yml @@ -5,6 +5,8 @@ name: Semgrep +permissions: read-all + on: # Scan changed files in PRs (diff-aware scanning): pull_request: {} @@ -24,6 +26,9 @@ jobs: # If you are self-hosting, change the following `runs-on` value: runs-on: ubuntu-latest + permissions: + security-events: write + container: # A Docker image with Semgrep installed. Do not change this. image: semgrep/semgrep @@ -42,6 +47,7 @@ jobs: # and add it to your GitHub secrets. SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }} SEMGREP_DEPLOYMENT_ID: ${{ secrets.SEMGREP_DEPLOYMENT_ID }} + SEMGREP_SUPPRESS_ERRORS: true - name: Secure Code Warrior uses: SecureCodeWarrior/github-action-add-sarif-contextual-training@v1