mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-17 06:23:00 +02:00
prevent loading resources from external sites
Make Apache transmit a CSP (Content Security Policy) header for WebUI and Captive Portal contents. This prevents some XSS and content injection attacks, especially in case no transport encryption (Captive Portal!) can be used. Signed-off-by: Peter Müller <peter.mueller@link38.eu> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
7ddfc686e2
commit
eb6d71514a
@@ -10,6 +10,7 @@ Listen 1013
|
||||
KeepAlive Off
|
||||
|
||||
Header always set X-Content-Type-Options nosniff
|
||||
Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'"
|
||||
|
||||
ScriptAlias /cgi-bin/ /srv/web/ipfire/cgi-bin/captive/
|
||||
Alias /assets/ /srv/web/ipfire/html/captive/assets/
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
SSLCertificateKeyFile /etc/httpd/server-ecdsa.key
|
||||
|
||||
Header always set X-Content-Type-Options nosniff
|
||||
Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'"
|
||||
|
||||
<Directory /srv/web/ipfire/html>
|
||||
Options ExecCGI
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
RewriteRule .* - [F]
|
||||
|
||||
Header always set X-Content-Type-Options nosniff
|
||||
Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'"
|
||||
|
||||
<Directory /srv/web/ipfire/html>
|
||||
Options ExecCGI
|
||||
|
||||
Reference in New Issue
Block a user