Skip to content

Commit 144a2b8

Browse files
committed
feature: mtlsSAN() filter
feature: mtlsIssuerDN() filter feature: mtlsCN() filter feature: mtlsAuthn() filter doc: document mtls authnz filters Signed-off-by: Sandor Szücs <sandor.szuecs@zalando.de>
1 parent 13a38aa commit 144a2b8

7 files changed

Lines changed: 2143 additions & 0 deletions

File tree

docs/reference/filters.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,65 @@ Example:
550550
* -> tlsPassClientCertificates() -> "http://10.2.5.21:8080";
551551
```
552552

553+
### mtlsAuthn
554+
555+
This filter validates the client certificate provided by verifying
556+
with the configured system CA certificates.
557+
558+
Example:
559+
560+
```
561+
* -> mtlsAuthn() -> "http://10.2.5.21:8080";
562+
```
563+
564+
### mtlsIssuerDN
565+
566+
This authz filter checks the DN value of the provided certificate. You have
567+
to use `mtlsAuthn()` to verify validity.
568+
569+
Parameters:
570+
571+
* DN (string)
572+
573+
Example:
574+
575+
```
576+
* -> mtlsAuthn() -> mtlsIssuerDN("CN=My CA,O=My Org,C=DE") -> "http://10.2.5.21:8080";
577+
```
578+
579+
### mtlsCN
580+
581+
This authz filter checks the CN value of the provided certificate. You have
582+
to use `mtlsAuthn()` to verify validity.
583+
584+
Parameters:
585+
586+
* CN (string)
587+
588+
Example:
589+
590+
```
591+
* -> mtlsAuthn() -> mtlsCN("My CA") -> "http://10.2.5.21:8080";
592+
```
593+
594+
### mtlsSAN
595+
596+
This authz filter checks the SAN value of the provided certificate. You have
597+
to use `mtlsAuthn()` to verify validity.
598+
599+
Parameters are one or more:
600+
601+
* DNS hostnames (string)
602+
* CIDR (string)
603+
* IPv4 (string)
604+
* IPv6 (string)
605+
606+
Example:
607+
608+
```
609+
* -> mtlsAuthn() -> mtlsSAN("my.host.example", "2a05:aec0::/29", "10.0.5.0/15", "1.2.3.4") -> "http://10.2.5.21:8080";
610+
```
611+
553612
## Diagnostics
554613

555614
These filters are meant for diagnostic or load testing purposes.

filters/builtin/builtin.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ func Filters() []filters.Spec {
243243
consistenthash.NewConsistentHashKey(),
244244
consistenthash.NewConsistentHashBalanceFactor(),
245245
tls.New(),
246+
tls.NewMtlsAuthn(),
247+
tls.NewMtlsCN(),
248+
tls.NewMtlsIssuerDN(),
249+
tls.NewMtlsSAN(),
246250
}
247251
}
248252

filters/filters.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ const (
377377
OpaServeResponseName = "opaServeResponse"
378378
OpaServeResponseWithReqBodyName = "opaServeResponseWithReqBody"
379379
TLSName = "tlsPassClientCertificates"
380+
MtlsIssuerDN = "mtlsIssuerDN"
381+
MtlsSAN = "mtlsSAN"
382+
MtlsCN = "mtlsCN"
383+
MtlsAuthn = "mtlsAuthn"
380384
AWSSigV4Name = "awsSigv4"
381385
LoopbackIfStatus = "loopbackIfStatus"
382386
CacheName = "cache"

0 commit comments

Comments
 (0)