Skip to content

fix(security): harden files on the host, packaging and CI - #278

Open
SteveGilvarry wants to merge 1 commit into
security/4-input-validationfrom
security/5-host-ci
Open

SteveGilvarry wants to merge 1 commit into
security/4-input-validationfrom
security/5-host-ci

Conversation

@SteveGilvarry

Copy link
Copy Markdown
Member

Host:

  • HLS segments were written under /tmp/hls at 0755. Any local user
    could read live video, or create the path first as a symlink and choose
    where segments went. The directory is now 0700 and a symlink or
    another user's directory is refused.
  • /tmp/mysql.sock was picked automatically when no standard socket
    existed, so a local user could stand in for the database. It now has to
    be named in db.socket.
  • Startup warns when a signing key is readable by other users.
  • prod.toml and zm-api.env were installed 0644; setup-instance.sh
    makes them 0640 root:.
  • generate-jwt-keys.sh left the private key world-readable until its
    chmod. deploy-dev.sh uploaded to a fixed name in /tmp and installed it
    as root. The test databases were published on every interface.

CI:

  • The release .deb was built without --locked.
  • Workflow tokens are read-only except in the jobs that publish.
  • The two third-party actions that run with a write token are pinned to
    commits.

Notes for review

  • Last of five stacked PRs; based on the input validation PR.
  • Not exercised: the packaging e2e test (needs Docker) and the workflow edits, which are only YAML-checked. CI on this PR is their first run.
  • Behaviour change: an install whose database socket is /tmp/mysql.sock must set db.socket, and an HLS storage path that is a symlink is refused.
  • The dependency bumps from the audit are left to chore(deps): keep the security audit passing on November's advisories #273.

🤖 Generated with Claude Code

Host:
- HLS segments were written under `/tmp/hls` at 0755. Any local user
  could read live video, or create the path first as a symlink and choose
  where segments went. The directory is now 0700 and a symlink or
  another user's directory is refused.
- `/tmp/mysql.sock` was picked automatically when no standard socket
  existed, so a local user could stand in for the database. It now has to
  be named in `db.socket`.
- Startup warns when a signing key is readable by other users.
- `prod.toml` and `zm-api.env` were installed 0644; setup-instance.sh
  makes them 0640 root:<service group>.
- generate-jwt-keys.sh left the private key world-readable until its
  chmod. deploy-dev.sh uploaded to a fixed name in /tmp and installed it
  as root. The test databases were published on every interface.

CI:
- The release .deb was built without `--locked`.
- Workflow tokens are read-only except in the jobs that publish.
- The two third-party actions that run with a write token are pinned to
  commits.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant