Security model
What the API does to protect a deployment and its data, as the code does it today. To report a vulnerability, follow SECURITY.md.
Sign-in and passwords
- Passwords are stored as bcrypt hashes.
POST /api/v1/auth/loginandPOST /api/v1/auth/tokeneach take 10 requests a minute from one IP address; the next request in that minute is answered429 Too Many Requests.- In
stagingandproduction, the API does not start with aSECRET_KEYshorter than 32 characters, or with a well-knownFIRST_SUPERUSER_PASSWORDsuch as the demo one.
Roles
- A signed-in user's role,
ADMIN,DEVELOPER,ANALYSTorVIEWER, and a separate superuser flag decide what the user may do (RBAC). ANALYSTandVIEWERcannot create, change or delete experiments or feature flags.- Every role,
VIEWERincluded, can create an API key for itself, and an API key writes tracking data: assignments and events.
API keys
- An API key is stored only as a hash. Its value is shown once, in the response that creates it.
- A request that carries an API key and no sign-in is refused with
401by the routes that manage experiments, feature flags and users. - A deleted or expired key is refused with
401.
Response headers
- Every response except a CORS preflight carries
X-Frame-Options: DENY,X-Content-Type-Options: nosniffandContent-Security-Policy: default-src 'none'; frame-ancestors 'none'. - The two API reference pages,
/api/v1/docsand/api/v1/redoc, get a policy that also allows the scripts, styles and fonts they load. - Outside development, every response except a CORS preflight also carries
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload.