Add frame-ancestors 'none' to all configs
authorshibayashi <shibayashi@cypherpunk.observer>
Thu, 30 Aug 2018 09:10:16 +0000 (11:10 +0200)
committershibayashi <shibayashi@cypherpunk.observer>
Thu, 30 Aug 2018 09:10:16 +0000 (11:10 +0200)
installation/caddyfile-pleroma.example
installation/pleroma-apache.conf
installation/pleroma.nginx
installation/pleroma.vcl

index 29496d1d71860af372e035aa9f12e4fbe2e9d049..2c1efde2d06f3eb445bdfc078217fedd99d85e06 100644 (file)
@@ -22,7 +22,7 @@ social.domain.tld  {
     Referrer-Policy "same-origin"
     Strict-Transport-Security "max-age=31536000; includeSubDomains;"
     Expect-CT "enforce, max-age=2592000"
-    Content-Security-Policy "default-src 'none'; base-uri 'self'; form-action 'self'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://social.domain.tld; upgrade-insecure-requests;"
+    Content-Security-Policy "default-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://social.domain.tld; upgrade-insecure-requests;"
   }
 
   # If you do not want remote frontends to be able to access your Pleroma backend server, remove these lines.
index bf8db63ad587406a96fe0b1a9816f61d8e98fda7..c70d521389d3feebb349647d138446417d78716f 100644 (file)
@@ -37,7 +37,7 @@ CustomLog ${APACHE_LOG_DIR}/access.log combined
     Header always set X-Frame-Options "DENY"
     Header always set X-Content-Type-Options "nosniff"
     Header always set Referrer-Policy same-origin
-    Header always set Content-Security-Policy "default-src 'none'; base-uri 'self'; form-action 'self'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://pleroma.example.tld; upgrade-insecure-requests;"
+    Header always set Content-Security-Policy "default-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://pleroma.example.tld; upgrade-insecure-requests;"
 
     # Uncomment this only after you get HTTPS working.
     # Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
index aaf620de20abf619f074ef3794358d40ee4ee7c5..37871ea5b5e25b6a57827155bd59499ddcfc0bdb 100644 (file)
@@ -77,7 +77,7 @@ server {
         add_header X-Content-Type-Options "nosniff" always;
         add_header Referrer-Policy "same-origin" always;
         add_header X-Download-Options "noopen" always;
-        add_header Content-Security-Policy "default-src 'none'; base-uri 'self'; form-action 'self'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://example.tld; upgrade-insecure-requests;" always;
+        add_header Content-Security-Policy "default-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://example.tld; upgrade-insecure-requests;" always;
         
         # Uncomment this only after you get HTTPS working.
         # add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
index ad5bb3c6cb83ef7132dcb30b8b1fab75d5a4bafc..74490be2aa251a85d402a26a71cccb8c3b8a063d 100644 (file)
@@ -125,7 +125,7 @@ sub vcl_deliver {
   set resp.http.X-XSS-Protection = "1; mode=block";
   set resp.http.X-Content-Type-Options = "nosniff";
   set resp.http.Referrer-Policy = "same-origin";
-  set resp.http.Content-Security-Policy = "default-src 'none'; base-uri 'self'; form-action 'self'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://" + req.http.host + "; upgrade-insecure-requests;";
+  set resp.http.Content-Security-Policy = "default-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'; img-src 'self' data: https:; media-src 'self' https:; style-src 'self' 'unsafe-inline'; font-src 'self'; script-src 'self'; connect-src 'self' wss://" + req.http.host + "; upgrade-insecure-requests;";
   # Uncomment this only after you get HTTPS working.
   # set resp.http.Strict-Transport-Security= "max-age=31536000; includeSubDomains";
-}
\ No newline at end of file
+}