You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to write OPA server authorization policy that uses the full certificate in the authorization decision. Currently, the only information available is the subject of the certificate, not the other data, such as SANs for example. It's now common to use SANs to encode identity information (SPIFFE/Istio, etc).
The code below shows a certificate with a SAN URI which is not shown in the Subject.ToRDNSequence().String() data we use today. (go playground link: https://go.dev/play/p/cY574CIc9y2)
We deprecate --authentication=tls with a warning and drop support in some far future version. We add a new mode, --authentication=x509 or --authentication=client-certificate. With this new option, input.identity would be bound to the JSON representation of the client certificate, e.g.:
d, _:=json.MarshalIndent(cert, "", " ")
This is what the Rego built-in crypto.x509.parse_certificates uses (ref).
Describe a "Good Enough" solution
A new client_certificate key is added to the authz input which contains the certificate data. We leave identity unchanged for backwards compatibility.
Additional Context
This is only useful for users who terminate TLS as OPA instances. Otherwise, forwarded headers containing the client certificate would be more suitable.
The text was updated successfully, but these errors were encountered:
What is the underlying problem you're trying to solve?
OPA has a functionality which allows some details about the client certificate to be used in authorization policy. (https://github.com/open-policy-agent/opa/blame/ac64e78c6979ce9cba161d94e69b62d477f74f3b/server/identifier/tls.go#L26)
The information currently available is in the Distinguished Names Syntax, e.g.
I would like to be able to write OPA server authorization policy that uses the full certificate in the authorization decision. Currently, the only information available is the subject of the certificate, not the other data, such as SANs for example. It's now common to use SANs to encode identity information (SPIFFE/Istio, etc).
The code below shows a certificate with a SAN URI which is not shown in the
Subject.ToRDNSequence().String()
data we use today. (go playground link: https://go.dev/play/p/cY574CIc9y2)Describe the ideal solution
We deprecate
--authentication=tls
with a warning and drop support in some far future version. We add a new mode,--authentication=x509
or--authentication=client-certificate
. With this new option, input.identity would be bound to the JSON representation of the client certificate, e.g.:This is what the Rego built-in
crypto.x509.parse_certificates
uses (ref).Describe a "Good Enough" solution
A new
client_certificate
key is added to the authz input which contains the certificate data. We leaveidentity
unchanged for backwards compatibility.Additional Context
This is only useful for users who terminate TLS as OPA instances. Otherwise, forwarded headers containing the client certificate would be more suitable.
The text was updated successfully, but these errors were encountered: