Skip to main content

Open source starter kit for adopting OSS security baselines via policy packs, templates, evidence, and remediation.

Project description

OSS Security Policy as Code Starter Kit

Evaluate clone-visible OSS repository governance plus GitHub Actions, Azure Pipelines, and AWS CodeBuild/CodePipeline signals from a local clone. Platform truth outside the repository still requires evidence or manual review.

This project is intentionally small and explicit about trust boundaries. GitHub support is the most mature path today; Azure and AWS support are clone-based and evidence-driven rather than live platform verification.

Operational privacy: evaluation is local and clone-visible by default. API-backed evidence collection runs only when explicitly invoked, and should be scoped to the platform/repository being assessed.

Quick Links

At A Glance

Area What you get
Current release v5.6.0 / Python package oss-policy-kit==5.6.0
Input A local repository clone
Output evaluation-report.json and evaluation-report.md (optional SARIF 2.1.0 via --sarif-output)
Core scope Clone-visible governance and GitHub/Azure/AWS CI/CD signals
Profiles 32 bundled profiles — platform ladders (github-*, azure-*, aws-* levels 1-3 and release-hardening 1-3), advisory hybrids (github-aws-level-2, github-azure-level-2), regulatory (cra-eu-ready-1, cra-eu-strict-1), framework alignment (osps-baseline-1, slsa-build-l2-1, ssdf-baseline-1, cis-supply-chain-1, owasp-cicd-top10-1, s2c2f-l1-1), AppSec native bundle (appsec-sast-sca-1), and posture profiles (iac-terraform-baseline-1, kubernetes-baseline-1, container-baseline-1). List with python -m oss_policy_kit profiles; full matrix in docs/profiles/overview.md.
Exceptions Waiver registry with owner, reason, and expiry
Examples Hardened and vulnerable sample repositories
Assurance model Each control is labelled deterministic, signal, or evidence-backed; the value flows into reports/1.0 JSON and Markdown so consumers can reason about proof strength. See docs/profiles/overview.md.

Recommended First Command

After installing, run the hardened example first:

python -m oss_policy_kit evaluate --target ./examples/hardened-repo --profile github-level-1 --output-dir ./out/hardened --summary-only

This confirms the CLI, bundled profile data, example repository, and report generation path before you evaluate your own repository.

Two-line bootstrap (v5.4.0+; available in current v5.6.0)

For brand new adopters, init collapses the first run into two commands:

python -m oss_policy_kit init --target . --with-evidence --with-workflow
python -m oss_policy_kit evaluate --target .

init writes a persisted oss-policy-kit.yaml; evaluate reads the profile from it when --profile is omitted. See docs/cli-reference.md for all flags.

Use as a GitHub Action

The kit ships a composite GitHub Action so adopters can evaluate the bundled baseline on every pull request without managing Python in their build images:

- uses: lucashgrifoni/OSS-Security-Policy-as-Code-Starter-Kit@v5
  with:
    profile: github-level-1
    fail-on: fail

Inputs map 1:1 to CLI flags. Full reference and SARIF forwarding example in docs/github-action.md.

Current Release State

v5.7.0 is the current public release line. It is an additive minor release on top of v5.6.0: the JSON report contract remains reports/1.0, legacy 0.3 and 0.2 report shapes remain selectable, and the existing profile IDs stay stable. The release adds three new cloud-platform IaC parsers (CloudFormation, Pulumi Python, Bicep), an opt-in Helm template pre-pass for scan-k8s, two webhook-security signal controls (SEC-WEBHOOK-001..002), and continues the internal evaluators.py decomposition (governance + supply-chain shims, byte-equivalent registry). v5.6.0 (Kubernetes manifest coverage + container hardening), v5.5.0 (Terraform IaC posture), and v5.4.0 (init wizard + scan-sast + Semgrep adapter) remain part of the catalog. See CHANGELOG.md for full details.

Surface Current state
Package oss-policy-kit==5.7.0
GitHub Release v5.7.0 is the current release target; v5.6.0, v5.5.0, v5.4.0, and earlier versions remain available as predecessors
Default branch master
License Apache-2.0 (LICENSE + NOTICE)
Report contract reports/1.0 by default; 0.3 and 0.2 remain selectable via --report-json-contract. 0.1 was removed in v5.0.0
Security workflow Scanners run in Security CI/CD; SARIF upload is gated by ENABLE_CODE_SCANNING_UPLOAD=true so validation does not fail when Code Scanning upload APIs are unavailable

