Skip to content
Merged
Changes from all commits
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
9 changes: 8 additions & 1 deletion src/firetower/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,18 @@
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")
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True

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

View workflow job for this annotation

GitHub Actions / warden: code-review

HSTS security setting mentioned in PR description but not implemented

The PR description states '1-hour HSTS' should be added, but no SECURE_HSTS_SECONDS setting is present in the code. Without HSTS, browsers won't be instructed to only use HTTPS for future requests, leaving users vulnerable to SSL stripping attacks during the first connection.

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

View workflow job for this annotation

GitHub Actions / warden: find-bugs

Missing HSTS configuration despite PR description claiming it was added

The PR description states '1-hour HSTS' should be added, but the code changes do not include SECURE_HSTS_SECONDS, SECURE_HSTS_INCLUDE_SUBDOMAINS, or SECURE_HSTS_PRELOAD settings. Without HSTS, browsers can be tricked into connecting over HTTP initially, exposing the application to SSL stripping attacks. This is a discrepancy between documented changes and actual implementation.

# Application definition

INSTALLED_APPS = [
Expand Down
Loading