ó
i4Vdc           @   sp  d  d l  m Z d d l m Z m Z m Z d Z d Z e d d d Z e d	 d d
 Z	 e d d d Z
 e d d d Z e d d d Z e d d d Z e d d d Z e d i e d 6e d 6d d Z e d d d Z e d d d Z e d d d Z d   Z d    Z e e j d! e d"    Z e e j d! e d#    Z e e j d! e d$    Z e e j d! e d%    Z e e j d! e d&    Z e e j d! e d'    Z e e j d! e d(    Z e e j d! e d)    Z e e j d! e d*    Z e e j d! e d+    Z  e e j d! e d,    Z! d- S(.   i˙˙˙˙(   t   settingsi   (   t   Tagst   Warningt   registeri2   i   sä   You do not have 'django.middleware.security.SecurityMiddleware' in your MIDDLEWARE_CLASSES so the SECURE_HSTS_SECONDS, SECURE_CONTENT_TYPE_NOSNIFF, SECURE_BROWSER_XSS_FILTER, and SECURE_SSL_REDIRECT settings will have no effect.t   ids   security.W001s;  You do not have 'django.middleware.clickjacking.XFrameOptionsMiddleware' in your MIDDLEWARE_CLASSES, so your pages will not be served with an 'x-frame-options' 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.s   security.W002s,  You have not set a value for the SECURE_HSTS_SECONDS setting. If your entire 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 first; enabling HSTS carelessly can cause serious, irreversible problems.s   security.W004s  You have not set the SECURE_HSTS_INCLUDE_SUBDOMAINS setting to True. Without this, your site is potentially vulnerable to attack via an insecure connection to a subdomain. Only set this to True if you are certain that all subdomains of your domain should be served exclusively via SSL.s   security.W005sű   Your SECURE_CONTENT_TYPE_NOSNIFF setting is not set to True, so your pages will not be served with an 'x-content-type-options: nosniff' header. You should consider enabling this header to prevent the browser from identifying content types incorrectly.s   security.W006sü   Your SECURE_BROWSER_XSS_FILTER setting is not set to True, so your pages will not be served with an 'x-xss-protection: 1; mode=block' header. You should consider enabling this header to activate the browser's XSS filtering and help prevent XSS attacks.s   security.W007s  Your SECURE_SSL_REDIRECT setting is not set to True. Unless your site should 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 redirect all connections to HTTPS.s   security.W008sî   Your SECRET_KEY has less than %(min_length)s characters or less than %(min_unique_chars)s unique characters. Please generate a long and random SECRET_KEY, otherwise many of Django's security-critical features will be vulnerable to attack.t
   min_lengtht   min_unique_charss   security.W009s4   You should not have DEBUG set to True in deployment.s   security.W018s  You have 'django.middleware.clickjacking.XFrameOptionsMiddleware' in your MIDDLEWARE_CLASSES, but X_FRAME_OPTIONS is not set to 'DENY'. The default is 'SAMEORIGIN', but unless there is a good reason for your site to serve other parts of itself in a frame, you should change it to 'DENY'.s   security.W019s.   ALLOWED_HOSTS must not be empty in deployment.s   security.W020c           C   s   d t  j k S(   Ns-   django.middleware.security.SecurityMiddleware(   R    t   MIDDLEWARE_CLASSES(    (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/core/checks/security/base.pyt   _security_middlewareh   s    c           C   s   d t  j k S(   Ns6   django.middleware.clickjacking.XFrameOptionsMiddleware(   R    R   (    (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/core/checks/security/base.pyt   _xframe_middlewarel   s    t   deployc         K   s   t    } | r g  St g S(   N(   R   t   W001(   t   app_configst   kwargst   passed_check(    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/core/checks/security/base.pyt   check_security_middlewarep   s    	c         K   s   t    } | r g  St g S(   N(   R	   t   W002(   R   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/core/checks/security/base.pyt   check_xframe_options_middlewarev   s    	c         K   s$   t    p t j } | r g  St g S(   N(   R   R    t   SECURE_HSTS_SECONDSt   W004(   R   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/core/checks/security/base.pyt	   check_sts|   s    c         K   s4   t    p  t j p  t j t k } | r- g  St g S(   N(   R   R    R   t   SECURE_HSTS_INCLUDE_SUBDOMAINSt   Truet   W005(   R   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/core/checks/security/base.pyt   check_sts_include_subdomains   s    

c         K   s*   t    p t j t k } | r# g  St g S(   N(   R   R    t   SECURE_CONTENT_TYPE_NOSNIFFR   t   W006(   R   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/core/checks/security/base.pyt   check_content_type_nosniff   s    
c         K   s*   t    p t j t k } | r# g  St g S(   N(   R   R    t   SECURE_BROWSER_XSS_FILTERR   t   W007(   R   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/core/checks/security/base.pyt   check_xss_filter   s    
c         K   s*   t    p t j t k } | r# g  St g S(   N(   R   R    t   SECURE_SSL_REDIRECTR   t   W008(   R   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/core/checks/security/base.pyt   check_ssl_redirect   s    
c         K   sS   t  t d d   o? t t t j   t k o? t t j  t k } | rL g  St g S(   Nt
   SECRET_KEY(	   t   getattrR    t   Nonet   lent   setR"   t    SECRET_KEY_MIN_UNIQUE_CHARACTERSt   SECRET_KEY_MIN_LENGTHt   W009(   R   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/core/checks/security/base.pyt   check_secret_key§   s    c         K   s   t  j } | r g  St g S(   N(   R    t   DEBUGt   W018(   R   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/core/checks/security/base.pyt   check_debugą   s    
c         K   s*   t    p t j d k } | r# g  St g S(   Nt   DENY(   R	   R    t   X_FRAME_OPTIONSt   W019(   R   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/core/checks/security/base.pyt   check_xframe_denyˇ   s    
c         K   s   t  j r g  St g S(   N(   R    t   ALLOWED_HOSTSt   W020(   R   R   (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/core/checks/security/base.pyt   check_allowed_hostsŔ   s    N("   t   django.confR    t    R   R   R   R(   R'   R   R   R   R   R   R   R    R)   R,   R0   R3   R   R	   t   securityR   R   R   R   R   R   R   R!   R*   R-   R1   R4   (    (    (    sn   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/django/core/checks/security/base.pyt   <module>   sh   													
			
	