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 headers to support site nginx config #6

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

Conversation

JacquelineMorrissette
Copy link

Description

Add headers requested by Mozilla Observatory to https://support.kobotoolbox.org's nginx config

add_header Strict-Transport-Security 'max-age=6307200; includeSubDomains; preload';
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry if Mozilla is giving conflicting recommendations 😳 but let's not include X-XSS-Protection since it's not supported by modern browsers and not recommended by MDN: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection

add_header Content-Security-Policy "default-src *; style-src 'self' 'unsafe-inline'";
add_header Strict-Transport-Security 'max-age=6307200; includeSubDomains; preload';
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

X-Frame-Options like this will prevent people from iframeing our support documentation, and I'd rather continue letting them do it. I may have to eat my words later if the burden of people complaining about issues flagged by automated security scanning tools outweighs the benefit we get from allowing the community to reuse our content inside iframes.

@@ -40,6 +40,12 @@ server {
root /var/www/html;
index index.html;

add_header Content-Security-Policy "default-src *; style-src 'self' 'unsafe-inline'";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very permissive and probably could be tightened up a lot, but the support page is not a web application and never displays user-generated content. Let's not spend more time on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants