wiltonsr / ldapAuth

An open source Traefik Middleware that enables authentication via LDAP in a similar way to Traefik Enterprise
https://plugins.traefik.io/plugins/628c9eb7ffc0cd18356a979c/ldap-auth
Apache License 2.0
111 stars 10 forks source link

[Question] Can it be used to protect the Dashboard (dashboard@internal)? #53

Closed C-Duv closed 11 months ago

C-Duv commented 11 months ago

Can this plugin add an auth in front of the Træfik Dashboard (dashboard@internal) or it is only for other services?

wiltonsr commented 11 months ago

Hello, @C-Duv

Can this plugin add an auth in front of the Træfik Dashboard (dashboard@internal) or it is only for other services?

Of course, ldapAuth is just a Traefik Middleware, this way you can add it to any of the services.

...
services:
  traefik:
    image: traefik:v2.10.0
    labels:
      - traefik.http.routers.mydashboard.rule=Host(`traefik.localhost`)
      - traefik.http.routers.mydashboard.service=api@internal
      # ldapAuth Register Middleware ==================================
      - traefik.http.routers.mydashboard.middlewares=ldap_auth@docker
      # # ldapAuth Options===========================================
      - traefik.http.middlewares.ldap_auth.plugin.ldapAuth.logLevel=DEBUG
      - traefik.http.middlewares.ldap_auth.plugin.ldapAuth.url=ldap://ldap.forumsys.com
      - traefik.http.middlewares.ldap_auth.plugin.ldapAuth.port=389
      - traefik.http.middlewares.ldap_auth.plugin.ldapAuth.baseDN=dc=example,dc=com
      - traefik.http.middlewares.ldap_auth.plugin.ldapAuth.attribute=uid
...