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 another tip to setup permissions #3563

Closed
wants to merge 4 commits into from
Closed

Conversation

tony-co
Copy link
Contributor

@tony-co tony-co commented Feb 10, 2014

Q A
Doc fix? no
New docs? yes
Applies to all
Fixed tickets n/a

This is a quick tip on the installation guide to use the same user for CLI and HTTP.

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes
| Applies to    | all
| Fixed tickets | n/a
typing commands when setting up new projects. This is done by editing your
Apache configuration file ``httpd.conf`` and update the user and group values
from ``www-data`` to your CLI user. Obviously, this is only recommended in dev
environnement.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo, it should say environment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed for a development environment imo, i never do this for instance, i have never done it neither in ubuntu nor in mac

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cordoval I agree this is not needed, it is just another option among others :)

@@ -267,6 +267,14 @@ If there are any issues, correct them now before moving on.

Note that using the ACL is recommended when you have access to them
on your server because changing the umask is not thread-safe.

**4. Use the same user for CLI and HTTP**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... the CLI and the web server

@weaverryan
Copy link
Member

Hey Tony!

Sorry for spamming you with comments - but I like the addition - so let's get it merged in :).

Cheers!

@tony-co
Copy link
Contributor Author

tony-co commented Feb 18, 2014

Thanks @weaverryan for the comments, it's good spam anyway!
I made those changes, it's ready for merge.

@lyrixx
Copy link
Member

lyrixx commented Feb 18, 2014

Fews issue:

  • Not everyone uses Apache2 (I use nginx + PHP-FPM for instance)

  • My Apache2 config is not httpd.conf it's apache2.conf (I also have Apache2)

  • Obviously, this is only recommended in development environment as you do not want to give Apache full control over your whole production system.

    Why did you said that? We are just talking about php file. All our infrasture a SensioLabs uses the same user for php-frpm and the CLI. Everything is much more simple. For exemple, we have an insight user. the FPM pool run with the insight user, all crons, workers uses also this user. And when we connect (ssh) to a server, we use the insight user. So for me, this sentence is very wrong and useless.

@tony-co
Copy link
Contributor Author

tony-co commented Feb 19, 2014

@lyrixx Concerning points 1 and 2, I could rephrase and tell the user to check his web server documentation (Apache/Nginx).
Then point 3, I don't know. It could lead to bad practices but you made some good points.

@weaverryan
Copy link
Member

Yea, I think we should rephrase to tell the user to check their web server - like you mentioned @tony-co.

About point 3, is it true (or not true) that using the same user for many things means that if one thing were compromised (e.g. your web server, or some security hole in your web app itself that allows people to access files or run a command) that things are worse because the attacker can access more parts of your system? Or is this not really a big concern? For me, that's the part (if it makes sense) that I wanted to warn people about. But @lyrixx you're saying that you do this on purpose, and I'll admit that your setup does indeed sound very simple - I like that :).

So, do we or don't we recommend using the same user in production? Or do we need to involve others that know more? I know that I don't know :).

Thanks!

@xabbuh
Copy link
Member

xabbuh commented Feb 26, 2014

I don't agree with @lyrixx. I don't want the webserver user to be able to write anywhere than in some dedicated directories (like cache, log, etc.). I don't want my webserver for example to be able to delete my entire application or to add new files to the web directory which would then be served by it.

@lyrixx
Copy link
Member

lyrixx commented Feb 26, 2014

I think we could omit everything about production. It's simpler, and error-proof ;)

@xabbuh Deleting .php file is useless for an attacker. Accessing your databases and other credentials is really more important. Give me an access to your server with www-data and you will see ;)

@xabbuh
Copy link
Member

xabbuh commented Feb 26, 2014

@lyrixx Depends on what he wants to achieve. Nonetheless, is he not only able to delete files but also can create new files if he got write permissions. Of course, that's no the only thing you have to take care of.

configuration file ``httpd.conf`` and updating the User and Group values
from ``www-data`` to your CLI user. Obviously, this is only recommended in
development environment as you do not want to give Apache full control over
your whole production system.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @lyrixx that we should just avoid talking about production - so remove the last sentence. We already start with "In development environments", so I think we're good :).

@tony-co
Copy link
Contributor Author

tony-co commented Mar 19, 2014

ping @weaverryan

@weaverryan
Copy link
Member

Thanks for the fast update! I've patched this into the 2.3 branch. Cheers andt thanks everyone!

weaverryan added a commit that referenced this pull request Mar 19, 2014
This PR was submitted for the 2.4 branch but it was merged into the 2.3 branch instead (closes #3563).

Discussion
----------

Add another tip to setup permissions

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes
| Applies to    | all
| Fixed tickets | n/a

This is a quick tip on the installation guide to use the same user for CLI and HTTP.

Commits
-------

0d5bcd7 Rephrase
625369a Updated tip with latest comments
b955d99 Update installation.rst
1aaa291 Add another tip to setup permissions in dev environnement.
@weaverryan weaverryan closed this Mar 19, 2014
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

Successfully merging this pull request may close these issues.

5 participants