OG T
f8d4772abf
fix(api): Sprint 3 P0-1/P0-2/P0-3/P0-4 Critical Security Fixes
P0-1: Complete shell metacharacter regex detection
- Enhanced _SHELL_METACHAR_RE to detect: >, <, \n, ${}, $()
- Prevents all shell injection vectors (redirects, variable expansion, newlines)
- Added 5 new validation tests
P0-2: Add shlex.quote() protection for ansible playbook path
- Wraps playbook_path in shlex.quote() before SSH command construction
- Prevents shell injection if path contains special characters
- Applied in _execute_ansible() method
P0-3: Add SSH target host whitelist validation
- Introduces validate_ssh_target_host() function
- Only allows SSH to: 192.168.0.110, 192.168.0.188
- Prevents unauthorized SSH target exploitation
- Added 5 new whitelist validation tests
P0-4: Convert HostRepairAgent to singleton pattern
- Implements __new__() singleton with shared _in_process_locks dict
- Ensures in-process locks persist across multiple auto_repair_service calls
- Previously created new instance per call, making locks ineffective
- Added singleton persistence test
Test Results: 45/45 passing (34 existing + 11 new P0 tests)
All security validations verified via comprehensive unit test coverage.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-04-07 11:09:45 +08:00
..
2026-04-04 11:55:09 +08:00
2026-03-26 16:06:20 +08:00
2026-04-05 14:45:02 +08:00
2026-03-31 16:25:00 +08:00
2026-04-06 11:49:24 +08:00
2026-03-29 15:27:49 +08:00
2026-03-29 15:27:49 +08:00
2026-04-05 22:08:08 +08:00
2026-03-29 15:48:03 +08:00
2026-03-31 12:16:54 +08:00
2026-04-05 15:40:40 +08:00
2026-04-01 11:11:50 +08:00
2026-04-07 11:09:45 +08:00
2026-03-31 16:16:16 +08:00
2026-03-31 12:20:29 +08:00
2026-03-26 16:06:20 +08:00
2026-03-26 16:06:20 +08:00
2026-03-29 20:49:23 +08:00
2026-04-03 14:00:21 +08:00
2026-04-05 01:49:06 +08:00
2026-04-04 12:16:28 +08:00
2026-04-05 00:14:50 +08:00
2026-04-05 00:14:50 +08:00
2026-03-26 16:06:20 +08:00
2026-03-31 14:17:36 +08:00
2026-03-29 16:23:30 +08:00
2026-03-23 23:51:37 +08:00
2026-04-04 18:05:25 +08:00
2026-04-01 21:11:45 +08:00
2026-03-29 15:27:49 +08:00
2026-03-29 21:23:07 +08:00
2026-03-31 16:16:16 +08:00
2026-04-01 13:12:02 +08:00