envoyproxy / envoyproxy/envoy

Docs: Clarify format of Subject field in X-Forwarded-Client-Cert header

Open
#9,889 3 comments 0 reactions 0 assignees View on GitHub
area/docs area/tls help wanted
Dominant language
C++
Stars
28.9k
Forks
5.6k
Avg merge
1d 20h
Merged PRs (30d)
428

Description

*Title*: *Clarify format of Subject field in X-Forwarded-Client-Cert header*

*Description*:
The [documentation for the X-Forwarded-Client-Cert header](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_conn_man/headers#config-http-conn-man-headers-x-forwarded-client-cert) says that the `Subject` field is the subject of the client certificate.

The Subject field in an X.509 certificate is binary ASN.1 DER formatted, so it is ambiguous as to which string syntax is used when converting to the header. The examples in the documentation use the format `Subject="/C=US/ST=CA/L=San Francisco/OU=Lyft/CN=Test Client"` which appears to be an old X.500 syntax.

The code appears to actually serialize into standard RFC 2253 format, in which case the examples should read something like `cn=Test Client,ou=Lyft,l=San Francisco,st=CA,c=US`.

However, even in that standard format there is an ambiguity on how Envoy serializes DN attributes that are unrecognized. Because the syntax of attributes depends on the schema, it can either attempt to format them as strings or else encode the DER bytes directly using the `#` syntax. There are client certs in the wild that use non-standard attributes in the subject DN, so it would be good to know how Envoy will serialize those so that I can have a fighting chance of matching them correctly on the backend.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.