This repo provides a GitHub Action for running OSPS (Open Source Project Security) Baseline assessments on your GitHub repository. This action evaluates your repository against security controls defined in the Open Source Project Security Baseline and can optionally upload results to GitHub's Security tab as SARIF files.
- Automated security assessments against OSPS Baseline controls
- Multiple output formats: YAML, JSON, or SARIF
- Direct integration with GitHub Security tab via SARIF upload
name: OSPS Security Assessment
on:
schedule:
- cron: "0 9 * * 1" # Weekly on Mondays at 9 AM UTC
workflow_dispatch: # Allow manual triggering
jobs:
osps-assessment:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write # Required for SARIF upload
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Open Source Project Security Baseline Scanner
uses: revanite-io/osps-baseline-action@v1.3.2
with:
owner: ${{ github.repository_owner }}
repo: ${{ github.event.repository.name }}
token: ${{ secrets.PVTR_GITHUB_TOKEN }}
catalog: "osps-baseline-2026-02"
upload-sarif: "true"
- name: Upload Assessment Results
if: always()
uses: actions/upload-artifact@v7
with:
name: osps-assessment-results-${{ github.run_number }}
path: evaluation_results/
retention-days: 30| Input | Description | Required | Default |
|---|---|---|---|
owner |
Repository owner (organization or user) | Yes | - |
repo |
Repository name | Yes | - |
token |
GitHub Personal Access Token with repo read permissions | Yes | - |
catalog |
Catalog ID to assess against (OSPS Baseline release bundled in the scanner; e.g. osps-baseline-2026-02) |
No | osps-baseline-2026-02 |
output-format |
Output format (yaml, json, or sarif) |
No | yaml |
upload-sarif |
Upload results as SARIF to GitHub Security tab. When true, output-format is automatically set to sarif |
No | false |
sarif-only-failures |
Upload only failed controls (error-level results) to GitHub Code Scanning. Needs-review and passed controls stay in the workflow summary and results files. Set to false to upload all results |
No | true |
fail-on-error |
Fail the workflow if any controls have errors. When false, results are reported but the step always passes |
No | false |
The catalog input identifies which OSPS Baseline catalog version to run. Catalogs are versioned in the scanner and map to specific baseline releases.
Examples:
osps-baseline-2026-02(current default in this action)osps-baseline-2025-10(older baseline release)
How to choose a compatible value:
- Pin your scanner image/source version.
- Use a catalog ID that exists in that scanner version.
- Prefer newer catalog IDs unless you need compatibility with older reporting.
NOTE: If the catalog does not exist in the scanner version you run, the scan may produce empty results or no parsed control findings.
Examples in this README use the latest tagged action release (v1.3.2). For production workflows, pin to a commit SHA for deterministic behavior.
Your GitHub Personal Access Token needs repository read permissions. For public repositories, you can use the repo scope, or public_repo for public repos only. An additional check for multi-factor authentication will run if your token includes admin:org permissions.
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Generate a new token with
reposcope (orpublic_repofor public repositories) - Add the token as a secret in your repository (Settings → Secrets and variables → Actions)
- Reference it by name in your workflow, such as
${{ secrets.PVTR_GITHUB_TOKEN }}
- YAML (Default): Human-readable format, suitable for local review and CI/CD pipelines
- JSON: Machine-readable format, useful for programmatic processing and integration with other tools
- SARIF: Static Analysis Results Interchange Format, connects results to GitHub's Security tab
The scanner marks controls it cannot fully verify as "Needs Review" and re-emits them on every scan by design (per Gemara, final interpretation belongs to the audit phase). GitHub Code Scanning opens an alert for every uploaded SARIF result and only closes an alert when a later upload no longer contains it, so uploading "Needs Review" results creates alerts that never close.
For that reason, by default (sarif-only-failures: true) only failed controls are uploaded to the Security tab. Failed-control alerts open when a control fails and auto-close once a later scan no longer reports the failure. "Needs Review" and passed controls remain in the workflow step summary and in the evaluation_results output files.
If no controls failed, nothing is uploaded (GitHub rejects SARIF uploads with zero results) and the workflow summary is the place to review the assessment.
Avoid dismissing "Needs Review" alerts from older uploads: the results carry no fingerprints, so a dismissed alert can mask a later genuine failure of the same control. Set sarif-only-failures: false to restore the old upload-everything behavior.
A: Unfortunately, no. For running the OSPS plugin against public repositories, the builtin CI token does not have access to make API calls.
A: There are several common reasons:
- Missing permissions: Ensure your workflow includes
security-events: writepermission. Organization-level settings may also restrict security event uploads. - Invalid SARIF format: The action validates the SARIF file before upload. Check the workflow logs for any errors produced by the plugin
- Plugin crash: Because of the reliance on API calls to collect data, the plugin occasionally encounters an error and needs to be re-run
- User Permissions: If you are not authorized to view the security tab, it may have uploaded without your knowledge.
A: The action automatically fixes file permissions after the Docker container runs. If you still encounter permission issues:
- Ensure the workflow has write access to the workspace
- Check that the
evaluation_resultsdirectory is created and writable - Review the workflow logs for specific permission error messages
A: Currently, the action assesses against "Maturity Level 1" by default. This is hardcoded in the action because higher maturity levels do not currently produce high-confidence results from the pvtr-github-repo plugin. You can use the plugin directly to access any assessments that are available.
A: Follow these steps:
- Check workflow logs: Review the full workflow output for error messages
- Verify token permissions: Ensure your token has the required repository read access
- Check repository accessibility: Confirm the repository exists and is accessible with the provided token
- Review artifact uploads: Download and inspect the
evaluation_resultsartifact for detailed logs - Validate configuration: Ensure all required inputs are provided correctly
Contributions are welcome! Please see our contributing guidelines for more information.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
- Privateer - The core assessment engine
- Gemara - OSPS Baseline control definitions
- OSPS Baseline - Open Source Project Security Baseline specification