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

[nginx] HSTS feature always adds 'preload', creates risk of domain sabotage #466

Closed
whereisaaron opened this issue Mar 18, 2017 · 1 comment · Fixed by #563
Closed

[nginx] HSTS feature always adds 'preload', creates risk of domain sabotage #466

whereisaaron opened this issue Mar 18, 2017 · 1 comment · Fixed by #563

Comments

@whereisaaron
Copy link
Contributor

If the HSTS feature is enabled, the current template always adds preload to the Strict-Transport-Security header. There is no way to disable it.

https://github.com/kubernetes/ingress/blob/master/controllers/nginx/rootfs/etc/nginx/template/nginx.tmpl#L224

"Strict-Transport-Security: max-age={{ $cfg.HSTSMaxAge }}{{ if $cfg.HSTSIncludeSubdomains }}; includeSubDomains{{ end }}; preload";

Having preload there enables someone to maliciously submit your domain for browser pre-loading and prevent HTTP working for your domain for all time.

You can mitigate this risk by setting a short 'max-age' or by not including the subdomain option, since both are required for preload listing. But if anyone ever got caught, it would take them many months and a lot of effort to get it fixed.

The preload option is a special flag only needed for a short time while you are registering a domain for preload. After that you can remove it, since you are now preloaded forever. I don't think this should be the default, and if it is needed, it should be separate option to add it.

Is that reasonable? Can we just remove preload? Or do people need it.

(I think HSTS should ideally be per Ingress, since one size doesn't fit all, for all the domains that might go to a particular Ingress controller. But that is a bigger change, to add annotation support for that.)

@whereisaaron whereisaaron changed the title HSTS feature always adds 'preload', creates risk of domain sabotage [nginx] HSTS feature always adds 'preload', creates risk of domain sabotage Mar 18, 2017
@whereisaaron
Copy link
Contributor Author

Many thanks @aledbf, that looks perfect 🙌 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant