First stable release. Notes: docs/release/RELEASE_NOTES_v1.0.0.md Lab record: docs/release/LIVE_RESULTS_v1.0.0.md
3.5 KiB
W26-24 - code-signing lifecycle on SoftHSM2 with osslsigncode
Proves the code-signing flow against a REAL SoftHSM2 token: hub-generated key in
the token (POST /api/v1/codesign/requests, W26-22), second-user approval,
issuance, an osslsigncode signature with the HSM-held key that verifies, no key
export (CKA_EXTRACTABLE=false), and the inventory policy-check flagging a
deliberately non-compliant certificate.
Run
bash tests/live/codesign/run.sh
SoftHSM2, pkcs11-tool and osslsigncode are not on most hosts, so the script
builds Dockerfile (Debian bookworm with softhsm2, opensc, osslsigncode,
libengine-pkcs11-openssl, Go with cgo) using podman and re-runs itself inside it,
repo mounted read-only at /src, hub built with -tags pkcs11 in the container.
The podman machine is shared with CI: run serially.
| Env | Default | Meaning |
|---|---|---|
HUB_PORT |
8226 |
hub port inside the container |
KEEP_IMAGE |
0 |
1 keeps localhost/kk-codesign-uat:latest |
KK_CODESIGN_NATIVE |
0 |
1 runs on the host (needs softhsm2-util, pkcs11-tool, osslsigncode, openssl, python3, go with cgo, gcc) |
KK_CODESIGN_GOMODCACHE |
unset | host Go module cache dir to mount (faster build) |
Exit codes: 0 all passed; 1 a step failed; 77 SKIP (a tool or podman is
missing); 78 no FAIL but a step is BLOCKED (tooling, e.g. osslsigncode has
neither -pkcs11engine nor a usable provider path), which is never a pass.
Prints MEASURE key=value lines for the results doc.
Self-cleaning: private SOFTHSM2_CONF per run (never ~/.config/softhsm2), token
selected by label, all state in mktemp -d, removed by a trap; the container is
--rm and the image is removed unless KEEP_IMAGE=1. The PIN is the throwaway
constant 1234. Nothing is committed: no key, token dir or signed output.
What each step proves
- SoftHSM2 token + hub
-tags pkcs11withKRYPTKEEPER_KEY_BACKEND=pkcs11,KRYPTKEEPER_CODESIGN_PROTECTED=true, bootstrap root in the token, identities alice and bob (bothpki-admin) fromAPP_API_KEYS_JSON. - Template
uat-codesign(EKUcodeSigning,require_approval:false): approval is gated by the EKU alone. - Request as alice: 202 with
approval_id/key_id; inventory has 0 certs. - alice approving her own request: 403; bob approves: 201 with the fingerprint.
pkcs11-toollists a private key object labelled with thekey_id.osslsigncode sign(engine or provider, chosen from--help) a PowerShell script withpkcs11:object=<key_id>;osslsigncode verify -CAfile chain.pemok.- Export fails: object is "never extractable";
pkcs11-tool --read-objectyields no bytes;POST /api/v1/keys/<id>/exportgoes through dual control (propose, bob approves, alice redeems) and the store then refuses: 4xx/5xx, no PEM. - Import an RSA-2048 code-signing cert;
policy-check(min_rsa_key_size_bits3072,max_validity_days398) reports it and not the HSM cert; audit holdscodesign.policy.checkandcodesign.request.deny(request against a serverAuth-only template -> 422). Also: a requester CSR without attestation is refused 422attestation_missingin protected mode (FR-P92 fail-closed).
Attestation: PENDING
FR-P92 requires a YubiKey PIV attestation for requester-supplied CSRs and no vendor root is shipped yet, so the success path needs a real YubiKey and the Yubico root. This run uses the hub-generated-key path; only the refusal is asserted.
Findings
See docs/release/LIVE_RESULTS_FG2_CODESIGN_v0.14.md (filled from a real run).