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

Improve PHP security recommendations #2423

Merged
merged 6 commits into from
Jul 8, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions docs/infrastructure_and_maintenance/security/security_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,26 @@ Such arguments could include passwords or other sensitive information.
You should also make sure no stack trace is ever visible to end users of production sites,
though visible arguments are unsafe even if the stack traces only show up in log files.

### Disable error output from PHP

Symfony in production mode prevents exception messages from being visible to end users.
However, if Symfony fails to boot properly, such exceptions may end up being visible, including stack traces.
This can be prevented by [disabling error message output in PHP](https://www.php.net/manual/en/language.errors.basics.php).
These `php.ini` configuration values should be used on production sites.
When using '[[= product_name_cloud =]]' / Platform.sh the same settings can be configured in '[[= product_name_base =]]' DXP's `.platform.app.yaml` file.
glye marked this conversation as resolved.
Show resolved Hide resolved

```ini
display_errors = Off
display_startup_errors = Off
```
glye marked this conversation as resolved.
Show resolved Hide resolved

### Other PHP settings

Consider what other security related settings are relevant for your needs.
The [OWASP PHP Configuration Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/PHP_Configuration_Cheat_Sheet.html)
Copy link
Contributor

Choose a reason for hiding this comment

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

Seeing that it doesn't even acknowledge PHP 8 and was not updated in 4 years I'm torn if we should mention it to be honest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, same, but OWASP is such a great resource in general and this page links to others that are also good. I also expect the OWASP community to update this page eventually. I'm doubtfully leaning towards keeping it.

contains some recommendations, but please beware it may be out of date as it doesn't mention PHP 8.
glye marked this conversation as resolved.
Show resolved Hide resolved
See also [PHP's own security manual](https://www.php.net/manual/en/security.php).

## [[= product_name =]]

### Fully-vetted admin users
Expand Down
Loading