Part N. Security verification checklist (run before cutover and after every big change)
Each line is a check with the result you must see. Anything else is a defect to fix before going on.
| Check | How | Expected |
|---|---|---|
| No inbound port at AWS | Lightsail → Instances → bideward → Networking: IPv4 Firewall and IPv6 Firewall | Both lists empty |
| No open port from outside | From your own computer, a port scan of the server’s address (any trusted online scanner, or nmap on your computer) | Every port filtered or closed |
| Only the expected listeners | sudo ss -ltnup on the server | Exactly the rows of F.8 |
| Host firewall | sudo ufw status verbose | Default deny incoming; one allow rule for port 22 on tailscale0 |
| SSH hardened | sudo sshd -T and look at passwordauthentication, permitrootlogin, pubkeyauthentication | no, no (or prohibit-password), yes |
| Instance metadata | Lightsail → Instances → bideward → Networking → Metadata | IMDSv2 required (A.2) |
| Secret files | ls -l /etc/bideward | Every file -rw—–– owned by root |
| No secrets in logs | sudo journalctl -u bideward-hub –since today with grep -i for password, token, secret | No values printed |
| Service sandbox | systemd-analyze security bideward-hub, bideward-research, cloudflared-bideward | An overall level of OK or MEDIUM; if it says UNSAFE or EXPOSED, send me the output |
| Hub cannot change the audit trail | psql -U bideward_dba -d bideward -c “select has_table_privilege(‘bideward_hub’,‘hub.audit_log’,‘UPDATE’), has_table_privilege(‘bideward_hub’,‘hub.audit_log’,‘DELETE’);” | f and f |
| Hub cannot see research data | psql -U bideward_dba -d bideward -c “select has_schema_privilege(‘bideward_hub’,‘research’,‘USAGE’);” | f |
| Research cannot see accounts | psql -U bideward_dba -d bideward -c “select has_schema_privilege(‘bideward_research’,‘hub’,‘USAGE’);” | f |
| Backup login writes only its own result table | psql -U bideward_dba -d bideward -c “select has_table_privilege(‘bideward_backup’,‘hub.kv’,‘INSERT’), has_table_privilege(‘bideward_backup’,‘hub.backups’,‘INSERT’);” | f and t |
| Plain HTTP is refused | From your computer: curl -sI http://app.bideward.com | A redirect to https, never a page |
| Bad methods blocked | curl -s -o /dev/null -w “%{http_code}” -X PUT https://app.bideward.com/ | 403 |
| Ingestion without the key blocked | A POST to an ingestion path on api.bideward.com with no key header (paths from E1) | 403 from Cloudflare |
| Research behind Access | In a private window open https://app.bideward.com/research | The Cloudflare Access sign-in, not the dashboard |
| Hub refuses /research without Access | On the server: curl -s -o /dev/null -w “%{http_code}” http://127.0.0.1:8080/research | 401 or 403 |
| Dashboard not open | Open https://app.bideward.com in a private window | Only the logo sign-in screen |
| Host routes separated | Open https://api.bideward.com/ and an ingestion path on https://app.bideward.com | 404 on both |
| Sign-in lock works | Five wrong passwords for a test user | Locked for 15 minutes and a Telegram alert |
| Two-factor everywhere | Cloudflare, GitHub, AWS (root and your user), Tailscale, Google | On for each |
| AWS billing alarm | AWS Billing → Budgets | A budget alert set at a low amount you choose |
| Deploy key read-only | GitHub → the repository → Settings → Deploy keys | bideward-lightsail, Write access unticked |
| Backup opens | The J.5 drill | Passed this month |
← Previous: Part M. Troubleshooting · Guide index · Next: Part O. Quick reference →