diff --git a/attest/README.md b/attest/README.md index b4e8bed..cf59fbe 100644 --- a/attest/README.md +++ b/attest/README.md @@ -47,14 +47,40 @@ If your environment cannot submit to the public Sigstore transparency log (e.g. customers in the USA / EU with data-residency requirements), use one of: -- **KMS signing**: `--kms vault://` (HashiCorp Vault transit) or - `--kms awskms://` (AWS KMS) — signature stays in your control. +- **KMS signing**: `--kms vault://` (HashiCorp Vault transit). + The signature stays in your control. Vault transit is the only KMS + backend implemented today. - **Keyed signing with checked-in private key**: `sign-key: private-key.pem`. - **Private Sigstore**: deploy your own Fulcio + Rekor and pass `fulcio-server-url` + `rekor-server-url`. See the inputs section below for the full list. +### Timestamping key-based signatures + +A signature made with `sign-key` carries no time anchor unless you add an +RFC 3161 timestamp, which lets a verifier show it was made before the +key was rotated or revoked. Request one explicitly; `timestamp-server-url` +accepts a Sigstore timestamp authority or a standard RFC 3161 service: + +```yaml +- uses: cycodelabs/cimon-action/attest@v1 + with: + subjects: dist\my-app.msi + sign-key: private-key.pem + include-timestamp: true + timestamp-server-url: http://timestamp.sectigo.com + fail-on-error: true +``` + +If the timestamp server cannot be reached, attestation fails. With the +default `fail-on-error: false` that is only logged as a warning, so set +it to `true` when the timestamp is required. Verify with +`cimon attest verify --key public-key.pem --timestamp-certificate-chain +`, pinning the timestamp authority's root certificate. +This requires a cimon release with key-based timestamping; older +releases accept these inputs and produce no timestamp. + ## Inputs | Name | Description | Default | @@ -64,11 +90,12 @@ See the inputs section below for the full list. | `skip-source-tree-check` | Skip verifying the source tree matches the recorded commit | `false` | | `sign-key` | Path to a private ECDSA/RSA/ED25519 PEM key | — | | `keyless` | Use keyless (Sigstore) signing | `false` | -| `tlog-upload` | Upload signature to Rekor transparency log | `true` | -| `fulcio-server-url` | Fulcio server URL | `https://fulcio.sigstore.dev` | -| `rekor-server-url` | Rekor server URL | `https://rekor.sigstore.dev` | -| `timestamp-server-url` | RFC3161 timestamp server URL | — | -| `allow-submit-data-to-public-sigstore` | Required when using public Sigstore | `false` | +| `tlog-upload` | **Keyless only.** Upload signature to Rekor transparency log | `true` | +| `include-timestamp` | Request an RFC 3161 timestamp and embed it in the signature. Applies to `keyless` and `sign-key` signing | `false` | +| `fulcio-server-url` | **Keyless only.** Fulcio server URL | `https://fulcio.sigstore.dev` | +| `rekor-server-url` | **Keyless only.** Rekor server URL | `https://rekor.sigstore.dev` | +| `timestamp-server-url` | RFC 3161 timestamp server URL: a Sigstore timestamp authority or a standard RFC 3161 service. With `sign-key`, forwarded only when `include-timestamp: true` | — | +| `allow-submit-data-to-public-sigstore` | **Keyless only.** Required when using public Sigstore | `false` | | `provenance-output` | Path for unsigned provenance | `provenance.intoto.jsonl` | | `signed-provenance-output` | Path for signed provenance | `provenance.intoto.jsonl.sig` | | `report-job-summary` | Render provenance in the workflow job summary | `true` | diff --git a/attest/action.yml b/attest/action.yml index 098c4e6..387fe0a 100644 --- a/attest/action.yml +++ b/attest/action.yml @@ -48,26 +48,26 @@ inputs: required: false default: 'false' tlog-upload: - description: Allow the creation of a Rekor transparency log (TLog) entry. + description: 'Keyless signing only: allow the creation of a Rekor transparency log (TLog) entry. Ignored unless keyless is true.' required: false default: 'true' include-timestamp: - description: Allow timestamping of the artifact signature against a timestamping authority. + description: 'Request an RFC 3161 timestamp of the artifact signature from a timestamping authority. Applies to keyless and sign-key signing.' required: false default: 'false' fulcio-server-url: - description: Fulcio server URL + description: 'Keyless signing only: Fulcio server URL' required: false default: 'https://fulcio.sigstore.dev' rekor-server-url: - description: Rekor server URL + description: 'Keyless signing only: Rekor server URL' required: false default: 'https://rekor.sigstore.dev' timestamp-server-url: - description: Timestamp server URL + description: 'RFC 3161 timestamp server URL: a Sigstore timestamp authority or a standard RFC 3161 service. With sign-key, forwarded only when include-timestamp is true.' required: false allow-submit-data-to-public-sigstore: - description: Agree to submit data to an immutable public transparency log (Needed for public Sigstore) + description: 'Keyless signing only: agree to submit data to an immutable public transparency log (needed for public Sigstore). Ignored unless keyless is true.' required: false default: 'false' provenance-output: diff --git a/attest/dist/index.js b/attest/dist/index.js index 261c50d..0769217 100644 --- a/attest/dist/index.js +++ b/attest/dist/index.js @@ -127819,6 +127819,17 @@ async function run(config) { args.push(`--rekor-server-url=${config.attest.rekorServerUrl}`); } + if (config.attest.timestampServerUrl !== '') { + args.push( + `--timestamp-server-url=${config.attest.timestampServerUrl}` + ); + } + } else if (config.attest.signKey !== '' && config.attest.includeTimestamp) { + // Key-based signing only timestamps on an explicit request, so the + // inputs are forwarded only when include-timestamp is true. Older + // cimon releases accept and ignore them. + args.push('--include-timestamp=true'); + if (config.attest.timestampServerUrl !== '') { args.push( `--timestamp-server-url=${config.attest.timestampServerUrl}` diff --git a/attest/index.js b/attest/index.js index 3935ace..a98d0df 100644 --- a/attest/index.js +++ b/attest/index.js @@ -259,6 +259,17 @@ async function run(config) { args.push(`--rekor-server-url=${config.attest.rekorServerUrl}`); } + if (config.attest.timestampServerUrl !== '') { + args.push( + `--timestamp-server-url=${config.attest.timestampServerUrl}` + ); + } + } else if (config.attest.signKey !== '' && config.attest.includeTimestamp) { + // Key-based signing only timestamps on an explicit request, so the + // inputs are forwarded only when include-timestamp is true. Older + // cimon releases accept and ignore them. + args.push('--include-timestamp=true'); + if (config.attest.timestampServerUrl !== '') { args.push( `--timestamp-server-url=${config.attest.timestampServerUrl}`