Download the PHP package k2gl/composer-attest without Composer

On this page you can find all versions of the php package k2gl/composer-attest. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package composer-attest

composer-attest

A Composer plugin that verifies GitHub build-provenance attestations for the packages you install. As Composer downloads each package, the plugin hashes the artifact, asks GitHub for any attestation bound to that digest, and verifies the Sigstore bundle — requiring the signing identity to be a GitHub Actions workflow of the package's own repository.

It builds on k2gl/sigstore-verify for the cryptographic verification (certificate chain, transparency-log inclusion, DSSE envelope, identity), so a passing check means the artifact really was built by the repository's own CI and recorded in the public transparency log.

Status: proof of concept. The verification path is real and tested end to end (see Caveat for what this does and does not cover today).

Install

Composer will ask to trust the plugin the first time (it runs during install).

Configure

All configuration lives under extra.k2gl-attest in your root composer.json:

What you'll see

Under enforce, a package whose attestation fails verification aborts the install with a non-zero exit code.

Verify on demand

The plugin only sees packages Composer downloads during a given install. To audit everything already in vendor/ at once, run:

It re-fetches each installed GitHub-hosted package's dist, verifies its attestation, and prints a summary — honouring the same extra.k2gl-attest policy, and exiting non-zero on a failure under enforce.

Emit a Verification Summary (VSA)

The check itself is transient — a line in the install log that scrolls past. Turn on emit-vsa to also record each passing verification as a SLSA Verification Summary Attestation (https://slsa.dev/verification_summary/v1): a portable in-toto Statement you can store next to vendor/, hand to a downstream policy gate, or sign later.

For each verified package the plugin writes <vsa-dir>/<vendor>-<name>-<version>.vsa.json — a Statement over the artifact digest carrying the verifier, the policy issuer it required, the outcome (PASSED), and the SLSA level GitHub build provenance meets (SLSA_BUILD_LEVEL_2). composer attest emits them for the whole vendor/ in one pass. Built on k2gl/slsa-provenance.

Sign them

Point vsa-sign-key at a PEM private key and each VSA is signed into a DSSE envelope (<vendor>-<name>-<version>.vsa.dsse.json) instead of a bare statement — a verifiable attestation you can hand to anyone holding the public key:

The algorithm is read from the key — RSA or ECDSA P-256/384/521. Signing is with a local key: a Composer install has no interactive OIDC flow, so keyless (Fulcio) signing is out of scope here. A bad or unreadable key is reported and skipped, never aborting the install.

How it works

The plugin subscribes to Composer's POST_FILE_DOWNLOAD event. For each package dist it:

  1. computes the artifact's SHA-256 digest;
  2. requests GET /repos/{owner}/{repo}/attestations/sha256:{digest} (through Composer's authenticated HTTP client);
  3. parses each returned Sigstore bundle and verifies it with sigstore-verify, requiring a GitHub Actions identity of {owner}/{repo};
  4. confirms the artifact's digest is one of the in-toto statement's subjects.

Cross-checked against GitHub's own tooling

Two independent implementations agreeing is stronger evidence than either one's own tests. The cross-check workflow verifies a real attested package with both this verifier (pure PHP) and GitHub's official gh attestation verify (sigstore-go), and requires them to agree — verified on the clean zipball, rejected on a tampered one. Run it yourself:

Caveat: what gets attested

Composer installs a package's dist as a GitHub zipball (api.github.com/repos/{owner}/{repo}/zipball/{ref}). For the plugin to verify a package at install time, the repository must publish a build-provenance attestation for that zipball's digest.

Most repositories today attest their release tarball (a git archive output) or other build outputs — a different artifact than the zipball Composer fetches — so the plugin will report "no attestation" for them. This is a property of the current ecosystem, not the plugin: it is exactly why the zipball digest is reproducible yet unattested. As registries and publishers begin attesting the artifacts Composer actually installs, the plugin verifies them with no changes.

The verification logic itself is proven: it verifies a real published attestation end to end (the k2gl release tarballs, whose digests are attested, verify against the live GitHub attestations API).

Requirements

License

MIT


All versions of composer-attest with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-json Version *
composer-plugin-api Version ^2.0
k2gl/dsse Version ^1.3
k2gl/sigstore-verify Version ^1.4
k2gl/slsa-provenance Version ^1.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package k2gl/composer-attest contains the following files

Loading the files please wait ...