# Security checklist

Implemented and tested in release 0.1.0 (test = automated test in `tests/run.php` executed with PHP CLI/SQLite, or the real-HTTP smoke test):

- [x] CSRF token on every state-changing request (tested)
- [x] Prepared statements everywhere; identifiers validated (tested)
- [x] Output escaped by default; CSP forbids inline script/style (tested)
- [x] Passwords hashed with password_hash; 12+ character policy (tested)
- [x] Login throttled per IP and per email; same message for unknown email and wrong password (tested)
- [x] Session id regenerated at login; cookies HttpOnly, SameSite=Lax, Secure on HTTPS
- [x] Disabled users lose access on next request (tested)
- [x] Permissions enforced on the server for every route; roles define permissions (tested)
- [x] Last active administrator cannot be disabled or demoted (tested, sequential)
- [x] Append-only audit log (database triggers when the host allows; tested on SQLite) with secret redaction (tested)
- [x] Installer locks permanently; /install returns 404 afterwards (tested)
- [x] Config file mode 0640; secrets never printed after setup; cron secret stored as a hash (tested)
- [x] Security headers; errors show a reference code, not internals (tested)
- [x] Logo upload: type sniffed with finfo, size limited, random name, stored outside the web root layout (tested)

Not done / not proven:
- [ ] Not run on a real cPanel/MySQL host. MySQL DDL, MySQL triggers, `.htaccess` behaviour untested.
- [ ] Installer can be used by whoever reaches /install first. Mitigation: the optional install key file, and install immediately after upload.
- [ ] No password-reset by email yet (needs email milestone). No two-factor authentication.
- [ ] File downloads, document storage and portals are later milestones.
- [ ] No penetration test. This list is not a claim of absolute security.

Your responsibilities: HTTPS on; `rpms/` above public_html if possible; remove `install-key.txt`; strong database password; regular backups; keep PHP updated in cPanel.
