Hallo zusammen,
ich habe einen apache aufgesetzt und nextcloud installiert. LetsEncrypt Zertifikate hinterlegt. Soweit funktioniert das auch alles super.
Mein nextcloud lässt sich aufrufen über https://{meinedomain.de}/nextcloud
Jetzt habe ich mal meine Domain mit https://observatory.mozilla.org/ getestet und komme "nur" auf ein "B" Rating ☹
Die Schwachstellen sind:
Content Security Policy -10 Content Security Policy (CSP) implemented, but allows 'unsafe-eval'
X-Content-Type-Options -5 X-Content-Type-Options header not implemented
X-XSS-Protection -10 X-XSS-Protection header not implemented
Ich weiß auch wie ich die behebe. Und zwar wenn ich in meine vhost config (/etc/httpd/conf/vhosts/{meinedomain.de}) folgendes ändere von:
... <IfModule mod_headers.c> Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; Header set Content-Security-Policy "default-src 'none';script-src 'self' 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src * data: blob:;font-src 'self';connect-src 'self';media-src 'self';frame-src 'self'" Header set X-Content-Type-Options nosniff # `mod_headers` cannot match based on the content-type, however, # the `Content-Security-Policy` response header should be send # only for HTML documents and not for the other resources. <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$"> Header unset Content-Security-Policy </FilesMatch> </IfModule> ...
auf
... <IfModule mod_headers.c> Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains; Header set Content-Security-Policy "script-src 'self'; object-src 'self'" Header set X-Content-Type-Options nosniff # `mod_headers` cannot match based on the content-type, however, # the `Content-Security-Policy` response header should be send # only for HTML documents and not for the other resources. <FilesMatch "\.(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$"> Header unset Content-Security-Policy </FilesMatch> </IfModule> ...
Nach der Änderung habe ich ein "A+" Rating. Aber meine nextcloud funktioniert nicht mehr richtig. Ich kann mich zwar einloggen. Aber es werden nicht die Dateien und Ordner angezeigt. Außerdem wird unter Admin → Security & setup warnings folgendes angezeigt:
The "X-Content-Type-Options" HTTP header is not configured to equal to "nosniff". This is a potential security or privacy risk and we recommend adjusting this setting.
Gerade den letzten Punkt verstehe ich nicht da ich das doch explizit in der vhost mit der Änderung gesetzt habe.
Ich bin weit weg von Profi. Vielleicht habe ich mich ja total verkonfiguriert 😉.
Vielleicht kann mich jemand auf den richtigen Weg bringen.
Vielen Dank