From e088698bec2e23373091d3cc5feca4c2ff9f82aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szekeres=20Ba=CC=81lint?= Date: Fri, 23 Feb 2018 01:40:17 +0100 Subject: [PATCH] Referrer-Policy, Content-Security-Policy --- README.md | 5 ++ public/assets/js/app.js | 9 +- public/index.html | 105 +++++++++++++++-------- public/templates/conf/_general.conf.html | 4 + 4 files changed, 85 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 6b6231c..abe0f7e 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,11 @@ Online nginx configuration generator. * … * unified (`nginx.conf`) / modularized file structure (ideal for multi-domain environment) * security headers + * `X-Frame-Options` + * `X-XSS-Protection` + * `X-Content-Type-Options` + * `Referrer-Policy` + * `Content-Security-Policy` * `worker_processes` * `user` * `pid` diff --git a/public/assets/js/app.js b/public/assets/js/app.js index 9692d50..2669acc 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -58,6 +58,9 @@ file_structure: 'unified', + referrer_policy: 'no-referrer-when-downgrade', + content_security_policy: 'default-src * \'unsafe-eval\' \'unsafe-inline\'', + worker_processes: 'auto', user: 'www-data', pid: '/run/nginx.pid', @@ -270,8 +273,12 @@ return $scope.isPHP() && $scope.data.wordpress; }; + $scope.isCSP = function() { + return !!$scope.data.content_security_policy; + }; + $scope.isAccessLog = function() { - return $scope.data.access_log; + return !!$scope.data.access_log; }; $scope.isGzip = function() { diff --git a/public/index.html b/public/index.html index 4de2e35..7156bb8 100644 --- a/public/index.html +++ b/public/index.html @@ -125,58 +125,89 @@ -
+
+ +
+
+
+
+
+
+
PHP
+
+ +
+
+
+
+ + +
+
+
+
+ + +
+
-
- - -
-
- - + +
+
+ + +
-
- - +
+
+ + +
- -
- - +
+ +
-
- - +
+ +
@@ -184,7 +215,7 @@
- diff --git a/public/templates/conf/_general.conf.html b/public/templates/conf/_general.conf.html index b3c45b4..e831847 100644 --- a/public/templates/conf/_general.conf.html +++ b/public/templates/conf/_general.conf.html @@ -3,6 +3,10 @@ add_header X-Frame-Options "SAMEORIGIN" always; add_header X-XSS-Protection "1; mode=block" always; add_header X-Content-Type-Options "nosniff" always; add_header X-UA-Compatible "IE=Edge" always; +add_header Referrer-Policy "{{ data.referrer_policy }}" always; +add_header Content-Security-Policy "{{ data.content_security_policy }}" always; # . files location ~ /\. {