Credentials & Secrets
How FileRelay encrypts destination secrets and SAP credentials, and how to rotate each authentication type without downtime.
Storage
All secrets — destination credentials, SAP passwords, OAuth client secrets and refresh tokens — are encrypted before they reach the database:
- Per-user keys — each secret is encrypted under its owning user's key, so one compromised row or key doesn't open every workspace.
- Bound to the record — encryption carries the record identity (workspace + field), so ciphertext copied to another row won't decrypt.
- Rotation-safe reads — rows written by older formats keep working until re-saved; no flag day.
Protect the APP_KEY like production infrastructure: it is the root of this scheme. Back it up, restrict who can read the environment, and never paste ciphertext or keys into chat, tickets, or screen shares.
What lives where
| Secret | Where | Notes |
|---|---|---|
| Entra client secrets | Destination credentials | Prefer certificates; secret is the fallback |
| Azure SAS tokens | Destination credentials | Time-boxed by nature — regenerate on schedule |
| Storage account keys | Destination credentials | Compatibility/testing; prefer Entra or SAS |
| OAuth refresh tokens | Source credentials | Refreshed automatically; rotation = paste new value |
| SAP passwords | Repository credentials | Per repository, not per workspace |
| CARA auth tokens | Destination credentials | Long-lived; rotate in CARA, paste here |
| Webhook header secrets | Workspace notification settings | Sent as headers on every notification |
Rotation without downtime
Every integration reads its secret fresh on each request: paste the new value and the next delivery, poll, or notification uses it. No restarts, no re-tests required (though re-running Test is good hygiene).
Per-type guidance:
- Entra app secrets — create the new secret in Entra before removing the old one; overlap avoids a gap. Prefer moving to certificate auth at rotation time.
- OAuth (OData/Box/Google) — UAA and IdP tokens (~12 h) refresh automatically. Only the stored client secret / refresh token needs manual rotation.
- SAS tokens — generate the replacement with an overlapping validity window, paste, then revoke the old one.
- SMB service accounts — coordinate with the AD password policy (or use a managed service account); update the destination the same day.
Least privilege
- SharePoint/OneDrive/Teams: app-only with
Sites.Selectedwhere practical. - Azure: Storage Blob/File Data roles scoped to the container or share — never account-wide.
- CARA: a dedicated service user with only the needed type permissions.
- SMB: write-only-where-needed; share + NTFS layers both scoped.
What never reaches the screen
Delivery failure messages are trimmed and scrubbed — OAuth error_description fields, which often echo secrets back on bad auth, are redacted before the message lands on the delivery row.