Skip to content

examples: sign egress requests with Web Bot Auth over ext_proc - #995

Merged
aojea merged 2 commits into
google:mainfrom
frostyhand:examples/web-bot-auth-ext-proc
Dec 1, 2026
Merged

aojea merged 2 commits into
google:mainfrom
frostyhand:examples/web-bot-auth-ext-proc

Conversation

@frostyhand

@frostyhand frostyhand commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

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 egress ext_proc inspector next to an oidc_federation broker. No core changes.

What's in it

  • signer/: an Envoy external processor that adds Signature-Agent, Signature-Input and Signature on request headers, covering ("@authority" "signature-agent";key="sig1") with created, expires, keyid (JWK thumbprint), nonce and tag="web-bot-auth". Ed25519 from the standard library; gRPC and go-control-plane are already in go.mod, so go.mod is 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-key and -directory cover key setup and the JWKS to publish at the Signature-Agent URL.
  • README.md: the guide. Why it is an inspector rather than a broker, the policy, and what to know: :authority is the destination name (so preserve_host when target_url goes elsewhere), protected headers, failure_mode_allow, short validity, key rotation.
  • run.sh: boots agentmesh-one, one egress node, the signer, and demo-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 through internal/envoy's CalloutClient the way the egress node does.
  • ./run.sh on macOS, all checks pass:
    • the shop verifies the signature and receives the federated Authorization token alongside it
    • a caller's own Signature-Agent is replaced
    • an unsigned request straight to the shop gets 403
    • with the signer stopped, the node fails the request with 502
  • I also checked the signer's output against Cloudflare's reference verifier (web-bot-auth npm package). It verifies, and fails when the authority changes.
  • golangci-lint v2.14.0 on the new packages: 0 issues.

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/guides if you'd prefer.

Fixes #990

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
@frostyhand
frostyhand requested a review from aojea as a code owner November 30, 2026 18:04

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@aojea

aojea commented Dec 1, 2026

Copy link
Copy Markdown
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

@aojea
aojea merged commit d106b16 into google:main Dec 1, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Web Bot Auth broker, so egress nodes sign agent requests to websites

2 participants