Superset Security Configuration#
Superset's production security posture is controlled by a handful of settings in superset/config.py and enforced at startup. All settings can be overridden in a local superset_config.py.
SECRET_KEY#
The SECRET_KEY is used to sign session cookies and encrypt sensitive data. The default falls back to the CHANGE_ME_SECRET_KEY constant ("CHANGE_ME_TO_A_COMPLEX_RANDOM_SECRET") if the SUPERSET_SECRET_KEY environment variable is unset .
Startup enforcement: On every init_app(), Superset calls check_secret_key(). In debug/test mode it logs a prominent warning banner; in production it calls sys.exit(1) — the application refuses to start with a default key .
Distributed deployments: All web server pods and Celery worker pods must share the identical SECRET_KEY. A mismatch causes workers to fail session decryption, which surfaces as misleading "Invalid login" errors rather than a clear configuration error .
DEBUG Flag#
DEBUG is derived from the FLASK_DEBUG environment variable at startup . It controls two orthogonal behaviors:
Error Rendering#
When DEBUG=False and a browser (HTML-accepting) client encounters a 404 or 500, Superset serves a pre-built static HTML error page (404.html / 500.html). When DEBUG=True, it returns a JSON response instead. In both cases, stack traces are never sent to the client — they are always logged server-side via exc_info=True .
This pattern applies consistently across three handlers in error_handling.py: HTTPException (line 163), CommandException (line 188), and the catch-all Exception handler (line 211).
CSP / Talisman Config Selection#
During middleware initialization, DEBUG=True selects TALISMAN_DEV_CONFIG (which permits 'unsafe-inline' and 'unsafe-eval' for React hot-reload), while production uses the stricter TALISMAN_CONFIG .
Flask-Talisman and CSP#
Flask-Talisman enforces HTTP security headers and Content Security Policy. It is disabled by default (TALISMAN_ENABLED = False) and must be explicitly enabled for production.
Key defaults in TALISMAN_CONFIG:
script-src:'self'+'strict-dynamic'with per-request noncesobject-src:'none'force_https:False(intentional — see Reverse Proxy section below)session_cookie_secure:False
When Talisman is disabled, Superset logs a startup warning urging operators to configure CSP via an alternative mechanism . Override TALISMAN_CONFIG in superset_config.py to customize; see the official networking docs for guidance .
Session Cookie Configuration#
Defaults in config.py :
| Setting | Default | Notes |
|---|---|---|
SESSION_COOKIE_HTTPONLY | True | Blocks JavaScript access to the session cookie |
SESSION_COOKIE_SECURE | False | When True, cookies are only sent over HTTPS |
SESSION_COOKIE_SAMESITE | "Lax" | Provides CSRF protection for cross-site navigations |
Warning: Setting
SESSION_COOKIE_SECURE = Truewhile Celery workers call Superset over plain HTTP (e.g.,WEBDRIVER_BASEURL = "http://...") will cause session cookies to be silently dropped, breaking Alerts & Reports screenshot generation .
CSRF Protection#
CSRF is enabled by default (WTF_CSRF_ENABLED = True) with a one-week token lifetime . A small set of API endpoints are exempt :
superset.views.core.logsuperset.views.core.explore_jsonsuperset.charts.data.api.datasuperset.dashboards.api.cache_dashboard_screenshot
Reverse Proxy / Distributed Deployment Consistency#
When TLS is terminated at a proxy (nginx, Traefik, etc.):
ENABLE_PROXY_FIX = True— required so Flask reconstructs the correct scheme and client IP fromX-Forwarded-*headers .force_https: Falsein Talisman — do not set this toTruebehind a TLS-terminating proxy; it creates redirect loops and breaks Celery worker calls .WEBDRIVER_BASEURL(defaulthttp://0.0.0.0:8080/) — the internal URL used by Celery workers. Keep this ashttp://if TLS is terminated at the proxy .WEBDRIVER_BASEURL_USER_FRIENDLY— set this to the external HTTPS URL so notification emails contain valid links .- Identical
SECRET_KEYandSQLALCHEMY_DATABASE_URIacross all web and worker pods — mismatches cause silent session decryption failures .
Quick Reference: Key Security Settings#
| Setting | Default | File / Lines |
|---|---|---|
SECRET_KEY | CHANGE_ME_SECRET_KEY | config.py:195 |
DEBUG | False (from FLASK_DEBUG) | config.py:277 |
TALISMAN_ENABLED | False | config.py:1637-1638 |
TALISMAN_CONFIG | (production CSP) | config.py:1644-1674 |
TALISMAN_DEV_CONFIG | (relaxed CSP) | config.py:1676-1706 |
SESSION_COOKIE_HTTPONLY | True | config.py:1714 |
SESSION_COOKIE_SECURE | False | config.py:1715 |
SESSION_COOKIE_SAMESITE | "Lax" | config.py:1716 |
WTF_CSRF_ENABLED | True | config.py:266 |
ENABLE_PROXY_FIX | False | config.py:289-292 |
WEBDRIVER_BASEURL | http://0.0.0.0:8080/ | config.py:1549-1551 |