melchor9000/traefik-auth

By melchor9000

Updated 10 days ago

Service to authenticate clients using Traefik's ForwardAuth middleware.

Image
Security
Web servers
0

990

melchor9000/traefik-auth repository overview

traefik-auth

A small project to protect services using other kind of authentication methods appart from Basic and Digest, to be used with Forward Auth middleware. The service allows to configure several authentication providers and use them in authentication pipelines.

Deploy

Pull image from Docker Hub melchor9000/traefik-auth. Supported architectures are Intel/AMD 64 and ARM 64.

Use a container runtime to run the service, either docker or podman, or run inside a container orquestrator (like swarm or kubernetes).

See below an example for docker compose:

services:
  traefik-auth:
    image: melchor9000/traefik-auth
    restart: on-failure
    networks:
      - traefiknet # shared network with traefik I use internally
    volumes:
      # send config to the container
      - './config.yml:/config/config.yml:ro'
      # volume where to store the generated keys
      - './data:/data'
    # recommended: use a different user to run the service
    user: '1000:1000'
    # recommended: lock the filesystem inside the container
    read_only: true
    # optional: configure service, router and middleware from here
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.traefik-auth.entrypoints=https"
      - "traefik.http.routers.traefik-auth.rule=Host(`example.com`) && Path(`/oauth2/callback`)"
      - "traefik.http.services.traefik-auth.loadbalancer.server.port=8080"
      - "traefik.http.middlewares.traefik-auth.forwardauth.address=http://traefik-auth:8080/auth"
      - "traefik.http.middlewares.traefik-auth.forwardauth.authrequestheaders=Authorization,Cookie"
      - "traefik.http.middlewares.traefik-auth.forwardauth.authresponseheaders=Set-Cookie"

networks:
  # shared network with traefik
  traefiknet:
    external: true

Configure

Go to the repository to check updated documentation.

Tag summary

Content type

Image

Digest

sha256:bea956a3f

Size

5.6 MB

Last updated

10 days ago

docker pull melchor9000/traefik-auth