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

Documentation: Cannot add property with policy value filter #9

Open
kadamwhite opened this issue Jun 10, 2020 · 0 comments
Open

Documentation: Cannot add property with policy value filter #9

kadamwhite opened this issue Jun 10, 2020 · 0 comments

Comments

@kadamwhite
Copy link
Contributor

The documentation for the main content_security_policies filter shows adding base-uri:

add_filter( 'altis.security.browser.content_security_policies', function ( array $policies ) : array {
	$policies['base-uri'] = 'self';
	// ...etc
	return $policies;
} );

However, because base-uri isn't in the base object of content security policy directives we pass into the CSP header logic, we never check for a base-uri filter and the filter below (which I believe you would logically conclude would work, reading the README) will never run:

altis.security.browser.filter_report_only_policy_value.base-uri

This is confusing, and we should clarify the list of CSP directives that will work as policy value filters out of the box, and note that further directives should be added using the first filter (or Altis config) prior to filtering.

Alternatively, we could expand our base list to include all supported directives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant