Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Secrets] Premature creation of secrets dir #34959

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

Closed
mbessolov opened this issue Dec 12, 2019 · 2 comments
Closed

[Secrets] Premature creation of secrets dir #34959

mbessolov opened this issue Dec 12, 2019 · 2 comments

Comments

@mbessolov
Copy link
Contributor

Symfony version(s) affected: 4.4.1, 5.0.1

Description

Invoking bin/console commands causes a write operation (directory creation) in ./config/ directory.

How to reproduce

  • Install a Symfony application
  • Revoke write permissions on config/ directory (e.g. chmod 055 ./config)
  • Run any console command (e.g. bin/console list --env=prod) - it will produce an exception:
In SodiumVault.php line 40:
                                                                                                                          
  Unable to create the secrets directory (/xyz/config/secrets/prod) 

Possible Solution

Move the secrets directory creation from the constructor to the methods where this directory is actually needed.

Additional context

The reason I belive its important is that in a typical secure production environment it should NOT be necessary to have write access to the config directory to run all bin/console commands. In our production environments we expect the framework to avoid unnecessary writes unless needed by a specific command.

@javiereguiluz
Copy link
Member

@mbessolov thanks for reporting this! I think this was fixed in #34820 (which will be released in the next Symfony patch version). Could you please check if that fixes the issue for you? Thanks.

@mbessolov
Copy link
Contributor Author

Yes, it fixes the problem.
Thank you!

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

No branches or pull requests

4 participants