Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(76)

Issue 206940043: Add HSTS and CSP headers to all services and static files. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by M-A
Modified:
11 years, 1 month ago
Reviewers:
vadimsh
CC:
swarming-eng_googlegroups.com
Base URL:
https://code.google.com/p/swarming@master
Visibility:
Public.

Description

Add HSTS and CSP headers to all services and static files. - The services are not accessible over HTTP anyway. - Refuse loading anything not over HTTPS and outside of the same-origin through CSP. - Add .woff to supported static files. Update both *.yaml for static content and AuthenticatingHandler to set these headers. References: http://www.html5rocks.com/en/tutorials/security/content-security-policy/ https://www.owasp.org/index.php/Content_Security_Policy https://www.owasp.org/index.php/HTTP_Strict_Transport_Security https://www.owasp.org/index.php/Clickjacking_Defense_Cheat_Sheet R=vadimsh@chromium.org BUG=swarming:96 Committed: https://code.google.com/p/swarming/source/detail?repo=default&r=4e8ac6b055fcce2e46576a2a73deb23dbc3e25ec

Patch Set 1 #

Patch Set 2 : Rewrote #

Total comments: 2

Patch Set 3 : Further strict CSP #

Patch Set 4 : Tested on 3 services, relax some rules a little #

Unified diffs Side-by-side diffs Delta from patch set Stats (+58 lines, -3 lines) Patch
M appengine/auth_service/app.yaml View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M appengine/components/components/auth/handler.py View 1 2 3 1 chunk +16 lines, -0 lines 0 comments Download
M appengine/components/components/auth/include.yaml View 1 2 1 chunk +4 lines, -1 line 0 comments Download
M appengine/components/components/static_third_party.yaml View 1 2 3 1 chunk +6 lines, -2 lines 0 comments Download
M appengine/isolate/app.yaml View 1 2 2 chunks +9 lines, -0 lines 0 comments Download
M appengine/swarming/app.yaml View 1 2 3 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 8
M-A
11 years, 1 month ago (2015-02-25 14:49:02 UTC) #1
vadimsh
lgtm add http_headers to static section in app.yaml too. See http_headers here https://cloud.google.com/appengine/docs/python/config/appconfig
11 years, 1 month ago (2015-02-25 18:06:28 UTC) #2
M-A
On 2015/02/25 18:06:28, vadimsh wrote: > lgtm > > add http_headers to static section in ...
11 years, 1 month ago (2015-02-25 18:47:03 UTC) #3
vadimsh
lgtm https://codereview.appspot.com/206940043/diff/20001/appengine/components/components/auth/handler.py File appengine/components/components/auth/handler.py (right): https://codereview.appspot.com/206940043/diff/20001/appengine/components/components/auth/handler.py#newcode110 appengine/components/components/auth/handler.py:110: self.response.headers['Content-Security-Policy'] = ( It affects only Javascript running ...
11 years, 1 month ago (2015-02-25 19:07:46 UTC) #4
vadimsh
Can't reproduce replication_smoke_test.py error. Next time it happens, can you please send me full log ...
11 years, 1 month ago (2015-02-25 19:21:45 UTC) #5
M-A
https://codereview.appspot.com/206940043/diff/20001/appengine/components/components/auth/handler.py File appengine/components/components/auth/handler.py (right): https://codereview.appspot.com/206940043/diff/20001/appengine/components/components/auth/handler.py#newcode110 appengine/components/components/auth/handler.py:110: self.response.headers['Content-Security-Policy'] = ( On 2015/02/25 19:07:46, vadimsh wrote: > ...
11 years, 1 month ago (2015-02-25 20:12:23 UTC) #6
vadimsh
lgtm, assuming it works...
11 years, 1 month ago (2015-02-25 20:15:16 UTC) #7
M-A
11 years, 1 month ago (2015-02-25 20:23:46 UTC) #8
Message was sent while issue was closed.
Committed patchset #4 (id:40002) manually as
4e8ac6b055fcce2e46576a2a73deb23dbc3e25ec (presubmit successful).
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b