|
41 | 41 | # The `frame-ancestors` directive helps avoid "Clickjacking" attacks and
|
42 | 42 | # is similar to the `X-Frame-Options` header.
|
43 | 43 | #
|
44 |
| -# Browsers that support the CSP header will ignore `X-Frame-Options` if |
| 44 | +# Browsers that support the CSP header should ignore `X-Frame-Options` if |
45 | 45 | # `frame-ancestors` is also specified.
|
46 | 46 | #
|
47 |
| -# (5) Forces the browser to treat all the resources that are served over HTTP |
| 47 | +# (5) Elements controlled by `object-src` are perhaps coincidentally |
| 48 | +# considered legacy HTML elements and are not receiving new standardized |
| 49 | +# features (such as the security attributes `sandbox` or `allow` for |
| 50 | +# `<iframe>`). |
| 51 | +# Therefore it is recommended to restrict this fetch-directive (e.g., |
| 52 | +# explicitly set `object-src 'none'` if possible). |
| 53 | +# |
| 54 | +# (6) Forces the browser to treat all the resources that are served over HTTP |
48 | 55 | # as if they were loaded securely over HTTPS by setting the
|
49 | 56 | # `upgrade-insecure-requests` directive.
|
50 | 57 | #
|
|
53 | 60 | # loaded over HTTPS you must include the `Strict-Transport-Security`
|
54 | 61 | # header.
|
55 | 62 | #
|
56 |
| -# (6) The `Content-Security-Policy` header is included in all responses |
| 63 | +# (7) The `Content-Security-Policy` header is included in all responses |
57 | 64 | # that are able to execute scripting. This includes the commonly used
|
58 | 65 | # file types: HTML, XML and PDF documents. Although Javascript files
|
59 | 66 | # can not execute script in a "browsing context", they are still included
|
|
75 | 82 | # https://content-security-policy.com/
|
76 | 83 |
|
77 | 84 | <IfModule mod_headers.c>
|
78 |
| - # (1) (2) (3) (4) (5) (6) |
79 |
| - Header always set Content-Security-Policy "default-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i" |
| 85 | + # (1) (2) (3) (4) (5) (6) (7) |
| 86 | + Header always set Content-Security-Policy "default-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; object-src 'none'; upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i" |
80 | 87 | </IfModule>
|
0 commit comments