Skip to content

Preserve peer certificate chains for egress authentication - #1758

Draft
Adhita Selvaraj (swiftdiaries) wants to merge 3 commits into
agent-substrate:mainfrom
swiftdiaries:fix/egress-certificate-metadata
Draft

Adhita Selvaraj (swiftdiaries) wants to merge 3 commits into
agent-substrate:mainfrom
swiftdiaries:fix/egress-certificate-metadata

Conversation

@swiftdiaries

Copy link
Copy Markdown
Contributor

Context

Addresses the egress certificate authentication issue in #1740.

Changes

Pass the peer certificate chain through private Envoy metadata and use it for actor authentication, preserving fail-closed verification.

Validation

make verify passed locally. VM non-root unit-race and apitool-race, root-race, and Envoy E2E on gVisor and microVM passed, including auth, leaf-only mutation/restoration, and MITM. AgentGateway E2E remains unverified because NFS teardown blocked cluster setup.

// on the request into a verified ActorIdentity, or an error describing why it
// cannot be trusted.
func (h *Handler) authenticateActorCertificate(md *extproc.RequestMetadata) (*substratex509.ActorIdentity, error) {
if peer, present := md.DynamicMetadata[envoyClientCertificateMetadataNamespace]; present {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Please review this trust boundary together with the metadata propagation changes in this commit: when Envoy supplies this namespace, its chain should remain authoritative, and malformed or incomplete metadata must fail closed rather than fall back to the AgentGateway leaf-only attribute. In particular, verify the full chain survives the Envoy FilterMetadata → ext_proc → authenticateActorCertificate path.

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.

1 participant