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

Add support for including a Strict-Transport-Security header (for use only when a proxy or load balancer is handling TLS/SSL) #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

taniwallach
Copy link
Contributor

Add support for including a Strict-Transport-Security header.

This header is meant to force browsers to only contact site via TLS/SSL ("https"). Using this header is a commonly recommended security practice, but is dangerous should the site have any need to work over plain (port 80) HTTP.

The value for the header is provided in render.conf as a string value called HSTS_HEADER, and when that value is not provided (or is false for Perl purposes) no Strict-Transport-Security header will be set.

No default value is being provided in render.conf.dist so the header will not be enabled by accident.

The header should only be used on a server which is available via a proxy or load balancer which has a valid SSL certificate and handles the TLS/SSL level (and which will continue to do so for the long-term).

Note: It could be that some proxy setups could add the header at the proxy, but the AWS Elastic Application Load Balancer does not have the option to add this header, but can provide SSL termination, so the header needs to be added on the "back end" (in our case the Standalone renderer).

This header is meant to force browsers to only contact site via TLS/SSL
("https"). Using this header is a commonly recommended security
practice, but is dangerous should the site have any need to work over
plain (port 80) HTTP.

The value for the header is provided in render.conf as a string value
called HSTS_HEADER, and when that value is not provided (or is "false"
for Perl purposes) no Strict-Transport-Security header will be set.

No default value is being provided in render.conf.dist so the header will
not be enabled by accident.

The header should only be used on a server which is available via a proxy
or load balancer which has a valid SSL certificate and handles the TLS/SSL
level (and which will continue to do so for the long-term).
@taniwallach taniwallach requested a review from drdrew42 as a code owner January 24, 2022 20:05
@taniwallach
Copy link
Contributor Author

To test you would want to be using the renderer behind something doing the SSL work as a proxy.
In such a setting, add something like

  HSTS_HEADER => 'max-age=604800',

into render.conf.

It has been provisionally tested for a renderer running as a target to which the AWS Elastic Application Load Balancer is sending requests for processing, where the ELB is handling the TLS work. Now that this header is being provided, I hope to soon be able to open the address to incoming requests from additional sources. Until now the security team has insisted on it only be available from a very restricted white list of IP addresses. Once the "server" is public, the result of the code in this PR would be something which can be checked on that site.

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 this pull request may close these issues.

1 participant