Skip to content

v1.4.0

Choose a tag to compare

@github-actions github-actions released this 10 Oct 15:44
· 155 commits to main since this release
v1.4.0
5b4fdc2

verify-attestation.sh changes in this release. The new sha256 is dc6f227a0ae92d9e1fe8e9852fb0d4b22bfe6868f2690a6a0d91497348b01123; v1.3.0's was 0e7d4a27…. If you pin the script by hash, update the pin.

Output changes. The text output is unchanged and exit codes keep their meaning, with these exceptions, all in "Security" below: options that were silently ignored or malformed are now usage errors (exit 2), a few runs that ended VERIFIED or GOOD (exit 0) now end otherwise, and --anchor-file is new. If a wrapper passes --status, --status-keys, --check-kid, --check-subject, --check-generated-at or --min-seq without --status-list, or a non-numeric value to a numeric option, it now gets exit 2.

Security

  • Hardening of the standalone revocation query and the local environment (GHSA-h938-xchq-hhg4, medium; v1.0.0 to v1.3.0). No signature can be forged and no key is compromised; each issue needs a particular invocation or environment.
    • --check-kid, --check-subject and --check-generated-at replaced the document's own kid, slug and generatedAt in the revocation check, so a document signed by a revoked key, or with a withdrawn subject, could end GOOD (exit 0). The document's own values are now always checked, and these options add one more check; --check-kid must have the shape of a key ID.
    • Every python3 the verifier runs is now python3 -I -X utf8, so a json.py in the current directory, PYTHON* variables or the locale cannot change a check.
    • Numeric options are validated before use and never evaluated as shell arithmetic: --now and --max-age-days could run commands, and --max-age-seconds 60s made the freshness check pass.
    • Every internal variable is initialised when the script starts, so a standalone --status-list query no longer reads exported environment variables.
    • Status-list options given without --status-list were silently ignored; each is now a usage error (exit 2).
  • Other hardening (earlier releases are also affected):
    • values read from a document keep their trailing newlines, so --expect-slug and similar comparisons are against the signed value; a NUL byte is a failed check;
    • --now after 9999-12-31 is refused;
    • the subject rule, the TTL ceiling and the status-list validity ceiling compare exact instants, not whole seconds;
    • an empty signed slug or iss is a failed check (slug_empty, iss_empty, exit 1).
  • --anchor-file is new in this release, and its own fixes are included (no earlier release is affected): the bundle must be exactly a Sigstore v0.3 bundle before cosign runs, cosign is asked a second time for the exact identity of the certificate the release tag is read from, and the certificate must carry this repository's numeric GitHub ID.

Changed

  • Fixes to time and locale handling (earlier releases are also affected):
    • without GNU date (macOS), a time's offset could be ignored; it is now refused instead of misread;
    • not_yet_valid compares exact instants;
    • the verdict no longer depends on the locale: the protected header is read in the C locale and every file is read as bytes or UTF-8.
  • An option given without its value is a usage error (exit 2, error: --jws needs a value), not exit 1.
  • Input files are copied once into the private work directory and only the copy is read, so a file that changes during a run, or a pipe such as <(curl ...), is checked as one document.
  • Two --json fixes: anchor.verified is true only when every anchor check that applies ran and held; the string encoder is no longer redefined.
  • Documentation: the python3 commands in the README and docs/security/ run as python3 -I; §6 item 2 of the verification document no longer calls the Web PKI the only channel for the attestation key.

Added

  • --json (#38, #66).
    • One JSON object on stdout and nothing else: the verdict, the reason code that decided the exit code, every check, the attested content (only at exit 0; with --raw, also the signed posture), the unverified values of a document that did not verify, and the --anchor-file result.
    • Exit codes do not change; an argument error is JSON too (reason usage, exit 2).
    • Schema hodeishield.verifier.result.v1, in docs/security/json-output.md.
  • Machine reason codes for every check (#64), listed in docs/security/reason-codes.md. The text output is unchanged.
  • --anchor-file STATEMENT (and --anchor-bundle FILE) (#39, #65).
    • Runs cosign verify-blob on a release's key statement, with the signing identity fixed in the script, and requires the key that signed (and, with --status-list, the status-list key) to be listed under the right role with a matching retirement.
    • A statement that does not verify is exit 2, by design; a key it does not list is exit 1 (3 for the status-list key).
    • A key statement from a release older than the verifier is refused (exit 2). --version now shows the verifier's version.
    • Needs cosign 3.1.3 or later, for this option only. See Anchor the key and the decision record.
  • keys-statement.json, a new release asset (#62).
    • The machine-readable list of the issuer's signing keys (schema hodeishield.keys.statement.v1, source docs/security/keys.json, kept identical to keys.md by a CI check).
    • Listed in SHA256SUMS and signed with Sigstore (keys-statement.json.sigstore.json). Use it with --anchor-file.
    • A daily check compares the live key sets with keys.json.
  • A signed container image workflow (#22, #63). The container image was not built for v1.4.0; signed images start with the next release. image.yml builds the image from the release's verified script, signs it by digest with Sigstore keyless signing and attests an SBOM; the README ("A signed image") shows how to verify it.
  • An evaluation of Rust ML-DSA-65 implementations for a port of the verifier (#30, #61). It does not run any candidate against the test vectors; that stays open.

Tests and CI

  • Vectors: 3 appended to tests/vectors/v1/ for --anchor-file, with real Sigstore bundles. 118 in total; the first 115 are unchanged. They are marked requires: ["cosign"] and skipped where cosign is missing.
  • tests/vectors.sh --json checks the --json schema against every published vector.
  • tests/run.sh: new cases for every change above. Several self-checks that could pass without checking (an unevaluable --json check, the forged-verdict check, the globals check, the duplicate-function check) now fail when they should, and check themselves.
  • CI: VERIFIER_VERSION must equal the release tag and the changelog heading must be dated; a check of the latest release's key statement against the live workflow; the image is built and smoke-tested on pull requests.

Verify this release

sha256sum -c SHA256SUMS
cosign verify-blob --bundle verify-attestation.sh.sigstore.json \
  --certificate-identity "https://github.com/Hodeitek/hodeishield-attest-verifier/.github/workflows/release.yml@refs/tags/v1.4.0" \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  verify-attestation.sh
cosign verify-blob --bundle keys-statement.json.sigstore.json \
  --certificate-identity "https://github.com/Hodeitek/hodeishield-attest-verifier/.github/workflows/release.yml@refs/tags/v1.4.0" \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  keys-statement.json

verify-attestation.sh sha256: dc6f227a0ae92d9e1fe8e9852fb0d4b22bfe6868f2690a6a0d91497348b01123

Full changelog: v1.3.0...v1.4.0