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

Improveme the apache/mod_php configuration example #6223

Closed
wants to merge 1 commit into from

Conversation

gnat42
Copy link
Contributor

@gnat42 gnat42 commented Feb 3, 2016

We recently had a project undergo a massive security scan. We had setup email error reporting, so symfony sent us ~15K emails all mostly route not found when the scanner was playing around in the bundles asset directory. In reality if a file isn't available in the bundles directory the server can simply return a 404 not found, and it is probably also slightly more secure and performant to not fire up the entire symfony framework in that case.

# optionally disable the RewriteEngine for the asset directories
# which will allow apache to simply reply with a 404 when files are
# not found instead of passing the request into the full symfony stack
<Directory /var/www/project/web/bundles>
Copy link
Member

Choose a reason for hiding this comment

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

this has to be indented 2 spaces back (to be in the same column as the start of the comment)

@wouterj
Copy link
Member

wouterj commented Feb 6, 2016

I know almost nothing about Apache config, but I agree with your description and comments in the code. So 👍 from me

<Directory /var/www/project/web/bundles>
AllowOverride None
Order Allow,Deny
Allow from All
Copy link
Member

Choose a reason for hiding this comment

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

These three lines should be removed (they are already covered by the Directory container for the /var/www/project/web path).

We recently had a project undergo a massive security scan. We had setup email error reporting, so symfony sent us ~15K emails all mostly route not found when the scanner was playing around in the bundles asset directory. In reality if a file isn't available in the bundles directory the server can simply return a 404 not found, and it is probably also slightly more secure and performant to not fire up the entire symfony framework in that case.
@gnat42
Copy link
Contributor Author

gnat42 commented Feb 7, 2016

The latest PR/updated commit should address both comments.

@xabbuh
Copy link
Member

xabbuh commented Feb 8, 2016

Thank you @gnat42.

xabbuh added a commit that referenced this pull request Feb 8, 2016
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #6223).

Discussion
----------

Improveme the apache/mod_php configuration example

We recently had a project undergo a massive security scan. We had setup email error reporting, so symfony sent us ~15K emails all mostly route not found when the scanner was playing around in the bundles asset directory. In reality if a file isn't available in the bundles directory the server can simply return a 404 not found, and it is probably also slightly more secure and performant to not fire up the entire symfony framework in that case.

Commits
-------

67b661e Improvement to the apache/mod_php configuration example
@xabbuh xabbuh closed this Feb 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants