Phase 1 — hardening (deferred from 1a review) #7
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
marvin8/xique#7
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hardening items identified during the Phase 1a final review that were deliberately deferred, to be addressed as part of Phase 1b where they touch the same code.
Items: login throttling; session cookie Secure flag (for TLS deployment); logout CSRF shape (GET logout); worker crash-recovery for jobs left 'running'; complete_job/fail_job status='running' guards; index on jobs.status; POLL_INTERVAL_SECONDS as a Setting; run_worker_cycle bounded batching before checkpoint; transactional migration scripts (matters from migration 2 onward); and the identified test coverage gaps (empty/unicode passwords, malformed cookie halves, get_db close-on-exception, server.main()/worker.main()).
Audit against the current code (post 1b/1c/1d), so we only implement what actually remains
Already addressed during later phases:
migrate)jobs.status(owned by migration 2)recover_stale_jobswired intorun_workerstartupcomplete_job/fail_jobstatus = 'running'guards (verified indb/jobs.py)poll_interval_secondsis aSettingsfield (XIQUE_POLL_INTERVAL_SECONDS)Still missing:
web/routes/auth.pySecureflag —set_cookiecalls (session + CSRF) carry onlyhttponly/samesiteGET /logoutwith no CSRF — state change on GETget_dbclose-on-exception,server.main()/worker.main()entry pointsPlan of attack (one PR, stacked after the #11 logging PR so failure logs exist while testing)
Settings.session_cookie_secure: bool = False(XIQUE_COOKIE_SECURE); applied to session + CSRF cookies; documented for TLS deployments.POST /logoutwith CSRF token, nav form inbase.html; GET returns 405.Key files:
src/xique/config.py,src/xique/web/routes/auth.py,src/xique/web/deps.py,src/xique/db/users.py,templates/base.html,README.md,tests/.