Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

security/performance issues with default install #80

Closed
airflow2010 opened this issue Dec 30, 2019 · 8 comments
Closed

security/performance issues with default install #80

airflow2010 opened this issue Dec 30, 2019 · 8 comments

Comments

@airflow2010
Copy link

After deploying the nextcloud-instance with this script, there are two warnings reported by the instance itself (under admin/settings/administration/overview):

  • The "X-Frame-Options" HTTP header is not set to "SAMEORIGIN". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.
  • Some columns in the database are missing a conversion to big int.

Both issues can be easily fixed:

For the first issue, add
X-Frame-Options "SAMEORIGIN"
in the "header" section of the Caddyfile.

For the second issue, execute
sudo -u www php /usr/local/www/nextcloud/occ db:convert-filecache-bigint
once after install.

@danb35
Copy link
Owner

danb35 commented Dec 30, 2019

The header is an easy enough fix. I recall putting the database conversion (which leaves aside the question of why a "conversion" is required in the first place, in a brand-new database created directly by Nextcloud--why isn't it created with big int in the first place?) in the script, but taking out because it wouldn't run non-interactively--it required user input to run. Is this no longer the case?

@airflow2010
Copy link
Author

This is true, the second command requests user confirmation for the convertion of the database. I don't know if there is a switch to turn it non-interactive. If the database is already in the right format however, the command exits cleanly without interaction. To my mind it would be OK to have the administrator confirm this step, but this is your call.

@Migsi
Copy link
Contributor

Migsi commented Jan 29, 2020

This link considers there is a flag to be set for non interactive mode.

@danb35
Copy link
Owner

danb35 commented Jan 31, 2020

Ah, I hadn't seen that earlier. This should be fixed now.

@Migsi
Copy link
Contributor

Migsi commented Feb 2, 2020

After deploying the nextcloud-instance with this script, there are two warnings reported by the instance itself (under admin/settings/administration/overview):

* The "X-Frame-Options" HTTP header is not set to "SAMEORIGIN". This is a potential security or privacy risk, as it is recommended to adjust this setting accordingly.

* Some columns in the database are missing a conversion to big int.

Both issues can be easily fixed:

For the first issue, add
X-Frame-Options "SAMEORIGIN"
in the "header" section of the Caddyfile.

For the second issue, execute
sudo -u www php /usr/local/www/nextcloud/occ db:convert-filecache-bigint
once after install.

Regarding the X-Frame-Options, I was unable to fix that by just adjusting the Caddyfile under /usr/local/www/. Is there another Caddyfile which needs to be changed?

EDIT: I just noticed some weird behavior of nextcloud itself. The security check site tells me the missing setting is a security issue, but my browser tells me the header is sent. Can anyone relate to this?

EDIT 2: Nevermind. I just found out that the security check site tests for the setting case sensitive... So the proposed fix was working fine. Anyways, you should correct it to "sameorigin" all lowercase for convenience.

@danb35
Copy link
Owner

danb35 commented Feb 2, 2020

That sounds like the Nextcloud security scanner is being overly picky. Notably, the Nextcloud installation itself doesn't give this complaint:
image

@Ornias1993
Copy link
Contributor

@danb35 I tested the last 2 versions, both passed both the internal security check AND the Nextcloud Security Scanner.... So this seems solved.

Unless @Migsi Still has this issue, But in that case I doubt it's a code issue in this script to be honest

@danb35 danb35 closed this as completed Mar 8, 2020
@Migsi
Copy link
Contributor

Migsi commented Mar 20, 2020

@danb35 I tested the last 2 versions, both passed both the internal security check AND the Nextcloud Security Scanner.... So this seems solved.

Unless @Migsi Still has this issue, But in that case I doubt it's a code issue in this script to be honest

As I stated in the EDIT 2 in my last post, the problem was not really related to the script, but to the pickyness of the online nextcloud security scanner, which just didn't like the all uppercase header field. So the problem can be solved by adjusting the script, but IMHO should be fixed by nextcloud, adjusting their scanner to be case insensitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants