Skip to content

About

Check a SYNAPSE release receipt against policy in CI, using a pinned, hash-verified SYNAPSE CHANNEL release.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SYNAPSE policy check

SYNAPSE POLICY CHECK — CI policy gate for SYNAPSE CHANNEL release receipts

A GitHub Action that checks a SYNAPSE CHANNEL release receipt against a policy file. It can also check the receipt's Merkle commitment and signature.

This Action installs one exact, hash-verified SYNAPSE CHANNEL release.

Usage

permissions:
  contents: read
  attestations: read   # only needed with verify-attestation: "true"

steps:
  - uses: actions/checkout@<commit sha>
  - uses: anulum/<this repository>@<commit sha>   # pin by commit
    with:
      task: RELEASE-42
      policy: .synapse/policy.json
      receipt-json: release-receipt.json
      verify-attestation: "true"
Input Required Default Meaning
task yes Task id / subject label for the decision report.
policy yes Policy file (.json or .toml; signed policies must be .json).
receipt-json yes Release receipt from synapse release --receipt-json.
enforce no "true" Fail the step when an enforcement-mode policy has a failing rule. Must be "true" or "false"; any other value exits 2.
merkle-db no "" Hub event store; recompute the receipt's coordination-log commitment against it.
trusted-signing-keys no "" Trusted hub .pub keys, one path per line; require a valid signature over the commitment.
policy-trust-bundle no "" Ed25519 trust bundle JSON; require a signed JSON policy from a trusted, unrevoked key before evaluating any rule.
min-policy-version no "" Minimum integer policy_version accepted when policy-trust-bundle is set.
verify-attestation no "false" Also verify the GitHub build attestation of the SYNAPSE CHANNEL wheel before installing it.
python-version no "3.12" Python used to run the check (3.11 or later).

The output report holds the JSON decision report (written to GITHUB_OUTPUT using a fresh random heredoc delimiter per invocation). The step's exit status is that of synapse policy-check (or 2 for invalid Action inputs).

What is installed, and how it is checked

  • Exact release. requirements.txt pins synapse-channel[encryption] and its transitive dependencies (websockets, cryptography, cffi and pycparser) to exact versions so commitment-signature (trusted-signing-keys) and signed-policy (policy-trust-bundle) verification work inside the isolated environment. Every file is pinned by SHA-256.

    • The Action downloads with --require-hashes --only-binary=:all:.
    • It installs with --no-index from that verified download only.
    • Any change on the index fails the step instead of installing something else.
    • This Action's version decides the SYNAPSE CHANNEL version. There is no input to change it.
  • Isolated. The check runs from its own virtual environment under RUNNER_TEMP. setup-python runs with update-environment: false, so your job's Python and PATH are unchanged.

  • Attestation (opt-in). With verify-attestation: "true", the GitHub CLI checks the wheel's build attestation (gh attestation verify) before the install. It must have been:

    • built by anulum/synapse-channel/.github/workflows/publish.yml;
    • from the pinned release tag and commit;
    • on a GitHub-hosted runner.

    The step needs the GitHub CLI (preinstalled on GitHub-hosted runners) and a token that can read attestations; the job token can, with attestations: read. Any value other than "true" or "false" fails the step. Attestation checking is planned to become the default at the next major version.

  • No injection path. Inputs reach the shell only through env, never through ${{ }} inside a script. Every CLI option binds its value directly (--option=value), the positional task argument is passed after -- so option-like task labels cannot invoke CLI flags, and report is written to GITHUB_OUTPUT with a per-invocation random delimiter.

Pinned release

Action SYNAPSE CHANNEL Wheel SHA-256 Source commit
unreleased 0.99.67 6f20be963c4e6a36ef625561ce607d1b86f27fe388e7e85fe8f5367d6dbca7c1 e30cc01a7163e02da9df3b43a4d15b30b7f5199a

Maintaining the pin

  1. Set the new version in requirements.in and regenerate the lock: uv pip compile requirements.in --universal --generate-hashes --python-version 3.11 --no-header --no-annotate -o requirements.txt (keep the two comment lines at the top).
  2. Set CORE_TAG and CORE_COMMIT in action.yml to the release tag and the commit it points at.
  3. Run pytest. The tests check:
    • the lock hashes against PyPI;
    • the commit against the GitHub tag;
    • the real attestation, including two negative controls;
    • the Action's steps end to end, including signed receipts and signed policies.

Dependency audit

CI audits every committed lock against the advisory database on each push and pull request to main (audit job). The locks are requirements.txt, .github/requirements/requirements-dev.txt and .github/requirements/requirements-audit.txt. A finding fails the job; there is no severity threshold.

pip-audit skips a pin whose environment marker is false on the interpreter it runs on. The audit job runs on Python 3.11 and on 3.13, covering the ends of the supported Python range. tests/test_lock_audit.py reads the locks and fails when a pin is reached by no leg, when a lock has no audit step, or when an audit command changes.

To add a lock, commit it and add one audit step for it. To update the audit tool, run the command in the first line of .github/requirements/requirements-audit.txt with --upgrade.

Licence

AGPL-3.0-or-later, with a commercial licence available: see LICENSE, LICENSES/ and COMMERCIAL-LICENSE.md.

Text and data mining reservation

The rightsholder, Miroslav Šotek (ANULUM), expressly reserves the use of the works in this repository for text and data mining, including the collection of this content for, and its use in, training, fine-tuning or evaluating machine learning and artificial intelligence models, in accordance with Article 4(3) of Directive (EU) 2019/790 and the national provisions transposing it.

No permission for such use has been granted beyond what the licence in LICENSE grants. This reservation does not change that licence: uses the licence permits remain permitted on its terms, including its attribution and share-alike conditions.

Reservation made on 2026-10-19. Requests for permission: contact the rightsholder through the contact listed in this repository.

About

Check a SYNAPSE release receipt against policy in CI, using a pinned, hash-verified SYNAPSE CHANNEL release.

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages