Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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
2 changes: 2 additions & 0 deletions backend/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,5 @@ class Base(Configuration):
SLACK_COMMANDS_ENABLED = True
SLACK_EVENTS_ENABLED = True
SLACK_SIGNING_SECRET = values.SecretValue()

SECURE_CONTENT_TYPE_NOSNIFF = True
6 changes: 6 additions & 0 deletions backend/settings/graphql.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""GraphQL schema."""

import strawberry
from django.conf import settings
from strawberry.extensions import QueryDepthLimiter
from strawberry.schema.config import StrawberryConfig
from strawberry_django.optimizer import DjangoOptimizerExtension

from apps.api.internal.mutations import ApiMutations
Expand Down Expand Up @@ -46,4 +48,8 @@ class Query(
mutation=Mutation,
query=Query,
extensions=[QueryDepthLimiter(max_depth=5), DjangoOptimizerExtension()],
config=StrawberryConfig(
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Outdated
enable_introspection=settings.DEBUG
or getattr(settings, "IS_FUZZ_ENVIRONMENT", False)
),
)
7 changes: 7 additions & 0 deletions backend/settings/production.py
Comment thread
ScienHAC marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ class Production(Base):

SLACK_COMMANDS_ENABLED = True
SLACK_EVENTS_ENABLED = True

# Security

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A believe a more reasonable default would be to have security settings shared by staging/production via base.py and have them overridden in local as needed.

SECURE_HSTS_SECONDS = 31536000
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_HSTS_PRELOAD = True
SECURE_SSL_REDIRECT = True
Comment thread
ScienHAC marked this conversation as resolved.
Outdated

Copilot AI Feb 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The staging environment (backend/settings/staging.py) should also include the same HSTS and SSL security settings as production. Staging environments typically serve over HTTPS with valid certificates and should mirror production security configurations to catch issues before they reach production. Consider adding the same SECURE_HSTS_SECONDS, SECURE_HSTS_INCLUDE_SUBDOMAINS, SECURE_HSTS_PRELOAD, and SECURE_SSL_REDIRECT settings to staging.py.

Copilot uses AI. Check for mistakes.
SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https")