--- name: coredesktop-security-checks description: Plan and progress for CoreDesktop's security test suite. The report receiver and report's redaction are tested; the checks still to write run in the smoketest VM (the agent sandbox, network exposure, what root runs, the install path). Use when resuming, continuing, checking the status of, or changing CoreDesktop's security or penetration tests. --- # CoreDesktop's security checks Written on 2026-11-16. Work out the current state before doing anything: ``` git -C ~/Projects/coredesktop fetch && git -C ~/Projects/coredesktop log --oneline origin/main -15 ls ~/Projects/coredesktop/smoketest/scenarios/ ~/Projects/coredesktop/server/report-receiver/ ``` Tell the user which step is next and confirm before starting it. ## Scope The suite covers what CoreDesktop itself adds. It doesn't test Arch or GNOME, which upstream looks after. It goes after the places where a mistake would leak data or give away control, in this order: 1. The report receiver, the only part on the public internet. **Done.** 2. `report`'s redaction, which decides what leaves a user's computer. **Done.** 3. The agent sandbox: the one place that runs code CoreDesktop doesn't trust. 4. Network exposure from outside. 5. Files root runs, and secrets only root may read. 6. The install path (federated.sh, the `[federated]` repo). The pacman guard (`system/pacman-guard`) is a safety net against mistakes, not a security control: anyone with sudo gets past it by design. Don't test it as a boundary. ## Done: steps 1 and 2 (the commit "Test the report receiver and redaction against attacks") - `server/report-receiver/test_security.py` sends the receiver what an attacker could. It found, and the commit fixed: - a negative Content-Length (read without limit) - parts nested thousands deep (RecursionError, connection dropped) - thousands of parts (8 s of CPU for 5.7 MB) - a rate limit per IPv6 address instead of per /64 - Markdown in report fields reaching the Gitea issue: @mentions, issue references, links, tracking images - no guard against filling the disk - `tests/report.bats` (the "Redaction" section) found `report` sending: - passwords in URLs - tokens, API keys, Nextcloud app passwords and private keys - IPv6 and MAC addresses - the Core's domain and the user's name - user and host names with regex characters, unredacted All fixed. A test also checks it doesn't over-redact (pacman's `::`, times, epoch versions, `std::string`). - Each test was checked to fail against the code before the fix. Still open from these steps: - **Deploy** the new `receiver.py` on federated.sh (server/report-receiver/README.md, "To update it later"). - **Slow uploads.** Caddy streams them to the receiver, one thread each. Try `request_buffers 11MB` in Caddyfile.example's `reverse_proxy`, and check that `caddy validate` accepts it. - **Gitea attachments.** Check on the real server that Gitea serves attached `.log` files as text or as downloads, never as HTML (a log can contain `