Skip to content

Commit 17c3fe5

Browse files
committed
Fastly: Include security headers for dl
Add Security headers to the VCL service. Ref: - https://web.dev/secure/ - https://infosec.mozilla.org/guidelines/web_security Signed-off-by: Arnaud Meukam <[email protected]>
1 parent 303f93c commit 17c3fe5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: infra/fastly/terraform/dl.k8s.io/vcl/binaries.vcl

+11
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ sub vcl_hit {
109109

110110
sub vcl_deliver {
111111

112+
set resp.http.Content-Security-Policy = "default-src 'self'";
113+
set resp.http.X-Frame-Options = "SAMEORIGIN";
114+
set resp.http.X-XSS-Protection = "1";
115+
set resp.http.X-Content-Type-Options = "nosniff";
116+
set resp.http.Referrer-Policy = "origin-when-cross-origin";
117+
118+
if (req.protocol == "https") {
119+
# Only connect to this site and subdomains via HTTPS for the next two years
120+
set resp.http.Strict-Transport-Security = "max-age=63072000; includeSubDomains";
121+
}
122+
112123
if (resp.http.cache-control:max-age) {
113124
unset resp.http.expires;
114125
}

0 commit comments

Comments
 (0)