# Security

> [!NOTE]
>
> **Info**
>
> To report a security vulnerability, please file a [Private Security Report](<https://github.com/ellanetworks/psap/security/advisories/new>).

Ella PSAP holds callers' numbers, messages and locations, so access to it is by user, by role, and recorded.

## Authentication & Authorization

Ella PSAP enforces authentication on API requests towards most endpoints. Two authentication methods are supported:

- **Session-based authentication.** Users authenticate with email and password, or through [single sign-on](<https://docs.ellanetworks.com/psap/explanation/single_sign_on/index.md>). A session cookie and a short-lived access token are issued. The login endpoint limits attempts per client address and per account.
- **API tokens.** For programs, held by admins and dispatch systems only. Each can expire and be revoked.

### Role-Based Access Control

Every request is authorized against one of three roles.

| Role | Scope |
| --- | --- |
| **Admin** | Everything: connections, retention, users, and what a Call Taker does. |
| **Call Taker** | Handles incidents: answers and returns calls, reads and replies to texts, sees the caller's location, merges and closes incidents. |
| **Dispatch System** | Reads incidents, with an API token. It has no password and cannot log in. |

## Secret Storage

- **User passwords** are stored as one-way hashes. Verification uses constant-time comparison.
- **API token secrets** are stored as one-way hashes. The raw token is returned only once at creation time and is never retrievable afterward.
- **Session tokens** are cryptographically random values. Only a one-way hash is persisted.
- **JWT signing secret** is a cryptographically random value generated once and stored in the database.

## Transport Security

### API and UI

Ella PSAP uses TLS to secure its API and web interface. The TLS configuration is defined in the [configuration file](<https://docs.ellanetworks.com/psap/reference/config_file/index.md>).

### SMSCs

Ella PSAP can bind to an SMSC over TLS, with a client certificate for mutual TLS. See [SMSCs](<https://docs.ellanetworks.com/psap/reference/api/smscs/index.md>).

## Audit Logging

Ella PSAP records an audit event for every login, every change to its settings and users, and every action a user takes on an incident, call or text. Each records who did what, when, and from which address. A reply's event names the user and the caller's number, not the message.

Admins read the events in Ella PSAP or through the [audit logs API](<https://docs.ellanetworks.com/psap/reference/api/audit_logs/index.md>). They are also written to the log output. Ella PSAP keeps them for the audit log retention, 31 days by default, which is set apart from the incidents' retention, so an agency can keep its audit trail longer than its incidents.
