BitzOrcas configures CORS and security headers through ASP.NET Core’s standard middleware pipeline.
CORS policy
// Configured in ApiPipelineRegistration// Development: permissive for local development// Production: restrict to known originsConfiguration
{ "Cors": { "AllowedOrigins": ["https://app.example.com", "https://admin.example.com"], "AllowedMethods": ["GET", "POST", "PUT", "PATCH", "DELETE"], "AllowedHeaders": ["Content-Type", "Authorization", "X-Idempotency-Key", "X-Correlation-Id", "X-Signature", "X-API-Key"], "AllowCredentials": true, "MaxAgeSeconds": 3600 }}Security headers
Recommended security headers for production:
X-Content-Type-Options: nosniffX-Frame-Options: DENYX-XSS-Protection: 0 (deprecated, prefer CSP)Referrer-Policy: strict-origin-when-cross-originContent-Security-Policy: default-src 'none'; frame-ancestors 'none'Permissions-Policy: camera=(), microphone=(), geolocation=()Nonce store
BitzOrcas registers a nonce store for HMAC anti-replay:
services.AddSingleton<INonceStore, MemoryNonceStore>();Custom headers
| Header | Direction | Purpose |
|---|---|---|
X-Correlation-Id | Response | Request correlation identifier |
X-Tenant-Id | Response (debug) | Resolved tenant identifier |
Retry-After | Response (429) | Seconds until retry allowed |
See also
- Production checklist — Deployment security setup