# Security A backup server holds a full copy of the tenant, so it is a high-value target. ## Access to Microsoft 365 - App-only access with **certificate** authentication (no client secrets). - **Separate app registrations per purpose**, created by the setup wizard (see {doc}`setup`): - *Backup app*: read-only permissions, used by scheduled jobs. - *Restore app*: write permissions, used only by restore jobs. - *Notifications app* (only if email goes through Graph): can only send as the `backup-alerts` mailbox, via a scoped Exchange RBAC role and no Entra permission at all (see {doc}`notifications`). - The wizard's delegated admin tokens (Graph and Exchange) are used once and never stored, so the app cannot change its own permissions without a new admin sign-in. - Least privilege: only the enabled modules' permissions; `Sites.Selected` and Exchange RBAC for Applications to narrow scope where possible. - The setup wizard checks granted permissions against what enabled modules need, and reports missing or excess grants. ## Access to the web app The server is meant to be reached from a LAN or VPN only. Securing network access to it (firewalls, no port forwarding from the internet) is the installer's responsibility: see {ref}`network-access`. The application does not limit request rates per address. Details in {doc}`authentication`. In short: - **Day to day: Entra ID sign-in** (OpenID Connect). Who may sign in, and with which role, is decided by **app role assignments** in Entra. - **Break-glass: local admin accounts** for when Microsoft 365 is down: password + TOTP (or one-time recovery code), lockout, optional network allow-list, an alert on every use, shorter sessions. - **First admin** needs a one-time setup token from the server log. - Server-side sessions, `HttpOnly`/`Secure`/`SameSite=Lax` cookie, CSRF token on every state-changing request. - Roles: `admin`, `operator` (jobs), `restore_operator` (browse/restore), `auditor` (read-only, audit log). - Browsing mailbox content is sensitive: optional "four-eyes" approval for restores/exports of another user's data (planned). ## Data protection - Repository encryption at rest (see {doc}`storage`). - Secrets (certificate private keys, S3 keys) encrypted in the DB with a key supplied via Docker secret / file, never baked into images. - TLS for all external traffic; Graph and S3 traffic is TLS. - Immutable storage option (S3 Object Lock). ## Audit Append-only audit log of sign-ins, setting changes, browse, restore, export and deletes, exportable as JSON and forwardable to syslog/SIEM. ## Supply chain - Pinned dependencies with hashes; Dependabot/Renovate. - Images built in CI, signed (cosign), with an SBOM; scanned (Trivy). - Containers run as non-root, read-only root filesystem, no added capabilities.