-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Add a way to disable or remove some cli commands depending of runtime environment #49171
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
Comments
|
|
Of course! But I'm talking about all commands bundled into Symfony, like messenger, framework-bundle, var-dumper ones, and so on. Otherwise I didn't open an issue. |
|
Since this commands are declared as services, you can remove service definition using a compiler pass. It might be an interesting feature to add to the FrameworkBundle: list in the config the services to remove. |
|
Thank you for this suggestion. |
|
Friendly reminder that this issue exists. If I don't hear anything I'll close this. |
|
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |


Description
Having all the cli commands of a Symfony app available on production deployed artifact can be at least a security risk, especially for commands that can write/generate files, but also those that can lead/expose sensible information. So have a way to at least disable them would be great.
Moreover, they're useless in production so removing them would a a great bonus. Think about serverless deployment platforms where smallest as possible artifacts are recommanded to have the best performance and surface of attack.
Example
I have no example but I've found
APP_RUNTIME_ENV/kernel.runtime_environmentintroduced in5.2.0that triggers an error inWebProfilerBundle. That could be the minimum behavior to implement if we cannot disable those commands at first iteration.Then the feature could evovle to:
The text was updated successfully, but these errors were encountered: