Skip to content
Snippets Groups Projects
Commit 07440fbd authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

update to django-csp 4.0

parent 32b068c4
Branches
No related tags found
1 merge request!256update to django-csp 4.0
Pipeline #153795 passed
...@@ -28,5 +28,5 @@ tqdm ...@@ -28,5 +28,5 @@ tqdm
gunicorn gunicorn
qrcode[pil] qrcode[pil]
python-magic # to check mime type python-magic # to check mime type
django-csp django-csp>=4.0
#END OF FILE #END OF FILE
...@@ -251,34 +251,37 @@ FILE_UPLOAD_MAX_MEMORY_SIZE = 10485760 # 10Mo ...@@ -251,34 +251,37 @@ FILE_UPLOAD_MAX_MEMORY_SIZE = 10485760 # 10Mo
################################################################################ ################################################################################
# DJANGO CSP, and DJANGO CSP REPORTS # DJANGO CSP, and DJANGO CSP REPORTS
################################################################################ ################################################################################
CSP_DEFAULT_SRC = [
CONTENT_SECURITY_POLICY = {
'DIRECTIVES': {
'default-src': [
"'self'", "'self'",
"*", '*',
] ],
CSP_SCRIPT_SRC = [ 'script-src': [
"'self'", "'self'",
"cdn.datatables.net", 'cdn.datatables.net',
"cdnjs.cloudflare.com", 'cdnjs.cloudflare.com',
"code.jquery.com", 'code.jquery.com',
"plausible.pasteur.cloud", 'plausible.pasteur.cloud',
"stackpath.bootstrapcdn.com", 'stackpath.bootstrapcdn.com',
"cdn.jsdelivr.net", 'cdn.jsdelivr.net',
"www.googletagmanager.com", 'www.googletagmanager.com',
"www.google-analytics.com", 'www.google-analytics.com',
] ],
CSP_STYLE_SRC = [ 'style-src': [
"'self'", "'self'",
"'unsafe-inline'", "'unsafe-inline'",
'*', '*',
] ],
CSP_IMG_SRC = [ 'img-src': [
"'self'", "'self'",
"*", "*",
"data:", "data:",
] ],
CSP_EXCLUDE_URL_PREFIXES = ( 'report-uri': reverse_lazy('cspmailreports:csp-report'),
# "/candidate/", },
) 'EXCLUDE_URL_PREFIXES': (),
CSP_REPORT_URI = reverse_lazy('cspmailreports:csp-report') }
################################################################################ ################################################################################
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment