Sign inSign up

jokneemo/stepclient-traefik

By jokneemo

Updated 8 months ago

A lightweight sidecar container for Traefik Proxy to issue Step-CA certs in Docker Swarm

Image
Security
Integration & delivery
Web servers
0

561

jokneemo/stepclient-traefik repository overview

Step-CA Provisioner Client for Traefik

A lightweight sidecar container for Traefik Proxy that automatically provisions and renews certificates from a Step CA server.

The primary use case for this sidecar is when using Traefik in a Docker Swarm environment. It is deployed as a single replica to any manager node and automatically discovers and configures TLS certificates for services that have the appropriate labels.

!!! note

This project is not affiliated with Smallstep nor Traefik.
It is a community project created by [JoKneeMo](https://github.com/jokneemo).
If you're using Step CA and Traefik in a production or enterprise environment, please consider purchasing a subscription from them.

Features

  • Automatic Discovery: Scans Docker labels on Traefik services.
  • Dynamic Configuration: Generates Traefik dynamic configuration (YAML) for TLS certificates.
  • Renewal: Automatically renews certificates before they expire.
  • Flexible Config: Configurable via environment variables.

Usage

Run alongside Traefik in your docker-compose.yml.

See docker-compose.yml for a more complete example.

services:
  stepclient:
    image: ghcr.io/jokneemo/stepclient:latest
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./certificates:/certificates # Map to the same path used in Traefik
      - ./traefik/conf/stepclient.yaml:/stepclient.yaml
    environment:
      STEP_CA_URL: https://stepca.example.com
      STEP_FINGERPRINT: ...
      STEP_PROVISIONER: jwk-provisioner
      # Secrets (mapped via docker secrets or file mounts)
      STEP_PROVISIONER_KEY: /run/secrets/stepca_key
      STEP_PASSWORD_FILE: /run/secrets/stepca_password

Configuration

Environment VariableDefaultDescription
INTERVAL_SECONDS300Check interval in seconds (default 5 minutes)
RENEW_BEFORE_HOURS480Renewal threshold in hours (default 20 days)
ISSUE_IF_TLS_TRUEtrueOnly issue if traefik.http.routers.x.tls=true
IGNORE_IF_CERTRESOLVER_PRESENTtrueIgnore routers with existing certresolver
NOT_AFTER1128hCertificate lifetime duration (default 47 days)
STEP_CA_URLStep CA URL, e.g. https://stepca.example.com:9000
STEP_FINGERPRINTStep CA SHA256 Fingerprint
STEP_PROVISIONERStep CA JWK Provisioner Name
STEP_PROVISIONER_KEY/run/secrets/stepca_keyPath to provisioner key
STEP_PASSWORD_FILE/run/secrets/stepca_passwordPath to password file
OUTPUT_DIR/certificatesDirectory to write certificates, mount at the same path used in Traefik
TRAEFIK_YAML_PATH/stepclient.yamlPath to Traefik dynamic configuration file

Development

  1. Install dependencies:
    pip install -e .
    
  2. Run locally:
    stepclient-traefik
    

Tag summary

Content type

Image

Digest

sha256:91674e730

Size

46.9 MB

Last updated

8 months ago

docker pull jokneemo/stepclient-traefik