mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 16:59:22 +02:00
config: support client certificate SAN match (#4453)
Add a new match_subject_alt_names option to the downstream_mtls settings group. This setting can be used to further constrain the allowed client certificates by requiring that certificates contain a Subject Alternative Name of a particular type, matching a particular regex. When set, populate the corresponding match_typed_subject_alt_names setting within Envoy, and also implement a corresponding check in the authorize service.
This commit is contained in:
parent
cc1ef1ae18
commit
5568606f03
10 changed files with 638 additions and 52 deletions
|
@ -120,8 +120,10 @@ func newPolicyEvaluator(opts *config.Options, store *store.Store) (*evaluator.Ev
|
|||
addDefaultClientCertificateRule :=
|
||||
opts.DownstreamMTLS.GetEnforcement() != config.MTLSEnforcementPolicy
|
||||
|
||||
clientCertConstraints := evaluator.ClientCertConstraints{
|
||||
MaxVerifyDepth: opts.DownstreamMTLS.GetMaxVerifyDepth(),
|
||||
clientCertConstraints, err := evaluator.ClientCertConstraintsFromConfig(&opts.DownstreamMTLS)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(
|
||||
"authorize: internal error: couldn't build client cert constraints: %w", err)
|
||||
}
|
||||
|
||||
return evaluator.New(ctx, store,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue