-
-
Notifications
You must be signed in to change notification settings - Fork 636
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #250
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# ---------------------------------------------------------------------- | ||
# | Cross Origin Policy | | ||
# ---------------------------------------------------------------------- | ||
|
||
# Set strict a Cross Origin Policy to mitigate information leakage. | ||
# | ||
# (1) Cross-Origin-Embedder-Policy prevents a document from loading any | ||
# cross-origin resources that don’t explicitly grant the document | ||
# permission. | ||
# https://html.spec.whatwg.org/multipage/origin.html#coep | ||
# https://owasp.org/www-project-secure-headers/#cross-origin-embedder-policy | ||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy | ||
# | ||
# (2) Cross-Origin-Opener-Policy allows you to ensure a top-level document does | ||
# not share a browsing context group with cross-origin documents. | ||
# https://html.spec.whatwg.org/multipage/origin.html#cross-origin-opener-policies | ||
# https://owasp.org/www-project-secure-headers/#cross-origin-opener-policy | ||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy | ||
# | ||
# (3) Cross-Origin-Resource-Policy allows to define a policy that lets web | ||
# sites and applications opt in to protection against certain requests from | ||
# other origins, to mitigate speculative side-channel attacks. | ||
# https://fetch.spec.whatwg.org/#cross-origin-resource-policy-header | ||
# https://owasp.org/www-project-secure-headers/#cross-origin-resource-policy | ||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy | ||
# https://resourcepolicy.fyi/ | ||
# | ||
# To check your Cross Origin Policy, you can use an online service, such as: | ||
# https://securityheaders.com/ | ||
# https://observatory.mozilla.org/ | ||
# | ||
# https://web.dev/coop-coep/ | ||
# https://web.dev/why-coop-coep/ | ||
# https://web.dev/cross-origin-isolation-guide/ | ||
# https://scotthelme.co.uk/coop-and-coep/ | ||
|
||
<IfModule mod_headers.c> | ||
# (1) | ||
Header always set Cross-Origin-Embedder-Policy "require-corp" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i" | ||
|
||
# (2) | ||
Header always set Cross-Origin-Opener-Policy "same-origin" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i" | ||
|
||
# (3) | ||
Header always set Cross-Origin-Resource-Policy "same-origin" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i" | ||
</IfModule> |