Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/firetower/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,19 @@
CSRF_TRUSTED_ORIGINS = [
"http://localhost:5173",
"https://firetower.getsentry.net",
"https://*.firetower.getsentry.net",
"https://test.firetower.getsentry.net",
]

CORS_ALLOW_CREDENTIALS = True

if not env_is_dev():
SECURE_SSL_REDIRECT = True
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")
SECURE_HSTS_SECONDS = 3600

Check warning on line 98 in src/firetower/settings.py

View check run for this annotation

@sentry/warden / warden: find-bugs

HSTS max-age of 1 hour provides insufficient protection against SSL stripping attacks

The SECURE_HSTS_SECONDS is set to 3600 (1 hour), which is significantly below security best practices. OWASP recommends a minimum of 1 year (31536000 seconds) for effective HSTS protection. With only 1 hour, an attacker can perform SSL stripping attacks after waiting for the short HSTS policy to expire from a user's browser cache.
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True

# Application definition

INSTALLED_APPS = [
Expand Down
Loading