|
5 | 5 | from ..security import CspGenerator, common_security_headers |
6 | 6 |
|
7 | 7 | GOOGLE_CSP_POLICY = { |
8 | | - # "default-src": ["*.gstatic.com"], |
9 | | - # Fonts from fonts.google.com |
10 | | - "font-src": ["*.gstatic.com"], |
11 | | - # <iframe> based embedding for Maps and Youtube |
12 | | - "frame-src": ["www.google.com", "www.youtube.com"], |
13 | | - # YouTube video thumbnails |
14 | | - "img-src": ["img.youtube.com"], |
15 | | - # Assorted Google-hosted Libraries/APIs |
| 8 | + "font-src": ["*.gstatic.com"], # Google Fonts from fonts.google.com |
| 9 | + "frame-src": [ |
| 10 | + "www.google.com", # <iframe> based embeds for Google Maps |
| 11 | + "www.youtube.com", # <iframe> based embeds for Youtube |
| 12 | + ], |
| 13 | + "img-src": [ |
| 14 | + "img.youtube.com", # YouTube video thumbnails |
| 15 | + "i.ytimg.com", # YouTube video thumbnails |
| 16 | + "www.googletagmanager.com", # GTM |
| 17 | + ], |
16 | 18 | "script-src": [ |
17 | | - "ajax.googleapis.com", |
18 | | - "*.googleanalytics.com", |
19 | | - "*.google-analytics.com", |
20 | | - "www.youtube.com", |
| 19 | + "ajax.googleapis.com", # Assorted Google-hosted Libraries/APIs |
| 20 | + "*.googleanalytics.com", # GA4 |
| 21 | + "*.google-analytics.com", # GA4 |
| 22 | + "www.youtube.com", # YouTube embeds |
| 23 | + "*.gstatic.com", # Google Translate |
| 24 | + "www.googletagmanager.com", # GTM |
21 | 25 | ], |
22 | | - # Google Fonts stylesheets and YouTube embedded player styles |
23 | 26 | "style-src": [ |
24 | | - "ajax.googleapis.com", |
25 | | - "fonts.googleapis.com", |
26 | | - "*.gstatic.com", |
| 27 | + "ajax.googleapis.com", # YouTube embedded player styles |
| 28 | + "fonts.googleapis.com", # Google Fonts stylesheets |
| 29 | + "*.gstatic.com", # Assorted Google stylesheets |
27 | 30 | ], |
28 | 31 | } |
29 | 32 |
|
|
0 commit comments