Skip to content

Extract Common Name (CN) from the X-Forwarded-Tls-Client-Cert-Info Header of the PassTLSClientCert Middleware

License

Notifications You must be signed in to change notification settings

beyerleinf/traefik-plugin-extract-cn

Repository files navigation

Extract Common Name Traefik Plugin

This plugin can - when used in conjunction with the built-in PassTLSClientCert Middleware - extract the Common Name and put it into an HTTP Header with the defined name. This plugin requires you to enable the cert info on the PassTLSClientCert Middleware with at least the Common Name enabled.

Static

experimental:
  plugins:
    extractCommonName:
      modulename: "github.com/beyerleinf/traefik-plugin-extract-cn"
      version: "v1.0.1"

Dynamic

http:
  routes:
    my-router:
      rule: "Host(`localhost`)"
      service: "my-service"
      middlewares:
        - "passClientCert
        - "extractCommonName"
  services:
    my-service:
      loadBalancer:
        servers:
          - url: "http://127.0.0.1"
  middlewares:
    passClientCert:
      passTLSClientCert:
        pem: false
        info:
          subject:
            commonName: true
    extractCommonName:
      plugin:
        extractCommonName:
          destHeader: "X-Target"

About

Extract Common Name (CN) from the X-Forwarded-Tls-Client-Cert-Info Header of the PassTLSClientCert Middleware

Topics

Resources

License

Stars

Watchers

Forks