-
Notifications
You must be signed in to change notification settings - Fork 2
Technical Configuration
Cairn reads its entire configuration from the environment. .env.example is the
template : copy it to .env and edit. Nothing is configured in a database table
that an operator needs to reach before first boot, and nothing needs a rebuild.
The exhaustive list, generated from the settings modules themselves, is reference/generated/settings.md. This page covers what to think about rather than what exists.
| Variable | Why |
|---|---|
SECRET_KEY |
Signs sessions, password-reset links and Trust Center download links. The shipped default is a placeholder; a deployment that keeps it can have its sessions forged. Generate 50+ random characters. |
DEBUG |
Must be False in production. Left on, a crash returns a full traceback page including settings and local variables. |
ALLOWED_HOSTS |
The hostnames the application answers on. A wildcard reopens the Host-header attacks Django's check exists to close. |
POSTGRES_PASSWORD |
The compose file ships postgres/postgres. |
PostgreSQL and Redis are both required. Redis is not a cache you can skip : it carries the Channels layer and the cross-worker locks, and the reasons are in architecture.md.
POSTGRES_DB=cairn
POSTGRES_USER=cairn
POSTGRES_PASSWORD=<generated>
POSTGRES_HOST=db
POSTGRES_PORT=5432
REDIS_HOST=redis
REDIS_PORT=6379Cairn trusts X-Forwarded-Proto (SECURE_PROXY_SSL_HEADER), so the proxy must
set it and must not let a client forge it.
ALLOWED_HOSTS=grc.example.com
CSRF_TRUSTED_ORIGINS=https://grc.example.com
SITE_URL=https://grc.example.comSITE_URL is what makes links in notification and invitation emails absolute.
Leave it empty and the links are relative, which means they do not work in a
mail client.
Every hardening flag defaults to off, so upgrading an HTTP-only deployment never breaks it. Turn them on once TLS terminates in front of the application, in this order, checking that you can still sign in between each step.
SESSION_COOKIE_SECURE=True
CSRF_COOKIE_SECURE=True
SECURE_SSL_REDIRECT=True
SECURE_HSTS_SECONDS=31536000
SECURE_HSTS_INCLUDE_SUBDOMAINS=True
SECURE_HSTS_PRELOAD=TrueHSTS is last and deserves a pause : a browser remembers it for the whole
max-age even after you unset the header, so a wrong value locks your own users
out of an HTTP fallback for a year. Start with a short SECURE_HSTS_SECONDS
(say 300), confirm, then raise it.
Run python manage.py check --deploy to have Django audit the result.
Notifications, invitations and password resets go out by email. Under DEBUG
the console backend prints them instead, so no SMTP is needed in development.
EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST=smtp.example.com
EMAIL_PORT=587
EMAIL_HOST_USER=cairn@example.com
EMAIL_HOST_PASSWORD=<secret>
EMAIL_USE_TLS=True
DEFAULT_FROM_EMAIL=cairn@example.comWEBAUTHN_RP_ID and WEBAUTHN_ORIGIN are derived from the request when unset,
which is correct for a single-domain deployment. Set them explicitly behind a
proxy that rewrites the host, otherwise the browser refuses the credential
because the relying-party id does not match what it sees.
Setting TRUST_CENTER_HOST turns on host isolation : on that hostname only the
public Trust Center is reachable, and the application, the admin and the
internal API return 404. Add the host to ALLOWED_HOSTS and its https origin to
CSRF_TRUSTED_ORIGINS.
TRUST_CENTER_HOST=trust.example.com
TRUST_CENTER_DOWNLOAD_TTL=604800Off by default, and deliberately so : enabling it sends the question text and
the compact record fields used for routing to the configured provider. Choose
the provider with that in mind; ollama keeps everything on your own
infrastructure.
AI_ASSISTANT_ENABLED=True
AI_ASSISTANT_PROVIDER=mistral # or openai, anthropic, ollama
AI_ASSISTANT_API_KEY=<secret>
AI_ASSISTANT_MODEL=mistral-small-latestProvider setup, model guidance and the data-egress detail are in the assistant specification. The tuning knobs (timeouts, tool rounds, record caps, token ceiling) are listed in the generated settings reference; their defaults are conservative on purpose, so a slow provider degrades the command palette rather than the whole application.
DJANGO_SUPERUSER_EMAIL and DJANGO_SUPERUSER_PASSWORD are read by the
container entrypoint, not by the settings, and create an administrator on first
startup. They are an alternative to the
first-run onboarding screen, which is the
better path for a human operator because it also configures the company.
Built from docs/ at v0.36.0. Edits made here are overwritten by the next release : open a pull request against the source instead.
- Administration
- Ask Cairn
- Assets and suppliers
- Compliance
- The dashboard
- Finding your way
- Getting started
- Incidents
- How records move
- Organisational context
- Reports and management review
- Risks
- Trust Center
- Architecture
- Configuration
- Contributing
- The documentation system
- Installation
- Internationalisation
- Operations
- Release process
- Security
- Testing
- Adding an assistant provider
- Adding a dashboard widget
- Adding a domain entity
- Declaring a lifecycle
- Adding an MCP tool
- Adding a REST endpoint
- Adding a report
- Interface conventions
- Dashboard widgets
- Lifecycles
- MCP tools
- MCP tool parameters : Assets
- MCP tool parameters : Compliance
- MCP tool parameters : Governance and context
- MCP tool parameters : General
- MCP tool parameters : Incidents
- MCP tool parameters : Reports and management review
- MCP tool parameters : Risks
- MCP tool parameters : System and administration
- MCP tool parameters : Trust Center
- Management commands
- Models
- Permissions
- REST endpoints
- Environment variables
- MCP server
- REST API
- Assistant module (Ask Cairn)
- Module 0: User Management and Access Control
- Module 1: Context and Organization
- Module 2: Asset Management
- Module 3: Compliance
- Module 4: Risk Management
- Module 4 bis - EBIOS Risk Manager
- Module 5 : Trust Center
- Module 6 : Security Incident Management
- Management review : ISO 27001:2022 compliance (clause 9.3)