vm icon indicating copy to clipboard operation
vm copied to clipboard

Getting an A- at observatory.mozilla.org security test

Open Exception0815 opened this issue 9 years ago • 10 comments

Steps to reproduce

  1. Download & Install Ubuntu 16.04 OVA
  2. Configure according to https://www.techandme.se/complete-install-instructions-nextcloud/
  3. Test Nextcloud on https://observatory.mozilla.org/

Expected behaviour

Maybe getting an A+ at observatory.mozilla.org security test

Actual behaviour

Following security problems getting detected:

  • Content Security Policy: Content Security Policy (CSP) implemented, but allows 'unsafe-eval'
  • Cookies: Cookies set without using the Secure flag, but transmission over HTTP prevented by HSTS

Server configuration

Server version: (see your admin page) 12.0.1 VM version (master / released version) Production server Ubuntu 16.04 OVA Updated from an older installed version or fresh install: Updated from 12.0.0 to 12.0.1

Network

Do you use DHCP? No Is port 80 and/or 443 open? only port 443 is open

Logs / Screenshots

Log file (/var/ncdata/nextcloud.log)

How to get it out of VirtualBox?

Installation log (command output)

Where to find?
How to get it out of VirtualBox?

Screenshoots

scan

Exception0815 avatar Aug 07 '17 21:08 Exception0815

I use SSL Quality Labs for my tests which gives it A+, same goes for https://scan.nextcloud.com. But sure. I'll have a look when I have some time left over.

enoch85 avatar Aug 07 '17 21:08 enoch85

@LukasReschke Are the Mozilla tests wrong as they state that CSP isn't activated but scan.nextcloud.com does?

enoch85 avatar Aug 08 '17 08:08 enoch85

@Exception0815 Hey, could you try this and see if it helps:

  1. Ensure you have mod_headers.so enabled in Apache instance
  2. Add following entry in httpd.conf Header edit Set-Cookie ^(.*)$ $1;HttpOnly;Secure
  3. Restart Apache Web Server

enoch85 avatar Sep 23 '17 16:09 enoch85

I get A+ with standard install, you can close this issue

tiagoefreitas avatar Nov 12 '18 14:11 tiagoefreitas

Actually it shows A+ but still shows the same warning, and that entry in apache2.conf doesn't fix it

tiagoefreitas avatar Nov 12 '18 15:11 tiagoefreitas

This should work but somehow its also not working...

Header set Content-Security-Policy "default-src 'self';"

from https://content-security-policy.com/

tiagoefreitas avatar Nov 12 '18 15:11 tiagoefreitas

Since it's showing A+ I'm closing this, thanks for confirming!

enoch85 avatar Nov 12 '18 15:11 enoch85

Also the header works, but the observatory has some issue. But it breaks nextcloud ui, a bug should be open upstream to make it more secure and work with unsafe-eval and unsafe-inline.

tiagoefreitas avatar Nov 12 '18 15:11 tiagoefreitas

a bug should be open upstream to make it more secure and work with unsafe-eval and unsafe-inline.

I don't think that's allowed per default IIRC.

enoch85 avatar Nov 12 '18 15:11 enoch85

I meant make nextcloud work correcly with CSP without needing unsafe-eval and unsafe-inline, following the security recommendations of Google and others for web apps.

tiagoefreitas avatar Nov 13 '18 08:11 tiagoefreitas