-
Notifications
You must be signed in to change notification settings - Fork 68
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 HSTS support to Federalist S3 setup #161
Comments
Started work on a simple S3 proxy here: https://github.com/dhcole/s4, available for testing at https://federalist-origin.18f.gov/site/dhcole/developer-hub/ The proxy either serves content with the usual /site/owner/repo/ pattern or if its routed through a custom domain, /site/domain.gov/. We'd need to adjust Federalist's build engine to build sites with a custom domain to that path, but this would simply routing for custom domains. |
Just capturing some thoughts for next actions on this. I think a new CDN that supports custom response headers is the easiest way to go, because unlike the proxy, it avoids the need to create a new ELB for each custom domain. However, that step could be automated by some calls to the AWS API, so it may not be a blocker. The proxy is now set up for the 18f.gsa.gov site, and I've documented that here: 18F/18f.gsa.gov#1430 (comment) To make this work for all Federalist sites, we'd need to adjust the build script in the application's
Once sites are available at that prefix on the bucket, a proxy could be set up with The final part would be making sure cloud.gov routes requests on custom domains to this app. That would require adding a |
Also, for the above, we'd need a simple check to see if a site already exists at a custom domain and if so, show the user an error rather than saving that custom domain to another site. |
Requested by 18f.gsa.gov |
Requested by me too ;) |
S3 doesn't send those. Options are a proxy or something else. |
A few options:
|
Do 2 for now (simplest implementation), and then strip them out when 1 is accomplished? |
federalist-proxy is now deployed to https://federalist-proxy.app.cloud.gov. It proxies content from S3 and add the HSTS header. Now we'll need to update the documentation for custom URLs to instruct site owners to set the origin for CloudFront to federalist-proxy instead of the S3 bucket. |
And we have some ATO work to do as well, but this is great! |
Verified in retro! This is done; go team! |
It seems like this change may have been reverted recently. I ran an SSL labs test a few weeks ago and the HSTS header was present, and I just ran one today and it is giving me different results. Any timeline for when it will be added back? |
Can you help us find where you're seeing HSTS missing? It is present when I just ran a test on https://www.ssllabs.com/ssltest/analyze.html?d=federalist-proxy.app.cloud.gov&s=52.61.61.155 |
I was running it against https://collegescorecard.ed.gov. It was present on 1/8 (I have a PDF of a test I ran that day). |
@brownpl will be back by EOD tomorrow. |
Awesome. I also noticed a few others that used to be there (X-Frame-Options, X-XSS-Protection, etc.) are absent. Will those also come back with this change? I'd assume so as they are present on federalist-proxy. |
@brownpl correct! |
They're back! Thanks for the quick work. |
You're welcome! Did you notice the downtime that caused them to get removed last week? 😄 |
Ha, I did notice a little blip last week. ;) |
The headers were dropped when I worked with cloud.gov to cut the (down)
part of the hosting process out of the loop, in order to get the site back
up faster.
In the future, we can do and undo this action much more quickly, though
hopefully we’ll never need it again.
|
S3 doesn't currently support HSTS headers or arbitrary custom headers. This means we can't launch Federalist sites with them. We should come up with a solution for this in the medium term. Options include investigating other CDNs that would allow for setting custom headers or a proxy layer between S3 and the CDN.
The text was updated successfully, but these errors were encountered: