feat: Phase 0 security hardening (auth, CI, stop the bleeding) - #9
Merged
Conversation
Add session cookie and bearer API auth, remove the unauthenticated /paths side-server, default bind to loopback, redact CLI stream secrets, kill error-detail leaks and template XSS, and land CI plus characterization tests without torch. Closes the critical/high findings from the modernization plan while staying on video-feed/videofeed/.
test_db_connection imports RecordingManager which requires opencv; the API CI job only installs the web-test stack (no torch/cv2).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Phase 0 from
docs/PLAN.mdon the currentvideo-feed/videofeed/layout (no repackage / no/api/v1yet):sx_API keys; rate-limited login; admin-scoped DELETE; fail-closed untiladmin set-passworddetail=str(e), XSS-safe templates, fix recordings UI to/api/recordings127.0.0.1, remove unauthenticated/pathsside-server,rtspEncryption: strict, redact CLI stream secrets (credentials show-stream)Operator notes (post-merge)
Open
http://127.0.0.1:8080/login.Test plan
PYTHONPATH=. pytest tests/test_api_characterization.py tests/test_auth.py tests/test_config_security.py(27 passed on Python 3.12)credentials show-streamworks; status/print_urls no longer embeduser:pass@