chore(conformance): carry the encryption block and a fresh root key (S04-A required encryption block plan: 2/16)
Summary
The three conformance harnesses now boot AR with the encryption block and a
root key:
run.sh(both OCI jobs),npm-e2e.shandmaven_setup.shaddencryption: local: {}to the AR config they write.- Each one writes a fresh key to
encryption/root-keyin its LabKit secrets directory on every run. The file has mode0600, like the Postgres secret files next to it. - The key is one line of base64 from 32 bytes of
/dev/urandom. That works in the Maven runner image, which has noopenssl. docs/dev/conformance.mdgets an "Encryption root key" section, and the Maven steps list mentions the key.
A block is optional today, so this changes nothing for the suites. Step 12 makes the block required, and then a harness without it would fail to boot.
A fresh key per run is safe. The suites store no upstream credentials, so no namespace key is ever created, and nothing needs a key from an earlier run.
This is Step 2 of the S04-A required encryption block plan. It also fills the plan's Status row 2.
Governing ADRs
- ADR-007,
## Encryption keys: the root key wraps namespace keys. A new root key per run strands no rows, because the suites never write a credential. - ADR-024: the key reaches AR as the LabKit secret
encryption/root-key, the same path production reads.
./scripts/adr-freshness.sh says the local mirror is current. The other
mirrored ADRs the plan and spec cite do not cover rig config or root keys.
The two internal ADRs were read at the source, and neither covers this
change.
Testing
The four conformance jobs in this MR's pipeline are the check:
conformance:oci:s3-garage, conformance:oci:gcs-key-creds,
conformance:npm:s3-garage and conformance:maven:s3-garage. Each one
triggers on a change to its own harness script, so all four run here.
A green run proves the key arrived. With the block present, AR fails to boot
when the key file is missing (wire_encryption.go, LabKit's ErrNotFound)
or empty (crypto.DecodeKeys, ErrNoKeysFound). Each harness fails when AR
does not become ready.
shellcheck, shfmt and Vale pass. Vale reports no new warning in
conformance.md.
No Go code, config schema or service boot path changes. So the configuration
reference, the run recipe, the e2e catalogs and docs/user/ are not
affected.
Size
86 reviewable LOC (added plus removed) against main
(947d158009..f0e01c5534): 61 in the three scripts, 23 in
conformance.md, and 2 in the plan.
Overlaps
No merge order is needed. Three open MRs edit the same files:
- !3320 (merged) (Step 5) fills row 5. It merges clean with this branch.
- !3226 (closed) (draft) edits
maven_setup.shandnpm-e2e.sh, and !2944 (closed) editsrun.sh. Their hunks are apart from this MR's. Both conflict withmainelsewhere, but none of those conflicts is in a file this MR edits.
Step 4 opens only after this MR merges.
Closes https://gitlab.com/gitlab-org/ops/artifact-registry/-/work_items/1478