Traefik middleware plugin serving a security.txt (RFC9116)
To get all fields for the configuration you can generate a security.txt here:
Add this plugin to your static configuration (e.g. traefik.yml)
# ... contents of traefik.ymlexperimental:plugins:security-txt:moduleName: github.com/Ju0x/traefik-security-txtversion: v0.1.0
# Dynamic configurationhttp:routers:my-router:rule: host(`localhost`)service: service-fooentryPoints:- webmiddlewares:- security-txt-pluginservices:service-foo:loadBalancer:servers:- url: http://127.0.0.1middlewares:security-txt-plugin:plugin:security-txt:Expires: "2026-12-31T23:59:00.000Z"PreferredLanguages: "en, de, dk"
/.well-known/security.txt or /security.txt
Contact: mailto:[email protected]
Expires: 2026-12-31T23:59:00.000Z
Preferred-Languages: en, de, dk
# ... contents of dynamic.ymlmiddlewares:security-txt-plugin:plugin:security-txt:Contact:- "https://example.test/contact"Expires: "2026-12-31T23:59:00.000Z"Encryption: "https://example.test/pgp-key.txt"Acknowledgements: "https://example.test/hall-of-fame.html"PreferredLanguages: "en, de, dk"Policy:- "https://example.test/security-policy.html"- "https://bughunter.example.test/security-policy.html"Hiring: "https://example.test/jobs.html"CSAF:- "https://example.test/.well-known/csaf/provider-metadata.json"- "https://example.test/csaf/provider-metadata.json"
/.well-known/security.txt or /security.txt
Contact: mailto:[email protected]
Contact: https://example.test/contact
Expires: 2026-12-31T23:59:00.000Z
Encryption: https://example.test/pgp-key.txt
Acknowledgements: https://example.test/hall-of-fame.html
Preferred-Languages: en, de, dk
Policy: https://example.test/security-policy.html
Policy: https://bughunter.example.test/security-policy.html
Hiring: https://example.test/jobs.html
CSAF: https://example.test/.well-known/csaf/provider-metadata.json
CSAF: https://example.test/csaf/provider-metadata.json