T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/security-hardener.py:503- Finding
Broad Collection of Sensitive Workspace, Memory, and Environment Files
- Content
View full analysis
2 * 1024 * 1024: # 2MB limit continue try: with open(fpath, 'r', errors='ignore') as f: content = f.read() scanned += 1 except (IOError, PermissionError): continue for pattern, name in SECRET_PATTERNS: matches = re.findall(pattern, content) if matches: # Don't include the actual key in the finding rel_path = os.path.relpath(fpath, os.path.expanduser('~')) findings.append(Finding( 'secrets', 'critical' if 'live' in name.lower() or 'private' in name.lower() else 'high', f'Exposed {name} in ~/{rel_path}', f'Found {len(matches)} match(es) for {name} pattern in file.', fix=f'Move secrets to environment variables or .env file. Remove from {rel_path}.', auto_fixable=False, )) ``` ```python def cmd_keys(args): """Scan for exposed API keys.""" pr ...[truncated 2686 chars]- Remediation
View remediation
