How can you configure Traefik Strict SNI so Traefik drops requests that aren't matched? #674
-
I've transitioned a handful of apps to Kamal for deployment, and configured LE using moves from the popular thread. Our automated security scanners are now failing us for using self-signed certificates when connecting directly to the servers without SNI. Traefik responds with 404 using a default self-signed certificate if a router doesn't match. As an example, given a site
I've found that there's configuration to enable strict SNI checking: but I haven't been able to successfully translate "Traefik" configuration to "Traefik managed by Kamal" configuration. Kamal uses docker labels for configuration. In the It seems there are options that are unable to be passed in this manner, though my interpretation of the following is loose, and these issues are old:
It seems that this specific part of the configuration needs to be provided from some sort of File Provider ? https://doc.traefik.io/traefik/providers/file/ Can you help me drop requests in Traefik that don't match a rule from our given routers without adding an additional layer of load balancing in front of the VM? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
@ttilberg What version of Kamal are you on? Looks like this was changed from a 404 to a 502 in 24a2f51. Are you seeing this line in your deploy output for the traefik container? |
Beta Was this translation helpful? Give feedback.
-
I added an example configuration to discussion 112 with strict SNI checking enabled that will return the error below rather than a 404. It's also my understanding that the option required, sniStrict: true, cannot be set with Docker labels. The provided example has an extra /letsencrypt/tls.yml file that must be deployed to the server. That should be the only option that matters for this requirement in the giant config file that I inlcuded in that discussion. The new curl error:
All of the relevant config parts:config/deploy.ymltraefik:
options:
volume:
- "/letsencrypt/tls.yml:/letsencrypt/tls.yml"
args:
providers.file.filename: "/letsencrypt/tls.yml" /letsencrypt/tls.ymltls:
options:
sniStrict: true |
Beta Was this translation helpful? Give feedback.
I added an example configuration to discussion 112 with strict SNI checking enabled that will return the error below rather than a 404. It's also my understanding that the option required, sniStrict: true, cannot be set with Docker labels. The provided example has an extra /letsencrypt/tls.yml file that must be deployed to the server. That should be the only option that matters for this requirement in the giant config file that I inlcuded in that discussion.
The new curl error:
All of the relevant config parts:
config/deploy.yml