✨ A2A AgentCard Signature Verification - #176
Conversation
5247d47 to
5814365
Compare
5814365 to
1fa6bc9
Compare
1fa6bc9 to
a20218b
Compare
16bd275 to
bf01726
Compare
usize
left a comment
There was a problem hiding this comment.
Approved but with a few big caveats.
The new signature verification is excellent. It follows the spec, and we can embed a spiffe_id into it which we can compare to the allowList.
There is a big gap remaining here, which is that we aren't really binding workload identity to the signature fully.
That's because we can still sign our JWT in a valid way with a fake spiffeId in it. e.g. this test fails: 13d663d
In earlier versions of this, you'd been deriving the spiffe id, which would have helped here. But I asked you to remove it because... there's a better way we can work toward.
In a follow up patch, what we should do is replace the SecretProvider here, with a SPIFFE trust bundle.
We can do that at startup time here in Kagenti.
Then, token verification automatically gives us the strong binding we're seeking. Does it make sense?
In the interim, before we land this, can we emit a warning that looks like this:
"Identity binding is allowlist-only; SPIFFE trust bundle verification not yet available"
And leave a comment in the controller?
Then we can close this loop in the followup.
Thanks for working so hard on this.
Integrated on top of upstream/main (identity-binding, workload-based architecture). New features: - Signature verification with Secret and JWKS providers - Canonical JSON hashing (struct-to-map approach, future-proof) - ECDSA (P-256/384/521) + RSA support for both Secret and JWKS - Audit mode for gradual rollout - Prometheus metrics for verification outcomes - NetworkPolicy enforcement based on signature status - SignatureIdentityMatch: combined signature + identity binding check - Helm values for signature verification configuration Architecture alignment: - Signature verification works with targetRef (duck-typed workloads) - NetworkPolicy controller adapted to Deployment/StatefulSet architecture - All new status fields added to AgentCardStatus - Updated RBAC for secrets and networkpolicies - Updated CRDs and deepcopy generated Signed-off-by: Kevin Cogan <kevin.s.cogan@gmail.com>
bf01726 to
6539184
Compare
|
Makes complete sense, I've pushed the following changes:
For the follow up, I've opened #179 to track the SPIRE init-container + trust bundle verification work, init container signs with the workload's SVID, operator verifies against the SPIRE trust bundle via the existing |
Summary
Adds cryptographic signature verification for A2A AgentCards. This enables operators to ensure that AgentCard data has not been tampered.
New Features
Signature verification with two provider backends:
Canonical JSON hashing: using a struct-to-map approach that strips the
signaturefield and empty values before signing, future-proof against field additionsAlgorithm support: RSA (PKCS1v15 / SHA-256) and ECDSA (P-256, P-384, P-521) for both Secret and JWKS providers
Audit mode: for gradual rollout, logs verification failures as warnings but allows cards to sync
Prometheus metrics: (
signature_verification_total,signature_verification_duration_seconds,signature_verification_errors_total) for monitoring verification outcomesNetworkPolicy enforcement :
AgentCardNetworkPolicyReconcilercreates/removes NetworkPolicies based on signature verification statusSignatureIdentityMatch: combined check that both signature verification and identity binding pass, stored in
AgentCardStatusHelm values: for configuring signature verification (
signatureVerification.enabled,providerType,secretName,auditMode, etc.)Kubernetes Events: emitted for
SignatureEvaluated(Normal) andSignatureFailed(Warning), visible viakubectl describe agentcardArchitecture Alignment
targetRef(duck-typed workloads: Deployments, StatefulSets, Legacy Agent CRDs)spec.targetRef→status.targetRef→selectorfallbackAgentCardStatus:validSignature,signatureVerificationDetails,signatureKeyId,signatureIdentityMatchsecrets(get/list/watch) andnetworking.k8s.io/networkpoliciesCardSignaturestructRelated issue(s)
feature: Strict CardSignature Checking #161
Testing Instructions
Unit & Integration Tests
End-to-End Demo
Follow the step-by-step guide in
docs/a2a-signature-verification.mdwhich covers: