feat(config)!: require the encryption block (S04-A required encryption block plan: 12/16)
Summary
- Problem: a server with no
encryptionblock boots today. It fails later, the first time it stores or reads an upstream credential. - Impact: operators. A config without the block now fails at startup, for the server and for the
re-encryptandretire-key-versioncommands. The error ends withvalidation error: encryption: value is required. Clients see no change. - Change:
config.protomarksConfig.encryptionrequired, soconfig.Loadrejects the config before any secret read or database access.config.example.yamlcarries the block. The configuration reference, the key-rotation runbook, the self-managed install guide, the column-encryption guide and the run recipe now say the block is required, and quote the new error. - Downsides: this is a breaking change. A deployment without the block must add
encryption: {local: {}}and a root key before it upgrades. Thefeat(config)!commit carries aBREAKING CHANGE:footer, so this MR merges with squash off. Two arms that handled a missing block stay until Step 13 removes them: the skip arm inwireEncryptionand the operator guard. No loaded config reaches either one.
This is Step 12 of the S04-A required encryption block plan. Steps 4, 6 and 11, which it depends on, have merged.
Before merge
The plan's Dependencies make these a merge gate. They are not recorded yet.
- Staging
ar-confighas theencryptionblock: its current value, read in Vault or in the materialized Secret, and theencryption tier wiredboot line with itsroot_key_uri. - Production
ar-config: the same two readings. - Before promoting the release with this change to production, read the production value again. A boot line shows only what one pod read when it booted.
Plan and spec amendments
The docs(plans): correct the S04-A encryption block plan's Step 12 commit corrects Step 12's text:
reencrypt.goneeds no change.go.modpins urfave/cli v3.14.0, whosecli.Exiterror has anUnwrap, soErrorAsreaches the violation and the exit code stays 1. The plan said v3.13.0 and a change to the non-ExitCoder arm.- The two server boot tests become one,
TestWireEncryption_NoEncryptionBlockRefusesBoot.assembleApploads the config before it applies any boot override, so a wired database client cannot change the outcome. docs/testing/e2e/npm.mdleaves Step 12's file list.e2e.npm.remote.credential-never-servedasserts reads the upstream refuses, not a deployment without the block.
No spec change.
Checklist
- Ran it:
driver.sh smokeon an isolated rig: 103 passed, 0 failed. The boot loggedencryption tier wired.- OCI conformance locally against MinIO, with
AR_DELIVERY_MODE=DELIVERY_MODE_PROXYasdocs/dev/conformance.mdsays for MinIO: 75 of 80 specs ran, 75 passed, 0 failed, 5 skipped. The harness writes the block and a key, and AR booted under the rule. - The server and
retire-key-versionagainstinternal/config/testdata/missing_encryption.yaml: both exit 1 with an error ending invalidation error: encryption: value is required. - npm and Maven conformance run in this MR's pipeline.
gitlab-org/gitlab-caproniat3f15f618still has the block invalues/artifact-registry.yamlandvalues/artifact-registry-iam.yaml, and mountsar-encryption-root-key.
- Interfaces and data: configuration only:
encryptionis now required. The S04-A spec already rules this (its Configuration section, the acceptance criterion and the Error Cases row). No API, schema, wire or storage change. No page underdocs/user/mentions encryption or a root key, so no user doc changes. - Failure: the process exits 1 at config load, before any secret read or database access, with an error naming
encryption. A pod without the block crash-loops at boot instead of failing credential operations later. - Rollout: an image rollback is safe, because the previous release boots a config with the block. From this release on,
ar-configmust keep the block: a pod that restarts without it refuses to boot. See Before merge. - Hot path: none. The check runs once, at config load.
- Database: n/a.
- Security: fails closed. No deployment can run without the encryption stack. No new input, route or permission.
- ADRs:
./scripts/adr-freshness.shexits 0 (the mirror is current). ADR-007 defines the encryption key tables and says nothing on whether the block is optional. ADR-024 covers only in-transit TLS. No conflict. The two internal ADRs do not touch encryption, as the plan's research recorded. - E2E: no row changes. A boot refusal has no client-side scenario, and no row under
docs/testing/e2e/mentions encryption. - Simplicity: a check in
wireEncryptionalone would leave two rules, one for the server and one for the operator commands. The proto annotation is one rule for all three.
The run-recipe change is one Troubleshooting row and one word in its prerequisites. No recipe step or driver behavior changed, so there is no /skill-creator benchmark.
Reviewable size is 305 lines (generated config.pb.go excluded).
Open MRs !2969 (merged) and !2970 (merged) (S34 Step 5) overlap the proto, config_test.go, the example and the reference. Both already conflict with main. Whichever lands second rebases and regenerates config.pb.go, as the plan's Rebasing over S34 rule says.
Related to https://gitlab.com/gitlab-org/ops/artifact-registry/-/work_items/1451