Skip to content
RedAssayDocs
Browse the docs

Reference / Security

Security model

How RedAssay separates tenants, authenticates people and keys, authorizes every request, and protects evidence, tokens and secrets.

On this page
  1. Tenant isolation
  2. Authentication
  3. Authorization
  4. Cross-site requests
  5. Evidence integrity
  6. Files
  7. Tokens and secrets
  8. User-supplied content
  9. Browser security headers
  10. Client IP addresses
  11. Rate limits
  12. What is reachable without signing in
  13. Analytics
  14. Known limits

Tenant isolation

Every table that holds customer data has an organization id, and every query filters by it. The organization is never taken from the request: it comes from the caller's session or from the API key, both resolved on the server. There is no parameter by which a caller can name another organization.

A record id from another organization behaves exactly like an id that does not exist: the response is 404. Ids passed inside a request body (an owner, a linked control, a linked task) are checked to belong to the caller's organization before anything is written.

This is tested rather than assumed. RedAssay's test suite calls every API route as a member of a second organization holding the first organization's ids, and fails if any response is a success or contains the other organization's data. A new route fails the suite until it is added to the sweep.

Authentication

  • People sign in without passwords: an emailed link valid for 1 hour for the admin app, or an emailed 6-digit code valid for 10 minutes for the employee portal. There are no passwords to leak or reuse.
  • Sessions are server-side records identified by a cookie. Deactivating a member deletes their sessions immediately.
  • API keys are ra_ followed by 48 random hex characters. Only a salted scrypt hash is stored, compared in constant time. Keys can expire, can be revoked, and stop working when their creator is deactivated.

Authorization

Every API route is declared with the permission it requires, and a shared wrapper refuses the request before the handler runs if the caller's roles (or the key's scopes) do not include it. The UI hides actions using the same permission list, but the server check is the one that counts.

Roles are fixed: owner, admin, auditor and employee. The auditor role is read-only by construction: it holds only read permissions, and the test suite verifies it is refused on every change. See the permission matrix.

  • API keys never outrank their creator. A key can use a permission only if it is among the key's scopes and its creator holds it right now. Demoting the creator narrows every key they made at once; deactivating them stops the keys.
  • Some actions need a person. An API key cannot create another API key, transfer ownership, delete the organization, use the employee portal or sign a document.
  • Only an owner can make someone an admin, by invitation or by changing roles. Nobody can change their own roles, and anyone else can only add or remove roles they hold themselves.
  • Separation of duties. Nobody who wrote or edited a policy version can approve it, and nobody can accept or reject evidence they submitted, while another owner or admin exists. With a single owner or admin both are allowed and recorded as self-approved or self-reviewed.
  • Only the owner can transfer ownership or delete the organization.

Cross-site requests

A state-changing request authenticated by the session cookie is refused if its Origin header names a different host. API-key requests carry no ambient credential and are not subject to this check.

Evidence integrity

  • Evidence has no edit operation. A SHA-256 hash of the content is recorded when it is stored.
  • Deleting evidence withdraws it from every calculation and from download, and keeps the record: the hash, who deleted it, when and why. The stored content is retained, not erased.
  • A reviewer's accept or reject is added to a history; earlier decisions are never overwritten.
  • An evidence file is hashed again on every download and is not served if it no longer matches the recorded hash.
  • A collected date cannot be in the future or earlier than the day before the task was created.
  • A policy version's content is hashed at approval and re-checked at publication. Each acknowledgement stores the hash of the content the person accepted.
  • Integration check results are only ever added, each with a hash of the provider data the check evaluated.
  • Statuses are computed from these records on every read. RedAssay stores no status field that could be edited.

These are properties of the application. Someone with direct access to the database or the file store is outside them; see Known limits.

Files

Uploaded files and document PDFs are private: no file has a public URL. Each is stored under a name the server generates from the organization id and random identifiers, never from a file name or any other user input, and the API does not return that name.

A file reaches a reader only through a route that first checks the reader's permission in the organization that owns it. Evidence files need evidence:read and are sent as application/octet-stream with Content-Disposition: attachment, X-Content-Type-Options: nosniff, a sandboxing Content-Security-Policy and Cache-Control: private, no-store, so an uploaded file is downloaded rather than rendered in the app's origin.

The SHA-256 of every file is computed from the uploaded bytes before they are stored and is kept with the record. Evidence files and document PDFs are hashed again each time they are read, and a file that no longer matches its recorded hash is not served.

An upload's type is taken from its leading bytes, not from the browser or the extension. Executables, unrecognised binaries and files with an extension the operating system would run are refused. See File types.

The one thing RedAssay encrypts itself is integration credentials, with AES-256-GCM, before they are stored. For files and for database records, including written attestations and policy text, encryption at rest is whatever RedAssay's storage and database providers apply; RedAssay adds no application-level encryption of its own to them.

Tokens and secrets

SecretHow it is stored
API keySalted scrypt hash, plus an 8-character lookup prefix. Shown once at creation.
Trust center access tokenSHA-256 hash of a 32-byte random token. The link is emailed and cannot be recovered.
Organization setup linkSHA-256 hash of an 80-bit random code. Shown once, when RedAssay issues it.
Document signing linkSHA-256 hash of a 256-bit random token. Single use; replaced by a reminder; revoked when the document is voided or declined; expires with the document.
Signed-copy download linkSHA-256 hash of a 256-bit random token, valid for 365 days. It serves that signer's completed PDF and nothing else. Replaced when the completion email is sent again; an owner or admin can revoke a document's links, and a member's are cleared when they are deactivated.
Google Cloud key, GitHub tokenEncrypted with AES-256-GCM under a key held only by RedAssay and kept outside the database, and bound to the organization and connection. Never returned by the API; only the last four characters of an identifier are shown. Destroyed on disconnect.
AWS accessNo secret is stored: a role ARN and a server-generated external ID. Each run assumes the role for 15 minutes.
Audit log request bodiesFields whose names look like secrets (password, secret, token, key, credential, totp) are replaced with [redacted] before the entry is written.

Error responses carry a message and nothing else: unexpected errors return Internal error and the detail stays in RedAssay's own logs. AI provider and credential errors are mapped to fixed messages that never include the upstream response or the credential.

User-supplied content

Policy content and documents written in the app are reduced on the server to an allow-list of formatting elements before they are stored; scripts, styles, event handlers and unknown elements are dropped, and links are forced to rel="noopener noreferrer". The same pass is applied to AI output. Input to every API route is validated against a schema, and requests that do not match are rejected with 400. JSON request bodies larger than 1 MB are refused with 413.

A file given to the AI reviewer is treated as untrusted data: the model has no tools, its answer must match a fixed format, and text in the file that reads like instructions to the reviewer lowers the result. See AI evidence review.

Browser security headers

Every page is served with a Content-Security-Policy carrying a fresh nonce per request: scripts run only with that nonce ('strict-dynamic'), everything else defaults to the app's own origin, plugins are off (object-src 'none'), forms post only to the app, and the app cannot be framed (frame-ancestors 'none'). Inline styles are allowed.

One exception to framing: the routes that serve a document's PDF answer with X-Frame-Options: SAMEORIGIN and frame-ancestors 'self' instead, so that the signing page can show the document inside itself. No other site can frame them.

HeaderValue
X-Content-Type-Optionsnosniff
X-Frame-OptionsDENY
Referrer-Policystrict-origin-when-cross-origin
Permissions-PolicyCamera, microphone, geolocation, payment, USB and browsing topics all off
Cross-Origin-Opener-Policysame-origin
Strict-Transport-Securitymax-age=63072000; includeSubDomains

Client IP addresses

