Repository navigation
examples: sign egress requests with Web Bot Auth over ext_proc - #995
Merged
Merged
Conversation
Add a small Envoy external processor that signs each request an egress node forwards with Web Bot Auth (RFC 9421, draft-ietf-webbotauth-httpsig-protocol), and a guide showing it as an ext_proc inspector next to an oidc_federation broker. The signature identifies the operator's agents, so it stays out of the broker slot and needs no core change. The signer uses the standard library for Ed25519 and the Envoy and gRPC packages already in go.mod. Its tests reproduce the draft's Ed25519 test vector and drive the processor through internal/envoy's callout client. run.sh boots agentmesh-one, an egress node, the signer and a demo site (STS plus a shop that only admits signed bots) on loopback. Refs google#990
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive example demonstrating Web Bot Auth signing at the egress node using an Envoy external processor. It includes a README, a demo site, a signer implementation, and integration scripts to run the setup on loopback. The feedback suggests simplifying the shell pipeline in run.sh used to extract the key ID from the directory JSON into a single, more robust Python command.
hack/verify-secrets.sh refuses committed private key blocks. The draft vector needs RFC 9421's published test-key-ed25519, so build it from the JWK seed with ed25519.NewKeyFromSeed instead of a PEM constant. Also read the keyid in run.sh with one json.load, as suggested in review.
Collaborator
|
Thanks, just FYI I'm working with a more native support in #998 but having an ext_proc example is really good when operators want to keep the infra decoupled of the mesh |
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.
As discussed in #990: a short guide and a small example processor under
development/examples/web-bot-auth, showing Web Bot Auth signing as an egressext_procinspector next to anoidc_federationbroker. No core changes.What's in it
signer/: an Envoy external processor that addsSignature-Agent,Signature-InputandSignatureon request headers, covering("@authority" "signature-agent";key="sig1")withcreated,expires,keyid(JWK thumbprint),nonceandtag="web-bot-auth". Ed25519 from the standard library; gRPC and go-control-plane are already ingo.mod, sogo.modis unchanged. It fails closed with a 502 if it cannot sign, replaces any signature headers the caller sent, and never logs the key, only its file name and keyid.-generate-keyand-directorycover key setup and the JWKS to publish at theSignature-AgentURL.README.md: the guide. Why it is an inspector rather than a broker, the policy, and what to know::authorityis the destination name (sopreserve_hostwhentarget_urlgoes elsewhere), protected headers,failure_mode_allow, short validity, key rotation.run.sh: bootsagentmesh-one, one egress node, the signer, anddemo-site(a fake RFC 8693 STS plus a shop that only admits signed bots) on loopback.Testing
go test -race ./development/examples/web-bot-auth/...: 8 tests, including the Ed25519 test vector from the draft reproduced byte for byte, and two that drive the processor throughinternal/envoy'sCalloutClientthe way the egress node does../run.shon macOS, all checks pass:Authorizationtoken alongside itSignature-Agentis replacedweb-bot-authnpm package). It verifies, and fails when the authority changes.Most of the diff is tests and the demo; the signer itself is about 470 lines. Happy to trim the demo or move the guide under
site/content/docs/guidesif you'd prefer.Fixes #990