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

Add an help text inviting users to set low permissions after auto update #1833

Closed
mattab opened this issue Nov 23, 2010 · 8 comments
Closed
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Nov 23, 2010

When auto update fails, we suggest users to


"For example, on a linux server, if your apache user is www-data you can try to execute:<br />"
. "<code>chown -R www-data:www-data ".Piwik_Common::getPathToPiwikRoot()."</code><br />"
. "<code>chmod -R 0755 ".Piwik_Common::getPathToPiwikRoot()."</code><br />";

See code in Piwik.php copy() function, called from CoreUpdater/Controller oneClick_copy function.

The missing bit is that we don't tell users to revert back to less permissive permissions after the auto update was finished.

However, for more security we should do so.

Brain dump: I don't think a simple chmod -R 0644 will do, as piwik/tmp/* needs write access.

What are the exact minimal commands that would be required to set Piwik at the safest working state?

@mattab
Copy link
Member Author

mattab commented Nov 24, 2010

see also #1590

@mattab
Copy link
Member Author

mattab commented Apr 19, 2011

Anthon wrote:

If the directory/file owner and web server user have the same UID, use 0600 for files and 0700 for directories.

If not, but the owner and web server user are in the same group, use 0660 for files, and 0770 for directories.

Otherwise, use 0666 for files, and 0777 for directories. (If you're on a shared hosting account and have to be this permissive, then I'd probably switch hosting providers.)

@mattab
Copy link
Member Author

mattab commented Sep 28, 2011

Also there is a problem in that, it seems that by default /tmp/ directory is not protected. For example demo.piwik.org/tmp/templates_c/ demo.piwik.org/tmp/templates_c/%25%250D%5E0DB%5E0DBECC49%25%25index.tpl.php are directory disclosure.

I guess the easiest way would be to create a blank index.html in each directory?

Also, extract from email:

we recommend to execute, if the current permissions are not
proper (ie. user writable):
$directoryList .= "<code>chmod 0777 $realpath</code><br
/>";
I'm not sure why we give this command rather than the one we give above in
line 305:
. "<code>chown -R www-data:www-data
".Piwik_Common::getPathToPiwikRoot()."</code><br />"
. "<code>chmod -R 0755
".Piwik_Common::getPathToPiwikRoot()."</code><br />";

(only writable by webserver to write cache files and configs

If we change the message to the chown, would you say the issue is gone?
Yes. Definitely the second option with chown and chmod 0755 is so much better.
I would even consider adding the code, which checks for 777 perms and
raise a warning if found. Totaly up to you.

@mattab
Copy link
Member Author

mattab commented Oct 23, 2011

See also other report where the installation was loopig for lack of write permissions on the config/ folder. Are they checked properly?

@robocoder
Copy link
Contributor

See http://symfony.com/doc/current/book/installation.html for acl tips on environments that support it

@mattab
Copy link
Member Author

mattab commented Feb 26, 2012

We now give the command to chmod 755

So, I think this ticket is not necessary anymore, since the commands given do not give extra permissions that could be dangerous... Closing as won't fix.

@mattab
Copy link
Member Author

mattab commented Dec 16, 2012

Milestone 1.8.x Piwik 1.8.x deleted

@mattab
Copy link
Member Author

mattab commented Apr 23, 2014

See follow up #5034

@mattab mattab added this to the 1.12.x - Piwik 1.12.x milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

2 participants