Audit log entries, policy acknowledgements and document signing events record the caller's IP address, and several rate limits are counted by it. A client can put any address it likes into a request header, so RedAssay takes the address only from its own network edge and never stores a value the client chose. When the address cannot be established that way it is not recorded, and the record says so.

The browser user agent is always whatever the client sent. On certificates and records both are labelled as reported.

Sign-in follows the same rule. The address the sign-in rate limits count by, the one stored with the session and the one copied into the sign-in entry of the audit log all come from that same source, after anything the client sent in its place has been discarded. When no address can be established, none is stored and all callers share one sign-in counter.

Rate limits

Limits are counted in one place, so they hold however many servers answer the requests.

WhatLimit
Sign-in requests (links and codes)A limit per client IP address, and on top of that 5 sign-in emails per hour to one email address, wherever the requests come from
Trust center access requests10 per hour from one client IP address (per requester email when the address is not known), and 200 per 24 hours for one trust center. The email that tells owners and admins about a new request is sent for at most 5 requests per hour per trust center; later requests in that hour are recorded without an email
Adding people300 rows per organization per 24 hours, because each row can send an email
Sending documents for signature300 signers per organization per 24 hours. A reminder to one signer at most once every 15 minutes; resending a completion email at most once every 10 minutes per document
Signing pages and signed-copy downloads (emailed links)120 requests per 10 minutes from one client IP address, or per link when the address is not known
Signed document check60 per 10 minutes from one client IP address; callers with no known address share one counter
AI evidence reviews100 per organization in any 24 hours, unless RedAssay has set another number for the service
AI policy tailoring30 per organization in any 24 hours, unless RedAssay has set another number for the service
Auditor introduction requests5 per organization per 24 hours
Audit package builds10 per organization per hour, and 5 per person per hour. A build refused because the scope is not frozen is not counted

A caller over a limit gets HTTP 429. For the limits counted in a fixed window (trust center access requests, adding people, signers per day, signing pages, the signed document check, auditor introduction requests, audit package builds and the sign-in emails to one address) the response has a Retry-After header with the seconds until the window starts again, and its message says roughly how long that is, for example "Too many requests. Try again in about 20 minutes." Beyond the limits in this table, the application sets no general limit per key or per session.

What is reachable without signing in

  • This documentation, the homepage and the interactive demo. The demo runs entirely in the browser on made-up data and calls no API.
  • A trust center page, only for organizations that have enabled one, showing only what that organization chose to publish.
  • The trust center access request form. It answers identically whether or not an email is known.
  • Policy PDFs, with a valid, unexpired, unrevoked access token, checked on every request.
  • A document signing page, with a valid signing link, for that one signer and that one document. Every failure (unknown, expired, used, revoked) gets the same answer.
  • A signer's own completed copy, with the download link from the completion email.
  • The signed document check at /sign/verify, which answers whether a SHA-256 fingerprint belongs to a completed document.
  • Two endpoints RedAssay uses to run the service: a status check that says only whether the service is up, and a trigger for integration runs that answers only to a secret held by RedAssay.

Analytics

Page views are reported to an analytics provider with the query string and fragment removed first, because some URLs carry secrets there (trust center tokens, setup codes). Only the origin and path are sent. A document signing link carries its token in the path, so that path is reported as /sign/[token].

Known limits

  • The audit log, evidence records and document trails are application-level records in the same database, not a tamper-proof ledger. Someone with direct database access could alter them.
  • Request rates are limited only where Rate limits says so.
  • Sign-in security, and the identity of a document signer, depend on the security of each person's mailbox.
  • RedAssay applies encryption of its own only to integration credentials. Files and database records rely on what its storage and database providers apply.
  • Deleting evidence does not erase its content.
  • Deleting an organization removes its database records and its stored files, except signed documents and filed audit reports still under a retention lock. Those stay stored, and nothing removes them automatically when the lock ends: ask RedAssay to delete them once the retention date has passed. See Removing data.