Closed (duplicate)
Project:
Security Review
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2017 at 21:06 UTC
Updated:
9 Nov 2022 at 02:14 UTC
Jump to comment: Most recent
Comments
Comment #2
niklp commentedI concur this is a bug!
Comment #3
acrosmanSince core tests for this, could that test be leveraged instead of one specific to this module? Or does that go against an intentional choice?
Comment #4
niklp commentedI think given that settings.local.php is, let's say, "recognised at a core level" that core should probably check for the existence of that file and process that the same way that it does settings.php.
Given the level of abstraction of settings/config etc it seems a bit much to ask us to put Real Things in settings.php any more.
Feels like this might need to be a core issue? Or maybe it already is one...?!
Comment #5
banviktor commentedYes it can be set in settings.local.php (though it needs to be set at least once in settings.php to be recognized, which is weird but not the point), but why do that without setting it in settings.php in the first place?
The file settings.local.php is designed to hold settings overrides for development/staging/testing environments, while this security feature is most useful in production. This works as intended both in core and security_review.
Comment #6
ronald van belzen commentedYet, the status report is perfectly capable of detecting that trusted host patterns are set in this situation. Why not enhance this module? Display the correct result and advice to set the trusted host patterns in the settings.php.
It can be argued that this is not a bug, but I would suggest to at least re-open this issue as a feature request.
Comment #7
acrosman#5 suggests an intentional choice to not allow the module to use the same detection pattern core uses, but doesn't explain why using a different pattern is a good idea. Just because there is a design assumption that people set production values in settings.php and override them in settings.local.php doesn't mean that's more secure. I know there are site owners that prefer to keep anything that chances in the environment out of git, including trusted host settings, because it forces you to make sure each instance of the site is configured correctly. I'm not sure they are right, but I don't think they are wrong either.
It seems like using the same test core uses resolves the frustrations here, and reducing the chance that people are ignoring a warning. Arguably anytime people ignore security warnings because they are false positives that makes them more likely to ignore warnings that are legitimate.
Comment #8
banviktor commentedReopening as feature request
Comment #9
smustgrave commentedClosing as duplicate of https://www.drupal.org/project/security_review/issues/3008957
If anyone disagrees please reopen explaining how they are different.