Test the install path
shellcheck / shellcheck (push) Failing after 20s

60-security.sh now also checks the way in: federated.sh sends wget to
install.sh on Gitea over HTTPS at every hop, plain HTTP goes to HTTPS
without serving the script, and a browser goes to the Install page.

For the [federated] repo, it checks that pacman.conf needs signatures on
packages and the database, gets them from Gitea over HTTPS, and lists
the repo after core and extra; that pacman trusts the pinned key; and
that Gitea's repository.key is that key alone. Then it serves a package
from a stand-in repo with [federated]'s settings and pacman's keyring:
pacman refuses it unsigned, signed by a key it doesn't have or doesn't
trust, or in a signed database but unsigned itself, and installs it when
its key is trusted.

It found nothing to fix. Each repo check was shown to fail with
[federated] weakened, moved above core, or its key deleted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 17:38:56 -07:00
co-authored by Claude Opus 5.5
parent d5925fa551
commit 53c6c8b52e
2 changed files with 177 additions and 15 deletions
@@ -1,6 +1,6 @@
---
name: coredesktop-security-checks
description: Plan and progress for CoreDesktop's security test suite. The report receiver, report's redaction, the agent sandbox and what root runs are tested; the checks still to write run in the smoketest VM (network exposure, the install path). Use when resuming, continuing, checking the status of, or changing CoreDesktop's security or penetration tests.
description: Plan and progress for CoreDesktop's security test suite. The report receiver, report's redaction, the agent sandbox, what root runs and the install path are tested; network exposure, which needs a scan from outside the smoketest VM, is still to write. Use when resuming, continuing, checking the status of, or changing CoreDesktop's security or penetration tests.
---
# CoreDesktop's security checks
@@ -26,7 +26,7 @@ leak data or give away control, in this order:
3. The agent sandbox: the one place that runs code CoreDesktop doesn't trust. **Done.**
4. Network exposure from outside.
5. Files root runs, and secrets only root may read. **Done.**
6. The install path (federated.sh, the `[federated]` repo).
6. The install path (federated.sh, the `[federated]` repo). **Done.**
The pacman guard (`system/pacman-guard`) is
a safety net against mistakes, not a security control: anyone with sudo gets
@@ -129,6 +129,32 @@ running from /home, secure_path in /home, `pam_permit.so` atop sudo's stack).
`/etc/coredesktop/smb` isn't checked: only `configure storage` makes it, which
needs an SMB server.
## Done: step 6 (the commit "Test the install path")
`install_path_checks` in `60-security.sh`. It found nothing to fix.
- federated.sh, live: wget is redirected to install.sh on Gitea, every hop
HTTPS (`curl --proto-redir =https`); real wget gets it; plain HTTP
redirects to HTTPS without serving the script; a browser goes to
coredesktop.computer. install.sh's shebang is `#!/bin/bash -i`. The
nightly run fails if federated.sh or Gitea is down.
- `[federated]` in pacman.conf is exactly `SigLevel = Required
DatabaseRequired` and the HTTPS server, after `[core]` and `[extra]`; the
pinned key is fully trusted; Gitea's repository.key is that key alone.
- A stand-in repo (a package built in the VM, served from files, with
`[federated]`'s real settings and keyring, installed into a throwaway
root): pacman refuses it unsigned, signed by an unknown key, signed by a
key it has but doesn't trust, and with a signed database but unsigned
package; the control, its key trusted in a copy of the keyring, installs.
- Code scan: every download piped to bash or pacman-key is HTTPS; no
`--insecure` or weak SigLevel.
- pacman can't pin a repo to one key: `Required` takes any trusted key,
Arch packagers' too. Not fixable in CoreDesktop.
A sabotage run (SigLevel `Optional TrustAll`, `[federated]` above `[core]`,
the key deleted) failed the matching checks, and found a check that tested
only its last line: give a check's tests `&&`, or end on the one that counts,
since `check` scripts don't run with `set -e`.
## Running the smoketest
- `coredesktop-dev smoketest run 60-security`, outside Claude Code's sandbox
@@ -142,7 +168,7 @@ needs an SMB server.
- The user's global git config has no name or email. Commits so far used
`git -c user.name="David Young" -c user.email=...` from the repo's history.
## Next: steps 4 and 6 in the smoketest VM
## Next: step 4 in the smoketest VM
Add them to `smoketest/scenarios/60-security.sh` (or a sibling scenario if it
grows too long), with the same `check` style. Where a check needs a second
@@ -165,11 +191,3 @@ VM against itself goes through loopback, which ufw allows. Find out from
`coredesktop-dev` whether the VM can get a bridged or tap network, or a second
VM, before writing this one.
### 6. The install path
- `https://federated.sh` sends `wget` (User-Agent not starting with
`Mozilla`) to the HTTPS URL of `install.sh` on Gitea, never to plain HTTP.
- The `[federated]` repo's signing key in pacman is the one `utils.sh` pins
(`FEDERATED_REPO_KEY`), and the repo is `SigLevel = Required DatabaseRequired`.
- pacman refuses a package from `[federated]` that isn't signed by that key.
Serve one from the VM's own stand-in repo to check.