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

Set common security headers in HTTP responses #550

Merged
merged 1 commit into from
Aug 17, 2020

Conversation

grobie
Copy link
Contributor

@grobie grobie commented Aug 14, 2020

In order to protect against web vulnerabilities, this change sets common
security headers.

  • content-security-policy allows only scripts, fonts, and stylesheets to
    be loaded from the site origin or from Google's font servers
  • referrer-policy denies any referrer header to be sent to other pages
    (note the highly sensitive URL fragment should have already been
    ignored by modern browsers)
  • x-content-type-options denies browsers to assume the response content
    type
  • x-frame-options denies old browser to load the page in an iFrame
  • x-xss-protection activates basic XSS protection
  • strict-transport-security enforces browsers to use TLS for any further
    requests in the future. It's only set if the request was served via
    TLS

See https://securityheaders.com/?q=yopass.se&followRedirects=on for more information.

In order to protect against web vulnerabilities, this change sets common
security headers.

* content-security-policy allows only scripts, fonts, and stylesheets to
  be loaded from the site origin or from Google's font servers
* referrer-policy denies any referrer header to be sent to other pages
  (note the highly sensitive URL fragment should have already been
  ignored by modern browsers)
* x-content-type-options denies browsers to assume the response content
  type
* x-frame-options denies old browser to load the page in an iFrame
* x-xss-protection activates basic XSS protection
* strict-transport-security enforces browsers to use TLS for any further
  requests in the future. It's only set if the request was served via
  TLS

See https://securityheaders.com/?q=yopass.se&followRedirects=on for more information.

Signed-off-by: Tobias Schmidt <tobidt@gmail.com>
@codecov
Copy link

codecov bot commented Aug 14, 2020

Codecov Report

Merging #550 into master will increase coverage by 1.43%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #550      +/-   ##
==========================================
+ Coverage   86.95%   88.38%   +1.43%     
==========================================
  Files           4        4              
  Lines         138      155      +17     
==========================================
+ Hits          120      137      +17     
  Misses         10       10              
  Partials        8        8              
Impacted Files Coverage Δ
pkg/yopass/yopass.go 96.07% <100.00%> (+0.78%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0a9fcc8...05e16a5. Read the comment docs.

@jhaals
Copy link
Owner

jhaals commented Aug 17, 2020

Thanks for adding these @grobie 👍

@jhaals jhaals merged commit 606b07b into jhaals:master Aug 17, 2020
@grobie grobie deleted the security-headers branch August 18, 2020 10:21
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.

None yet

2 participants