Hello Google Cloud Security / IAM community,
We are troubleshooting Google Cloud X.509 Workload Identity Federation using an existing CA-issued P-256 client-authentication certificate with one hierarchical SPIFFE URI SAN. Google STS consistently rejects the token exchange with:
HTTP 400
unauthorized_client
The given credential is rejected by the attribute condition.
The provider is ACTIVE, with:
- Subject mapping: google.subject=assertion.subject.dn.cn
- A strict attribute condition of this representative form (not our actual production identifiers):
assertion.san.uri == "spiffe://example.invalid/key-manager/witness-verifier" &&
assertion.sha256Fingerprint == "<standard RFC 4648 padded Base64 SHA-256 of the leaf certificate DER>"
Both independent client methods produce the same rejection:
1. Cloud SDK 593.0.0 with a correctly stored external_account certificate configuration.
2. A separate documented mTLS POST to https://sts.mtls.googleapis.com/v1/token, presenting the same client certificate and a JSON-array subject_token containing its Base64-encoded public DER certificate.
Checks already completed:
- The Cloud provider readback has exactly one configured trusted CA, no intermediates, and that CA's public DER matches our local trust anchor byte-for-byte.
- The client certificate is current and has the expected issuer, P-256 public key, digital-signature usage, clientAuth EKU, CN, and exactly one hierarchical SPIFFE URI SAN.
- The configured attribute condition contains the locally computed standard padded Base64 SHA-256 hash of the leaf DER; URI SAN and fingerprint conditions both match the locally inspected certificate.
- Provider subject mapping and condition were read back verbatim; the Cloud SDK stored external-account configuration matches the intended certificate paths, provider audience, and mTLS endpoint.
- No STS access token has been issued; none of the tests changed IAM or disabled any provider restrictions.
Could someone with Google Cloud X.509 WIF expertise help establish:
1. Are hierarchical SPIFFE URI SANs (spiffe://authority/path) guaranteed to appear unchanged in assertion.san.uri? Is this attribute the first URI SAN exactly as encoded?
2. Does assertion.sha256Fingerprint always use standard padded Base64 of SHA-256 over the complete leaf certificate DER, as in the published documentation?
3. Is there a supported, read-only way to determine the assertion values Google evaluated, or which clause of a strict compound attribute condition returned false, without changing the provider?
4. Does this specific attribute-condition rejection prove that X.509 trust-chain verification and mTLS certificate-to-subject-token binding succeeded, or is that processing order undocumented?
5. Are there known preview-stage limitations or current issues affecting these attributes for client-certificate federation?
We want to preserve the existing strict certificate and fingerprint restrictions; we do not want to remove the condition, create a replacement CA, rotate working keys, or grant broader access merely to make a test pass.
Relevant Google documentation:
https://docs.cloud.google.com/iam/docs/workload-identity-federation-with-x509-certificates
Thank you.
PUBLIC POST SECURITY NOTES (do not include these notes when posting):
- No real project ID, WW.CX internal hostnames, owner identities, public certificate, exact fingerprint, private key, IAM service-account address, or tokens included.
- Copy only the text under BODY into the forum's message field; copy TITLE into the title field.
- The related community question at https://security.googlecloudcommunity.com/cloud-security-foundation-7/x-509-workload-identity-federation-sts-rejects-valid-certificate-with-attribute-condition-rejected-8558 concerns an authority-less URN SAN and a different subject mapping. Do not claim it is the same configuration.
- Do not weaken provider conditions to troubleshoot.
