|
25 | 25 | "^otp.*", # One-Time Passwords or related values |
26 | 26 | ] |
27 | 27 |
|
28 | | -DEFAULT_SENSITIVE_HEADERS = ( |
29 | | - [ |
30 | | - "Authorization", # Tokens and credentials |
31 | | - "Cookie", # User session identifiers |
32 | | - "Set-Cookie", # Server set session identifiers |
33 | | - "X-API-Key", # API keys |
34 | | - "X-CSRFToken", # CSRF tokens |
35 | | - "Proxy-Authorization", # Credentials for a proxy connection |
36 | | - "If-None-Match", # Can be used for cache fingerprinting |
37 | | - "Server", # Can reveal specifics about the server |
38 | | - "WWW-Authenticate", # Authentication method details |
39 | | - "X-Correlation-ID", # Correlation IDs for logging |
40 | | - "X-Frame-Options", # Security-related header |
41 | | - "Strict-Transport-Security", # Security-related header |
42 | | - "X-XSS-Protection", # Security-related header |
43 | | - "X-Content-Type-Options", # Security-related header |
44 | | - "X-Download-Options", # Security-related header |
45 | | - "X-Permitted-Cross-Domain-Policies", # Security-related header |
46 | | - ], |
47 | | -) |
| 28 | +DEFAULT_SENSITIVE_HEADERS = [ |
| 29 | + "Authorization", # Tokens and credentials |
| 30 | + "Cookie", # User session identifiers |
| 31 | + "Set-Cookie", # Server set session identifiers |
| 32 | + "X-API-Key", # API keys |
| 33 | + "X-CSRFToken", # CSRF tokens |
| 34 | + "Proxy-Authorization", # Credentials for a proxy connection |
| 35 | + "If-None-Match", # Can be used for cache fingerprinting |
| 36 | + "Server", # Can reveal specifics about the server |
| 37 | + "WWW-Authenticate", # Authentication method details |
| 38 | + "X-Correlation-ID", # Correlation IDs for logging |
| 39 | + "X-Frame-Options", # Security-related header |
| 40 | + "Strict-Transport-Security", # Security-related header |
| 41 | + "X-XSS-Protection", # Security-related header |
| 42 | + "X-Content-Type-Options", # Security-related header |
| 43 | + "X-Download-Options", # Security-related header |
| 44 | + "X-Permitted-Cross-Domain-Policies", # Security-related header |
| 45 | +] |
48 | 46 |
|
49 | 47 | LOG_MAX_STR_LEN = getattr(settings, "LOG_MAX_STR_LEN", 200) |
50 | 48 | LOG_MAX_LIST_LEN = getattr(settings, "LOG_MAX_LIST_LEN", 10) |
51 | 49 | LOG_EXCLUDED_ENDPOINTS = getattr(settings, "LOG_EXCLUDED_ENDPOINTS", []) |
52 | 50 | LOG_SENSITIVE_KEYS = getattr(settings, "LOG_SENSITIVE_KEYS", DEFAULT_SENSITIVE_KEYS) |
53 | | -LOG_MASK_STYLE = getattr(settings, "LOG_MASK_STYLE", "partially") |
| 51 | +LOG_MASK_STYLE = getattr(settings, "LOG_MASK_STYLE", "partial") |
54 | 52 | LOG_MIDDLEWARE_ENABLED = getattr(settings, "LOG_MIDDLEWARE_ENABLED", True) |
55 | 53 | LOG_EXCLUDED_HEADERS = getattr( |
56 | 54 | settings, "LOG_EXCLUDED_HEADERS", DEFAULT_SENSITIVE_HEADERS |
|
0 commit comments