-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Documented the security:check command #4651
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
Changes from all commits
7f3fb71
36d3f2b
0e7d0cd
e552369
3c9a962
fdfb1a0
897dc70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2055,6 +2055,36 @@ to work correctly. Just pass a file name to enable it:: | |
You can also access a secure random instance directly from the Symfony | ||
dependency injection container; its name is ``security.secure_random``. | ||
|
||
.. _book-security-checking-vulnerabilities: | ||
|
||
Checking for Known Security Vulnerabilities in Dependencies | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. versionadded:: 2.5 | ||
The ``security:check`` command was introduced in Symfony 2.5. This command is | ||
included in ``SensioDistributionBundle``, which has to be registered in your | ||
application in order to use this command. | ||
|
||
When using lots of dependencies in your Symfony projects, some of them may | ||
contain security vulnerabilities. That's why Symfony includes a command called | ||
``security:check`` that checks your ``composer.lock`` file to find any known | ||
security vulnerability in your installed dependencies: | ||
|
||
.. code-block:: bash | ||
|
||
$ php app/console security:check | ||
|
||
A good security practice is to execute this command regularly to be able to | ||
update or replace compromised dependencies as soon as possible. Internally, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we could add a hint, that the command is returning an error code if the security issue is found, so you could use it in a ci process. https://github.com/sensiolabs/security-checker/blob/master/SensioLabs/Security/Command/SecurityCheckerCommand.php#L98 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @timglabisch this hint looks to me too specific to be included, but let's see what do other reviewers think about it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Advising to run the command on a regular basis imho calls for integration into build environments. :) We can simply add a tip after this paragraph like this: .. tip::
The ``security:check`` command terminates with a non-zero exit code if
any of your dependencies is affected by a known security vulnerability.
Therefore, you can easily integrate it in your build process. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
this command uses the public `security advisories database`_ published by the | ||
FriendsOfPHP organization. | ||
|
||
.. tip:: | ||
|
||
The ``security:check`` command terminates with a non-zero exit code if | ||
any of your dependencies is affected by a known security vulnerability. | ||
Therefore, you can easily integrate it in your build process. | ||
|
||
Final Words | ||
----------- | ||
|
||
|
@@ -2088,3 +2118,4 @@ Learn more from the Cookbook | |
.. _`FOSUserBundle`: https://github.com/FriendsOfSymfony/FOSUserBundle | ||
.. _`implement the \Serializable interface`: http://php.net/manual/en/class.serializable.php | ||
.. _`Timing attack`: http://en.wikipedia.org/wiki/Timing_attack | ||
.. _`security advisories database`: https://github.com/FriendsOfPHP/security-advisories |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reference to the SensioDistributionBundle should probably also be added in the installation chapter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you really think is necessary? The installation chapter is for people that know nothing about Symfony. They're going to use the installer and they're going to install the standard edition, so everything works out of the box. My feel is that this note is only for advanced users doing custom installations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I guess you're right now that I think about it again.