The repository is designed to be reproducible from a clean clone: install the package, run the built-in examples, and compare the generated JSON/Markdown reports.

What's new in v5.7.0

Highlights only — full detail in CHANGELOG.md. For migration notes from earlier releases, see docs/v5.1.0-migration-guide.md and docs/v5.0.0-migration-guide.md.

  • Three new cloud-platform IaC parsers: scan-cfn for CloudFormation (YAML + JSON, tolerant of short-form intrinsics !Ref / !Sub / !GetAtt), scan-pulumi for Pulumi Python programs (uses stdlib ast), and scan-bicep for Bicep modules (pure-Python regex tokenizer, no bicep CLI required). Each ships a 6-rule pack, an evidence schema (oss-policy-kit/evidence/iac-{cfn,pulumi,bicep}/v1), and an advisory bundled profile (iac-cfn-baseline-1, iac-pulumi-baseline-1, iac-bicep-baseline-1).
  • Opt-in Helm template pre-pass for scan-k8s via the new --helm-render flag. When the system helm CLI is available, scan-k8s discovers every Chart.yaml under the target, renders the chart via helm template, and merges the rendered manifests into the regular K8s scan. Charts that fail to render are recorded in evidence diagnostics; missing helm CLI is reported as a non-fatal note. Default behavior (skipping unrendered {{ ... }} templates) is unchanged.
  • Webhook receiver security pack (SEC-WEBHOOK-001 signature validation, SEC-WEBHOOK-002 replay defense). Both ship as lifecycle: experimental, assurance: signal. Returns not-applicable for repositories with no webhook receiver, so non-receiver repos are never penalized. New profile webhook-security-1. Total bundled profiles: 32 → 36.
  • evaluators.py decomposition steps 2 & 3: new evaluators_governance.py and evaluators_supply_chain.py modules introduced as public package boundaries. EVALUATOR_REGISTRY is byte-equivalent across the v5.6 → v5.7 transition (validated by a dedicated invariant test). Future v5.8 work will move the function bodies into these modules incrementally.

There are no breaking changes in v5.7.0. The --fail-on semantics, JSON report contracts (reports/1.0, 0.3, 0.2 byte-stable), Markdown report layout, and the surfaces of evaluate / evaluate-many / recommend-profile / scaffold-evidence / collect-evidence / diff-reports / init / scan-sast / scan-iac / scan-k8s are unchanged. No new hard dependencies were added.

What This Kit Does

The starter kit helps you assess whether a repository shows a practical OSS baseline in files and workflows that are observable locally. It focuses on:

  • SECURITY.md, CONTRIBUTING.md, LICENSE, CODEOWNERS, changelog presence
  • clone-visible GitHub Actions, Azure Pipelines, and AWS build/pipeline structure and hygiene signals
  • report generation for humans and pipelines
  • policy lifecycle markers such as stable, experimental, and deprecated
  • additive local evidence such as waivers and optional platform evidence files

It is not a universal application scanner, an OSPS certification engine, a compliance guarantee, or a substitute for threat modeling, secure code review, pentesting, or GitHub settings review. See docs/results-guide.md for the full applicability discussion.

Quickstart

Requires Python 3.12+.

Install (official channels)

  1. From PyPI (recommended for most consumers):

    python -m pip install oss-policy-kit
    python -m oss_policy_kit --version
    
  2. From GitHub Release artifacts — when wheel or sdist assets are attached to a release, download oss_policy_kit-*.whl or oss_policy_kit-*.tar.gz from the Releases page, then pip install /path/to/wheel. PyPI remains the primary install channel.

  3. From source (contributors):

    python -m pip install -e ".[dev]"
    

Prefer python -m oss_policy_kit for CLI entry on Windows so you do not depend on Scripts\ being on PATH.

Run The Built-In Examples

python -m oss_policy_kit evaluate --target ./examples/vulnerable-repo --profile github-level-1 --output-dir ./out/vulnerable
python -m oss_policy_kit evaluate --target ./examples/hardened-repo --profile github-level-1 --output-dir ./out/hardened

What Success Usually Looks Like

  • examples/hardened-repo on github-level-1: pass: 14 (all active controls in the profile)
  • examples/vulnerable-repo on github-level-1: multiple fail
  • github-release-hardening-1: typically pass plus one branch-protection result that remains manual-review-required or self-attested, depending on local evidence

For the full step-by-step demo (CLI help, profile discovery, fixture comparison, controls table, CI gating), see docs/validation-walkthrough.md.

CI/CD Integration

Starter workflows live under templates/workflows/:

Typical CI command:

python -m oss_policy_kit evaluate --target . --profile github-level-1 --fail-on fail --output-dir ./oss-policy-reports

Exit codes in pipelines: 0 evaluation finished and the --fail-on threshold was not violated; 1 the gate tripped; 2 is usage or load errors. Keep the output directory as an artifact with if: always() so reviewers can inspect reports after a blocked run.

GitHub Release assets are the intended alternate install path when wheel or sdist artifacts are attached. PyPI remains the primary install channel, and the publish workflow generates both distribution artifacts and a CycloneDX SBOM as workflow artifacts for release evidence.

Outputs

Each evaluate run writes:

  • evaluation-report.md — human-readable report (summary, controls table, per-control detail)
  • evaluation-report.json — machine-readable contract (default reports/1.0)
  • evaluation-report.sarif — SARIF 2.1.0, only when --sarif-output is passed

For the JSON contract details see docs/reports-contract-v1.0.md and the legacy docs/reports-contract-v0.3.md. For result statuses (pass, fail, manual-review-required, self-attested, etc.) and how to interpret each one see docs/results-guide.md.

Maintainer Self-Check

Run the kit against this repository:

python -m oss_policy_kit evaluate --target . --profile github-level-1 --output-dir ./out/selfcheck

Treat the generated self-check report as authoritative for the current revision.

Optional maintainer scripts under scripts/:

  • consumer_smoke.py — install the wheel into a clean venv and exercise the CLI end-to-end.
  • twine_check_dist.py — run twine check against dist/*.whl / dist/*.tar.gz.
  • check_public_hygiene.py — fail-fast guard against private tokens leaking into public files.
  • demo-video.ps1 — PowerShell helper to record a CLI demo GIF/video; not part of CI or packaging.

Documentation

Contributing

See CONTRIBUTING.md.

Governance

See GOVERNANCE.md for maintainers, decision-making, release process, and the path to becoming a maintainer.

Security

See SECURITY.md.

License

Apache-2.0. See LICENSE and NOTICE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oss_policy_kit-5.7.0.tar.gz (240.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oss_policy_kit-5.7.0-py3-none-any.whl (331.1 kB view details)

Uploaded Python 3

File details

Details for the file oss_policy_kit-5.7.0.tar.gz.

File metadata

  • Download URL: oss_policy_kit-5.7.0.tar.gz
  • Upload date:
  • Size: 240.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for oss_policy_kit-5.7.0.tar.gz
Algorithm Hash digest
SHA256 14ef5db2e2bbdbc4fd2a3b58a96c6f303f5f7e9db9262df184d2141e15cd97d2
MD5 68d2867ccefffb0f56181e09e742a84a
BLAKE2b-256 b937c1e20b37aaad33cd3f667e58244e887695c12c400de31470ef23489934a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for oss_policy_kit-5.7.0.tar.gz:

Publisher: publish-pypi.yml on lucashgrifoni/OSS-Security-Policy-as-Code-Starter-Kit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file oss_policy_kit-5.7.0-py3-none-any.whl.

File metadata

  • Download URL: oss_policy_kit-5.7.0-py3-none-any.whl
  • Upload date:
  • Size: 331.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for oss_policy_kit-5.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e09ea4edb594971803e0995e0b17b297830ddd4aae0ac26849ce77e91ad58ac
MD5 4577430d73ce6236ffb19326d36964d3
BLAKE2b-256 c51fd84ce44b4938565cd5c972bc3870fa1a24c348ea651d97e7ea3c89b6f9ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for oss_policy_kit-5.7.0-py3-none-any.whl:

Publisher: publish-pypi.yml on lucashgrifoni/OSS-Security-Policy-as-Code-Starter-Kit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page