Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forced traefik to only allow tls1.2+ requests #595

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions roles/traefik/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
- "{{ traefik_data_directory }}"
- "{{ traefik_data_directory }}/letsencrypt"

- name: Template Traefik config.toml
- name: Template Traefik traefik.toml
template:
src: traefik.toml
dest: "{{ traefik_data_directory }}/traefik.toml"
register: template_config

- name: Template Traefik dynamic_config.toml
template:
src: dynamic_config.toml
dest: "{{ traefik_data_directory }}/dynamic_config.toml"
register: template_dynamic_config
Comment on lines +16 to +20

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in this manner dynamic config is static file should it be file: instead of template:


- name: Traefik Docker Container
docker_container:
name: traefik
Expand All @@ -21,9 +27,10 @@
network_mode: host
volumes:
- "{{ traefik_data_directory }}/traefik.toml:/etc/traefik/traefik.toml:ro"
- "{{ traefik_data_directory }}/dynamic_config.toml:/etc/traefik/dynamic_config.toml:ro"
- "{{ traefik_data_directory }}/letsencrypt:/letsencrypt:rw"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
env: "{{ traefik_environment_variables }}"
restart_policy: unless-stopped
memory: "{{ traefik_memory }}"
recreate: "{{ template_config is changed }}"
recreate: "{{ template_config is changed or template_dynamic_config is changed }}"
7 changes: 7 additions & 0 deletions roles/traefik/templates/dynamic_config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[tls.options]

[tls.options.default]
minVersion = "VersionTLS12"

[tls.options.mintls13]
minVersion = "VersionTLS13"
2 changes: 2 additions & 0 deletions roles/traefik/templates/traefik.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
providersThrottleDuration = "2s"
[providers.docker]
exposedbydefault = false
[providers.file]
filename = "/etc/traefik/dynamic_config.toml"

[api]
insecure = true
Expand Down