Message Attestation: example with out-of-process policy server#3
Draft
liustanley wants to merge 3 commits into
Draft
Message Attestation: example with out-of-process policy server#3liustanley wants to merge 3 commits into
liustanley wants to merge 3 commits into
Conversation
Demonstrates the recommended production deployment pattern from supplementary-guidelines.md: the OpAMP distribution server holds no private key material. Signing is delegated to a separate policy server that can inspect the payload, enforce organisational policies, and delegate to an HSM before returning a signature. policysrv: standalone HTTP signing service exposing /v1/sign, /v1/chain, /v1/ca. Run it alongside the example server to see the full attestation flow end-to-end. Example server: --policy-server flag wires a RemoteSigner so the OpAMP server signs every outbound ServerToAgent through the policy server. Example agent: --attestation-ca configures a pre-provisioned trust anchor; --attestation-tofu-store enables TOFU enrollment for environments where out-of-band CA provisioning is impractical.
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.
Overview
Extends the
internal/examples/agent and server to demonstrate Message Attestation end-to-end, following the isolated-signing architecture described insupplementary-guidelines.md.Depends on: #2 (
message-attestation-prototype)What's included
internal/examples/policysrv/— new standalone HTTP signing service (the "policy server")internal/examples/server/—--policy-serverflag wires aRemoteSignerintoSettings.PayloadSignerinternal/examples/agent/—--attestation-caand--attestation-tofu-storeflagsArchitecture
The OpAMP server holds no private key material. Every outbound
ServerToAgentis forwarded to the policy server for signing. The policy server can inspect the payload, enforce organisational policies, and delegate to an HSM before returning a signature.Running the example
The examples live in their own Go module, so run all commands from the
internal/examplesdirectory (each in its own terminal):cd internal/examples1. Start the policy server
The policy server generates a fresh ephemeral CA on every start and writes it to
/tmp/opamp-policy-ca.pem— the agent loads this as its payload trust anchor.2. Start the OpAMP server
go run ./server/ \ --policy-server http://localhost:4322 # Server signs every outbound ServerToAgent via the policy server3. Start the agent
Option A — pre-provisioned CA (recommended for production):
go run ./agent/ \ --attestation-ca /tmp/opamp-policy-ca.pemOption B — TOFU enrollment (first connection accepts and pins the CA):
go run ./agent/ \ --attestation-tofu-store /tmp/my-trust-anchor.pem # On first run: enrolls and saves the CA to the file. # On subsequent runs: uses the saved CA as a pre-configured trust anchor.--attestation-caand--attestation-tofu-storeare mutually exclusive.What to observe
Message Attestation enabledon startup.Key files
internal/examples/policysrv/main.go/v1/sign,/v1/chain,/v1/cainternal/examples/server/main.go--policy-serverflaginternal/examples/server/opampsrv/opampsrv.gosigning.NewRemoteSignerintoSettings.PayloadSignerinternal/examples/agent/main.go--attestation-ca/--attestation-tofu-storeflagsinternal/examples/agent/agent/agent.goPayloadVerifier/PayloadTOFUStoreintoStartSettings