module documentation

Undocumented

Constant CROSS​_ORIGIN​_OPENER​_POLICY​_VALUES Undocumented
Constant E023 Undocumented
Constant E024 Undocumented
Constant REFERRER​_POLICY​_VALUES Undocumented
Constant SECRET​_KEY​_INSECURE​_PREFIX Undocumented
Constant SECRET​_KEY​_MIN​_LENGTH Undocumented
Constant SECRET​_KEY​_MIN​_UNIQUE​_CHARACTERS Undocumented
Constant W001 Undocumented
Constant W002 Undocumented
Constant W004 Undocumented
Constant W005 Undocumented
Constant W006 Undocumented
Constant W008 Undocumented
Constant W009 Undocumented
Constant W018 Undocumented
Constant W019 Undocumented
Constant W020 Undocumented
Constant W021 Undocumented
Constant W022 Undocumented
Function ​_security​_middleware Undocumented
Function ​_xframe​_middleware Undocumented
Function check​_allowed​_hosts Undocumented
Function check​_content​_type​_nosniff Undocumented
Function check​_cross​_origin​_opener​_policy Undocumented
Function check​_debug Undocumented
Function check​_referrer​_policy Undocumented
Function check​_secret​_key Undocumented
Function check​_security​_middleware Undocumented
Function check​_ssl​_redirect Undocumented
Function check​_sts Undocumented
Function check​_sts​_include​_subdomains Undocumented
Function check​_sts​_preload Undocumented
Function check​_xframe​_deny Undocumented
Function check​_xframe​_options​_middleware Undocumented
CROSS_ORIGIN_OPENER_POLICY_VALUES: set[str] =

Undocumented

Value
set(['same-origin', 'same-origin-allow-popups', 'unsafe-none'])
E023 =

Undocumented

Value
Error('You have set the SECURE_REFERRER_POLICY setting to an invalid value.',
      hint="""Valid values are: {}.""".format(""", """.join(sorted(REFERRER_POLICY_VALUES
))),
      id='security.E023')
E024 =

Undocumented

Value
Error('You have set the SECURE_CROSS_ORIGIN_OPENER_POLICY setting to an invalid 
value.',
      hint="""Valid values are: {}.""".format(""", """.join(sorted(CROSS_ORIGIN_OPENER_POLICY_VALUES
))),
      id='security.E024')
REFERRER_POLICY_VALUES: set[str] =

Undocumented

Value
set(['no-referrer',
     'no-referrer-when-downgrade',
     'origin',
     'origin-when-cross-origin',
     'same-origin',
     'strict-origin',
     'strict-origin-when-cross-origin',
...
SECRET_KEY_INSECURE_PREFIX: str =

Undocumented

Value
'django-insecure-'
SECRET_KEY_MIN_LENGTH: int =

Undocumented

Value
50
SECRET_KEY_MIN_UNIQUE_CHARACTERS: int =

Undocumented

Value
5
W001 =

Undocumented

Value
Warning('You do not have \'django.middleware.security.SecurityMiddleware\' in yo
ur MIDDLEWARE so the SECURE_HSTS_SECONDS, SECURE_CONTENT_TYPE_NOSNIFF, SECURE_RE
FERRER_POLICY, SECURE_CROSS_ORIGIN_OPENER_POLICY, and SECURE_SSL_REDIRECT settin
gs will have no effect.',
        id='security.W001')
W002 =

Undocumented

Value
Warning('You do not have \'django.middleware.clickjacking.XFrameOptionsMiddlewar
e\' in your MIDDLEWARE, so your pages will not be served with an \'x-frame-optio
ns\' header. Unless there is a good reason for your site to be served in a frame
, you should consider enabling this header to help prevent clickjacking attacks.'
,
        id='security.W002')
W004 =

Undocumented

Value
Warning('You have not set a value for the SECURE_HSTS_SECONDS setting. If your e
ntire site is served only over SSL, you may want to consider setting a value and
 enabling HTTP Strict Transport Security. Be sure to read the documentation firs
t; enabling HSTS carelessly can cause serious, irreversible problems.',
        id='security.W004')
W005 =

Undocumented

Value
Warning('You have not set the SECURE_HSTS_INCLUDE_SUBDOMAINS setting to True. Wi
thout this, your site is potentially vulnerable to attack via an insecure connec
tion to a subdomain. Only set this to True if you are certain that all subdomain
s of your domain should be served exclusively via SSL.',
        id='security.W005')
W006 =

Undocumented

Value
Warning('Your SECURE_CONTENT_TYPE_NOSNIFF setting is not set to True, so your pa
ges will not be served with an \'X-Content-Type-Options: nosniff\' header. You s
hould consider enabling this header to prevent the browser from identifying cont
ent types incorrectly.',
        id='security.W006')
W008 =

Undocumented

Value
Warning('Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site s
hould be available over both SSL and non-SSL connections, you may want to either
 set this setting True or configure a load balancer or reverse-proxy server to r
edirect all connections to HTTPS.',
        id='security.W008')
W009 =

Undocumented

Value
Warning('Your SECRET_KEY has less than %(min_length)s characters, less than %(mi
n_unique_chars)s unique characters, or it\'s prefixed with \'%(insecure_prefix)s
\' indicating that it was generated automatically by Django. Please generate a l
ong and random SECRET_KEY, otherwise many of Django\'s security-critical feature
s will be vulnerable to attack.'%{'min_length': SECRET_KEY_MIN_LENGTH,
                                  'min_unique_chars': SECRET_KEY_MIN_UNIQUE_CHARACTERS
,
...
W018 =

Undocumented

Value
Warning('You should not have DEBUG set to True in deployment.',
        id='security.W018')
W019 =

Undocumented

Value
Warning('You have \'django.middleware.clickjacking.XFrameOptionsMiddleware\' in 
your MIDDLEWARE, but X_FRAME_OPTIONS is not set to \'DENY\'. Unless there is a g
ood reason for your site to serve other parts of itself in a frame, you should c
hange it to \'DENY\'.',
        id='security.W019')
W020 =

Undocumented

Value
Warning('ALLOWED_HOSTS must not be empty in deployment.',
        id='security.W020')
W021 =

Undocumented

Value
Warning('You have not set the SECURE_HSTS_PRELOAD setting to True. Without this,
 your site cannot be submitted to the browser preload list.',
        id='security.W021')
W022 =

Undocumented

Value
Warning('You have not set the SECURE_REFERRER_POLICY setting. Without this, your
 site will not send a Referrer-Policy header. You should consider enabling this 
header to protect user privacy.',
        id='security.W022')
def _security_middleware():

Undocumented

def _xframe_middleware():

Undocumented

@register(Tags.security, deploy=True)
def check_allowed_hosts(app_configs, **kwargs):

Undocumented

@register(Tags.security, deploy=True)
def check_content_type_nosniff(app_configs, **kwargs):

Undocumented

@register(Tags.security, deploy=True)
def check_cross_origin_opener_policy(app_configs, **kwargs):

Undocumented

@register(Tags.security, deploy=True)
def check_debug(app_configs, **kwargs):

Undocumented

@register(Tags.security, deploy=True)
def check_referrer_policy(app_configs, **kwargs):

Undocumented

@register(Tags.security, deploy=True)
def check_secret_key(app_configs, **kwargs):

Undocumented

@register(Tags.security, deploy=True)
def check_security_middleware(app_configs, **kwargs):

Undocumented

@register(Tags.security, deploy=True)
def check_ssl_redirect(app_configs, **kwargs):

Undocumented

@register(Tags.security, deploy=True)
def check_sts(app_configs, **kwargs):

Undocumented

@register(Tags.security, deploy=True)
def check_sts_include_subdomains(app_configs, **kwargs):

Undocumented

@register(Tags.security, deploy=True)
def check_sts_preload(app_configs, **kwargs):

Undocumented

@register(Tags.security, deploy=True)
def check_xframe_deny(app_configs, **kwargs):

Undocumented

@register(Tags.security, deploy=True)
def check_xframe_options_middleware(app_configs, **kwargs):

Undocumented