-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Split private directories system check into "Required" and "Recommended" #17577
Comments
Maybe some documentation somewhere should be updated... And a link to this doc should be provided in the warning message? |
At least on my server Also to me it seems those files exist by default, how are they supposed to be protected? (The warning should tell you too ..) |
I have explained this a bit more detailed here: Maybe the error message could be expanded with this help |
Note: |
One thing: With the current check Matomo doesn't accept it, if the config.ini.php returns a 304 e.g. to the homepage. |
I'm open to other suggestions on the best way to fix this. However, I have placed this in my Matomo Apache configuration:
And this has removed the warning from the Matomo system check. Again, I'm open to suggestions of a better way to address this. |
I think initially there was a check for the retrieved content. To adjust the check for redirects etc maybe we could follow redirects and check if the retrieved config is |
Hi guys, I've also had this problem after updating to 4.3.0, but for a different file and folder. For my site, the "Required Private Directory" warning refers to this URL: https://matomo.example.com/lang/en.json My site is running on Apache, and inside my /lang/ directory there is a Matomo-generated .htaccess file which I've attached to my comment here (renamed to a .txt file). As far as I can tell, it's configured correctly to block all the files in this directory. However, when I check the HTTP response header of the above URL, it's returning "200 OK", rather than 4xx. Any idea why? To me it feels like Matomo is doing something wrong here. |
Hello, I was in the process of manual installation of Matomo 4.3.0 on Centos 6.9 with PHP 7.2.24, MYSQL 5.5, Apache 2.2. However I face the same issue as mentioned above on the following file i.e : http://example.com/piwik/lang/en.json i.e the following error is thrown after visiting Diagnostic->System Check : Could you please replicate and fix the issue?. |
Created #17604 as a first improvement as well as this FAQ https://matomo.org/faq/troubleshooting/how-do-i-fix-the-error-private-directories-are-accessible/ which we can improve and complete over time. To fully fix this issue we should maybe split the one system check into two system checks:
Currently, For docs around this see https://developer.matomo.org/guides/system-check |
This is difficult without affecting performance or requiring a certain webserver like Apache and adding an .htaccess file or required information and configuration. I think one way would be to recommend RewriteRules for Apache and similarly for NGINX in the warning message or linking to a page that describes in detail how to configure the webserver. To make it easier for the user, we could have a global RewriteRule and proxy everything through index.php?path=$somepath (or another script, e.g. filter.php?path=$somepath and forward to index.php) and have our code filter and do a stream_copy_to_stream for straight files. This function should be pretty much the same speed as a straight request but offer the benefit of our code being the filter for potentially harmful requests. Not sure what a really quick solution would be at this stage. |
@geekdenz be good to have a look at #17577 (comment) which is the only thing left to do. Not 100% sure what you refer to with affecting performance? The recommendations etc should be already done. We only need to adjust the system check that's all. |
Yes. You're right. I over-estimated the requirement and reading again clarifies that it's just a documentation requirement in the diagnostics. |
reinstate logic but logic changes required and adapt from main branch to match requirements
* split private directories check into required and recommended fixes #17577 * add translations for en and de #17577 * refactor PrivateDirectories for overlap #17577 ensure language file reverted * put checks in order, add check for lang/en.json #17577 * refactor Required and RecommendedPrivateDirectories #17577 reinstate logic but logic changes required and adapt from main branch to match requirements * remove unused use statements, update ui-test screenshot #17577 * refactor translation for 'read this...' #17577
Today, I upgraded to Matomo 4.3.0. The Matomo system check complains about "Required Private Directories". Specifically, it tells me:
"We found that the above URLs are accessible via the browser, but they should NOT be. Allowing them to be accessed can pose a potential security risk since the contents can provide information about your server and potentially your users. Please restrict access to them.
We also found that Matomo's config directory is publicly accessible. While attackers can't read the config now, if your webserver stops executing PHP files for some reason, your MySQL credentials and other information will be available to anyone. Please check your webserver config and deny access to this directory. "
I'm not positive, but something seems to be messed up here. I have my config directory set to 700. My config.ini.php is set to 600. What should the permissions be? Matomo doesn't say what it is looking for. For me to lock it down further, I basically have to change take access away from the Apache user. Maybe I'm missing something obvious, but this doesn't seem right.
Your Environment
The text was updated successfully, but these errors were encountered: