Skip to content
Merged
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
16 changes: 16 additions & 0 deletions .github/chainguard/baseline-scanner.sts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/octo-sts/app/refs/heads/main/pkg/octosts/octosts.TrustPolicy.json
#
# Octo STS trust policy for the OSPS Baseline Scanner workflow.
# Allows GitHub Actions runs on the main branch of this repository to
# federate for a short-lived GitHub App token, replacing the long-lived
# GH_AUTH_TOKEN PAT. See .github/workflows/baseline.yaml.

issuer: https://token.actions.githubusercontent.com
subject: repo:ossf/security-insights:ref:refs/heads/main

permissions:
metadata: read # Repository and organization metadata, branch rules
contents: read # Repo contents, languages, releases, security policy
administration: read # Branch protection rule via GraphQL
checks: read # Check suites/runs on the latest commit
statuses: read # Classic commit status API
14 changes: 13 additions & 1 deletion .github/workflows/baseline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:

permissions:
contents: read # Clone the repository
id-token: write # Federate with Octo STS for a short-lived GitHub App token
security-events: write # Required for SARIF upload

steps:
Expand All @@ -27,12 +28,23 @@ jobs:
with:
persist-credentials: false

# Exchanges this workflow's OIDC identity for a short-lived GitHub App
# token, per the trust policy in .github/chainguard/baseline-scanner.sts.yaml.
# Replaces the workflow GITHUB_TOKEN, which lacks the administration,
# checks, and statuses read access some baseline checks need.
- name: Federate with Octo STS
id: octo-sts
uses: octo-sts/action@f603d3be9d8dd9871a265776e625a27b00effe05 # v1.1.1
with:
scope: ${{ github.repository }}
identity: baseline-scanner

- name: Run Baseline Action
uses: revanite-io/osps-baseline-action@b7d860b68755627c30ab692473511c90daee3ae8 # v1.3.4
with:
owner: ${{ github.repository_owner }}
repo: ${{ github.event.repository.name }}
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ steps.octo-sts.outputs.token }}
catalog: "osps-baseline"
upload-sarif: "true"

Expand Down
Loading