Skip to content

Commit 34b5a24

Browse files
committedJun 12, 2015
cleanup for readability, set basic CSP
1 parent 66e298a commit 34b5a24

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed
 

‎globals/secure.conf

+20-22
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
11
#### nginx-globals - https://github.com/philcryer/nginx-globals
22

33
#### Security headers configured to protect against XSS and other web threats
4-
#### Guided by Voices, I mean Securityheaders.com https://securityheaders.com/ - Thanks!
5-
add_header Cache-Control "public";
6-
add_header X-Frame-Options "DENY";
7-
add_header X-Frame-Options "SAMEORIGIN";
8-
add_header X-XSS-Protection "1; mode=block";
9-
add_header X-Content-Type-Options "nosniff";
10-
add_header Content-Type "text/html; charset=UTF-8";
11-
add_header X-Permitted-Cross-Domain-Policies "master-only";
4+
#### these options setup with Securityheaders help. Thanks! https://securityheaders.com/
5+
add_header Cache-Control "public";
6+
add_header X-Frame-Options "DENY";
7+
add_header X-Frame-Options "SAMEORIGIN";
8+
add_header X-XSS-Protection "1; mode=block";
9+
add_header X-Content-Type-Options "nosniff";
10+
add_header Content-Type "text/html; charset=UTF-8";
11+
add_header X-Permitted-Cross-Domain-Policies "master-only";
1212

1313

1414
#### Drop the Server: header
1515
#### install nginx-extras (debian, ubuntu) to add the more set headers module
16-
#more_clear_headers 'Server:*';
16+
#more_clear_headers 'Server:*';
1717
#### Bonus, reset the Server: header to whatever you want to mess with people
18-
#more_set_headers 'Server: fak3r.com';
18+
#more_set_headers 'Server: tehgoogle.com';
1919
# or
20-
#more_set_headers 'Server: IIS 4.0 (Windows NT 4.0)';
20+
#more_set_headers 'Server: IIS 4.0 (Windows NT 4.0)';
2121

2222

2323
#### Content Security Policy
2424
#### http://tautt.com/best-nginx-configuration-for-security/
25-
#+ add_header Content-Security-Policy
26-
27-
#add_header Content-Security-Policy "default-src https: connect-src https: font-src https: data: frame-src https: img-src https: data: media-src https: object-src https: script-src 'unsafe-inline' 'unsafe-eval' https: style-src 'unsafe-inline' https:";
28-
29-
#more specific...
30-
#add_header Content-Security-Policy "default-src 'self'; script-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; frame-src 'self'; connect-src 'self' https://apis.google.com; connect-src 'self' https://fonts.googleapis.com; object-src 'none' ";
31-
#add_header Content-Security-Policy "default-src 'self'; script-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; frame-src 'self'; connect-src 'self' https://apis.google.com; object-src 'none' ";
32-
#add_header Content-Security-Policy "style-src https://cdnjs.cloudflare.com; ";
33-
#add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://cdnjs.cloudflare.com https://connect.facebook.net; img-src 'self' https://ssl.google-analytics.com https://s-static.ak.facebook.com https://assets.zendesk.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://assets.zendesk.com; font-src 'self' https://themes.googleusercontent.com; frame-src https://assets.zendesk.com https://www.facebook.com https://s-static.ak.facebook.com https://tautt.zendesk.com; object-src 'none'";
34-
#add_header Content-Security-Policy "style-src 'https://cdnjs.cloudflare.com'; default-src 'self'; object-src 'none'";
35-
#add_header Content-Security-Policy "default-src 'self'";
25+
add_header Content-Security-Policy
26+
add_header Content-Security-Policy "default-src 'self'";
27+
#### these can get very specific, options below. To really lock things down will take some time to get right
28+
#add_header Content-Security-Policy "default-src https: connect-src https: font-src https: data: frame-src https: img-src https: data: media-src https: object-src https: script-src 'unsafe-inline' 'unsafe-eval' https: style-src 'unsafe-inline' https:";
29+
#add_header Content-Security-Policy "default-src 'self'; script-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; frame-src 'self'; connect-src 'self' https://apis.google.com; connect-src 'self' https://fonts.googleapis.com; object-src 'none' ";
30+
#add_header Content-Security-Policy "default-src 'self'; script-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; frame-src 'self'; connect-src 'self' https://apis.google.com; object-src 'none' ";
31+
#add_header Content-Security-Policy "style-src https://cdnjs.cloudflare.com; ";
32+
#add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://ssl.google-analytics.com https://cdnjs.cloudflare.com https://connect.facebook.net; img-src 'self' https://ssl.google-analytics.com https://s-static.ak.facebook.com https://assets.zendesk.com; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://assets.zendesk.com; font-src 'self' https://themes.googleusercontent.com; frame-src https://assets.zendesk.com https://www.facebook.com https://s-static.ak.facebook.com https://tautt.zendesk.com; object-src 'none'";
33+
#add_header Content-Security-Policy "style-src 'https://cdnjs.cloudflare.com'; default-src 'self'; object-src 'none'";

0 commit comments

Comments
 (0)
Please sign in to comment.