Operations & monitoring
Monitor readiness, run background maintenance, manage encryption keys and respond to incidents.
On this page
Operators maintain the database, queue, encryption-key access, background jobs and identity integration. Organisation administrators manage access and policy in the console; these deployment tasks require access to the backend runtime.
Monitor health#
/health/reports process liveness without checking dependencies./readyz/checks PostgreSQL, Redis and the server key./v1/status/provides the console's service-status information./metrics/exposes Prometheus metrics whenMATII_METRICS_TOKENis configured. Authenticate withAuthorization: Bearer <metrics-token>.
Through the bundled nginx, prefix these paths with /service. Use readiness for routing traffic and liveness for detecting a stopped process. Monitor failed decryption, job failures and delivery backlogs alongside HTTP status.
Set MATII_LOG_FORMAT=json for structured logs. Password Manager can emit security-event counters and signed password_manager.* events. Helm includes optional Grafana dashboards and Prometheus Operator rules.
Keep workers and delivery running#
The queue worker runs python manage.py rqworker default for sync and background work. The independent events process runs python manage.py matii_dispatch_events for signed webhook and log-stream delivery.
Production Compose includes both services. The development stack has a queue worker but does not start the event dispatcher or all scheduled maintenance automatically. To process an event batch manually from an appropriately configured backend runtime:
python manage.py matii_dispatch_events --once
Review failed deliveries in Integrations → Webhooks or Log Streams. Correct receiver authentication or network access before replaying deliveries. Delivery is at least once, so receivers should deduplicate event IDs. See Events & webhooks.
Schedule maintenance#
The Helm chart provides CronJobs. A Compose installation needs an external scheduler for the equivalent commands:
matii_run_rotations: starts due rotations and finishes retirement after grace periods; the default Helm schedule runs every five minutes.matii_rotation_reminders: creates reminders for secrets approaching their rotation date.matii_expire_access: removes expired temporary grants and their key access.matii_purge_tokens: cleans up expired token records according to the configured grace period.matii_reconcile_memberships: removes access missing from linked Matii Auth organisations; use--dry-runwhen reviewing reconciliation.matii_prune_events: removes eligible delivered outbox events according to retention settings.matii_pm_purge: cleans up password-manager tombstones, expired devices and events, orphan attachments and applicable departed-vault retention.clearsessions: removes expired Django sessions.
Run commands as python manage.py <command> from the backend environment. Use each command's --help before scheduling it, especially commands that prune records. Audit retention and event-delivery retention are separate settings.
Manage encryption keys#
The server root key protects server-side encrypted data and deployment-managed credentials. AWS KMS and Vault/OpenBao Transit can protect the root key at rest. An organisation can additionally use its own KMS key through Settings → Organisation → Encryption key.
A root-key rotation changes the wrapping key; it does not rotate every secret or replace each environment key. Rehearse it on a restored copy first:
- Back up the database and preserve the old key.
- Configure a new current key and the old key as a previous key for the selected provider.
- Roll out backend, worker and dispatcher workloads with that configuration.
- Check, rewrap and verify the existing records.
python manage.py matii_server_key check
python manage.py matii_server_key status
python manage.py matii_server_key rewrap
python manage.py matii_server_key verify
Only after verification succeeds should you remove the previous-key configuration, roll out again and run matii_server_key retire. Retain the old key in secure escrow for backups that still need it.
Password Manager's optional server-assisted passkey shares are not yet resealed by this rotation job. Members using that method must re-enrol before the old key is retired. Normal PRF passkey unlock has a different key model.
Environment re-keying is a separate operation in Manage environment → Environment key. If someone may already know a secret value, rotate the value at its provider too. See Encryption.
Respond to exposed credentials#
For a leaked personal or service-account token, revoke it, review its audit activity, rotate the values it could reveal and issue a replacement with narrower or shorter-lived access.
For a compromised member account, suspend identity access, confirm console sessions and tokens are revoked, review app and shared-vault access, and rotate affected credentials. Removing a member does not erase values they already copied.
For suspected root-key exposure, treat server-side secret values and integration credentials as exposed. Restrict key-provider access, review its audit trail, rotate affected credentials and perform coordinated root-key and environment-key rotation.
For a Redis compromise, isolate it, rotate its credentials, rebuild workers and investigate worker access. Redis is a job queue, not just a disposable performance cache.
Recover from dependency failures#
An unavailable database makes the API unavailable. Redis failures interrupt queues and some write-side work. If a KMS becomes unreachable, a running process may still hold its cached key while a new process fails readiness; restore the configured provider instead of substituting a different key.
After a recovery or database restore, follow Backup & recovery before reopening integrations.