Move in and keep it safe

Content security

Quarantine, classification, separately deployed scanning and scoped mass-activity alerts.

Open Files → Upload protection for content scanner receipts, holds, mass-activity alerts and pauses. These controls keep existing file roles: security administration grants no content access. The owner alone enables original processing and selects sensitive-reader and release-reviewer groups, with explicit confirmation. With no reviewer groups, only the owner can release. A delegated reviewer must both belong to a selected group and hold current sharing and security administration scope over the uploader; neither condition alone suffices. A release needs a reason and preserves the scanner verdict. These are the owner-directed adopted release and classification defaults.

Run the processor

services/content-scan/server.py runs outside the Worker. It uses a real ClamAV executable and signature database; a missing engine, missing database, timeout, unsupported response or checksum mismatch never means clean. The supplied container refreshes signatures before serving and keeps freshclam running. Build it with docker build -t chest-content-scan services/content-scan. Supply CONTENT_SCANNER_TOKEN through an owner-only environment file to the container, never an image or a command argument containing its value. Run behind your authenticated HTTPS reverse proxy; expose the processor only to Chest. /scan accepts authenticated POSTs only. Do not publish a direct HTTP endpoint.

For an existing ClamAV install, run python3 services/content-scan/server.py --clamscan /usr/bin/clamscan --database DATABASE_DIRECTORY. Replace DATABASE_DIRECTORY with the directory maintained by your ClamAV updater. Its token comes from CONTENT_SCANNER_TOKEN; it never prints that value or originals. Bind locally by default. The processor admits two requests at once, bounds a stored original to 1 GiB, expanded malware scanning to 2 GiB and archive recursion to 20, and times each engine call out after 90 seconds. Office XML classification expansion is bounded to 128 MiB. Above these bounds Chest keeps the original in quarantine. Originals stream from R2 to the processor without buffering the whole file in Worker memory; plain-text label classification reads the full admitted original, including labels beyond 32 MiB. The current resumable upload door admits up to 4 GiB; originals above the scanner bound remain held with a failed receipt rather than being treated as clean. It does not silently scan only a prefix.

Set the optional Chest deploy bindings CONTENT_SCANNER_URL (the HTTPS /scan address) and CONTENT_SCANNER_TOKEN to the same private processor configuration using the ordinary private deploy input. Save and explicitly confirm Scan originals: Enabled in Upload protection. This consents to transmitting original bytes to that configured service. Endpoint configuration is deployment-owned; visitors cannot choose a host or redirect. No provider account is needed. A live processor still needs maintained malware definitions; local test signature databases are not production coverage.

Uploads are retained by SHA-256 before processing. Multipart scanner receipts keep the original filename and actual authenticated uploader (or verified request visitor), so delegated review scope applies to the uploader. A durable pending receipt precedes the request. Only a matching checksum, size and valid engine verdict admits the original. Failed and infected originals remain retained; failed intake does not create or replace a published file. Retry the original after the service recovers, or let an authorized reviewer record an explicit release and retry. An identical retry does not remove evidence. Enabling scanning also denies access to previously unscanned versions; the owner can scan an existing file by its ID, with their current content role still required. Disabling processing never releases existing holds.

Classification recognizes the explicit Classification: Sensitive, Classification: Confidential and Classification: Restricted textual labels, case-insensitively, in plain text and Office XML (including labels split across runs). It is not a general-purpose DLP model. By default only the owner can read a file with a sensitive retained version, and only if their ordinary file grant permits it. The owner may explicitly select sensitive-reader groups; group membership is checked live and still supplies no file grant. Sensitive files are omitted from external folder links and refused through direct links, originals, previews and signing links. Changing processing or reader policy neither erases bytes nor changes file grants. A manager cannot release malware merely because they can edit the file. Delegated reviewers see reasons and checksums only within their security scope; file names still require ordinary access, and review or release grants no content access. Removing reviewer-group membership or security scope ends release authority on the next request, including the atomic release commit.

Activity thresholds

Defaults apply immediately: more than 500 download attempts or 5 GB (5,000,000,000 bytes), or more than 200 trash/erase attempts, per account, device or OAuth token in a rolling 10 minutes. A download request counts once; a range request charges its requested interval, and retries count again. Attempts that reach the authorized content door count even if the client later cancels or the final mutation loses a race. Metadata-only requests do not count. A ZIP charges each included original, and signer PDF/certificate downloads use the same verified-identity accounting. Account totals combine browser sessions and credentials; devices, OAuth tokens and public links also have independent source counters. No raw browser session or bearer token is retained in the activity ledger.

Admins with sharing and security scope tune the organization rule, or only a group within their delegated scope. Applicable organization and group rules all apply. Crossing any rule creates a durable alert, audit event, in-app notice and email outcome for security admins scoped to the actor. Alert deduplication is per subject, rule and operation for 10 minutes. Alert-only rules serve the triggering download. With pause on, the triggering download and subsequent downloads are refused before bytes leave. Folder trash counts every currently live descendant affected by it. Trash/erase thresholds alert without deleting or automatically undoing evidence. A paused device or OAuth token is refused through every API operation; a browser account pause applies to downloads. A security admin may resume a scoped source with a reason; if its rolling total is still above the limit, the next request pauses it again. Resume preserves the alert and history. Expiring event counters never deletes the retained alert or originals.

Pending native clients and future content doors inherit the same quarantine and activity boundaries before shipping. A restored backup retains quarantine/classification receipts but disables processor egress until the owner re-enables it. Explicit erasure removes an unshared original and its scanner receipt through ERASE-001. Scanner credential rotation remains SECURITY-001/RECOVER-002 obligations.

The contentSecurityFlow journey proves a 64 MiB resumable original through the separately deployed real ClamAV processor with maintained vendor definitions: a part restart, failed-scan quarantine, retry, a sensitive label beyond 40 MiB and exact downloaded SHA-256. Its local proof run is sx-chest-c14-content-64, on the committed candidate outside push Verify. Scanner bounds are admission limits; this proof does not claim larger inputs are readable.