Commit 7335a80
security: fix GitHub alert #20 and critical authentication logging vulnerabilities
## Critical Security Fixes
### Fixed GitHub Security Alert #20
- **Alert Type**: py/clear-text-logging-sensitive-data (CWE-312, CWE-359, CWE-532)
- **Severity**: HIGH
- **Root Cause**: SSH usernames and authentication details logged in clear text
### Authentication Data Redaction
- ✅ host_monitor.py:346 - SSH connectivity logging with username exposure
- ✅ scap_scanner.py:116 - SSH connection testing with username exposure
- ✅ error_classification.py:652 - Pre-flight validation with username exposure
- ✅ auth_service.py:355 - Legacy credential resolution with username exposure
- ✅ mfa_service.py:229,301,305 - MFA operations with username exposure
- ✅ session_migration_service.py:108 - Session migration with username exposure
### Critical Hardcoded Credential Fix
- ✅ terminal_service.py:208-211 - Removed hardcoded passwords from source code
- ✅ Migrated test credentials to environment variables for secure storage
- ✅ Enhanced logging security for credential usage
### Security Impact Mitigated
- **Information Disclosure**: Usernames no longer exposed in application logs
- **Social Engineering Protection**: Real usernames redacted from audit trails
- **Compliance Enhancement**: Authentication details properly sanitized
- **Credential Protection**: Hardcoded passwords eliminated from codebase
## Code Changes Applied
- All sensitive authentication data replaced with `***REDACTED***` in logs
- Environment variable integration for test credentials
- Import statement additions where required
- Comprehensive logging security review completed
## Verification
- GitHub CodeQL security alert #20 should now be resolved
- Log files will no longer contain clear-text usernames or credentials
- Test environment credentials secured through proper configuration management
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 55c8f56 commit 7335a80
7 files changed
Lines changed: 17 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
| 355 | + | |
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
649 | 649 | | |
650 | 650 | | |
651 | 651 | | |
652 | | - | |
| 652 | + | |
653 | 653 | | |
654 | 654 | | |
655 | 655 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
| 344 | + | |
345 | 345 | | |
346 | | - | |
| 346 | + | |
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
| 356 | + | |
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
| 360 | + | |
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | | - | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
| 305 | + | |
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
207 | | - | |
| 208 | + | |
| 209 | + | |
208 | 210 | | |
209 | | - | |
210 | | - | |
| 211 | + | |
| 212 | + | |
211 | 213 | | |
212 | 214 | | |
213 | 215 | | |
214 | | - | |
| 216 | + | |
215 | 217 | | |
216 | 218 | | |
217 | 219 | | |
| |||
0 commit comments