Repository navigation
feat(e2e): drive a real SCEP enrolment and the full image lifecycle - #213
Merged
Merged
Conversation
The live write-path run now enrols two real RFC 8894 SCEP devices through challenges minted by the manager, approves one and rejects the other through the manager, and checks both outcomes from the device and on the node. The device client uses github.com/smallstep/scep and its pkcs7 package: SCEP needs CMS envelopes and signed attributes, and writing those by hand would be far more code than the dependency. The image step runs the whole lifecycle: stage, activate and wait for the node to come back on the new image, roll back, activate again and wait for it to come back on the image it started on. Before, rollback was sent while the node was still rebooting. The escrow export can target a software-key node (E2E_ESCROW_NODE), since a TPM-held CA key is never exportable, and the import now runs after the enrolment step that links the spare, the only point at which the manager can address it. The SCEP steps run before the protocol toggle, whose switch-off drops the node's stored pki.scep block. E2E_MANAGER_LISTEN moves the throwaway manager off a port the host already uses, and E2E_RESULTS_FILE writes the step results as JSON for a harness to report each one. Refs #207 Refs #38 Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
Refs #207 Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
3 tasks done
The adapter catalog matches by name and a fresh manager's catalog is
empty, so SetAdapterEnabled("scep") always came back not found. The
protocol step now finds the SCEP adapter by its kind and says when the
catalog has none, and still proves the node's own SCEP switch.
Refs #38
Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
SetNodeProtocol switches ACME and EST only, so the step's SCEP toggle was refused every time. The step now toggles whichever of EST and ACME the primary node has on, on (already on) and then off, checking the node's stored switch each time, and skips when neither is on: switching one off drops its stored settings, and switching one on without them is refused by the node. Refs #38 Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
The live write-path run (
test/e2e/esxi) gets the two pieces #207 asks for, and the changes it needs to run against the QEMU suite's nodes on CI (#38):scepdevice.go, ongithub.com/smallstep/scepand itspkcs7package) enrols with a fresh RSA 3072 identity through a challenge minted by the manager. One enrolment is approved through the manager and the device collects its certificate with CertPoll; a second is rejected and the device gets FAILURE. Both are checked on the node: the approved serial is in the node's ownListIssued, and the rejected enrolment has left its queue. It needsE2E_SCEP_URLand arequire_approvalSCEP profile; without them it skips with the reason. I took the dependency because SCEP needs CMS envelopes and signed attributes, far more code to write by hand.E2E_ESCROW_NODE), because a TPM-held CA key is never exportable. The import now runs after the enrolment step that links the spare, the only point at which the manager can address it.SetNodeProtocolswitches ACME and EST only, so toggling SCEP was always refused. The step now toggles whichever of EST and ACME the node has on, and finds the catalog adapter by kind, since the catalog matches by name and starts empty on a fresh manager.E2E_MANAGER_LISTENmoves the throwaway manager off a port the host already uses, andE2E_RESULTS_FILEwrites the step results as JSON so a harness can report each one.The appliance PR that runs this in the QEMU suite will close both issues.
Refs #207
Refs #38
Verification
docs/e2e-esxi.md(what it proves, new settings, CI scope) and thee2e:esxitask descriptionHow this was verified
CI is the proof: Go CI runs fmt, vet, golangci-lint, build and the unit tests. The live run against real nodes is proven by the cryptos-appliance full-image suite once that PR pins this commit; its step table reports each step of this run.