1---2name: security-audit3description: Run comprehensive network and TLS security audit - port scan, vulnerability scan, TLS cert inspection, cipher analysis, HTTP headers, SSH host keys. Use when user says "security audit", "network scan".4---56# Security Audit78## Inputs910| Input | Type | Default | Purpose |11|-------|------|---------|---------|12| `target` | string | required | Target host or IP to audit |13| `environment` | string | stage | Environment (stage, production, ephemeral) |14| `full_scan` | bool | false | Run full port scan (slower) |15| `check_certs` | bool | true | Include TLS certificate checks |1617## Workflow1819### 1. Bootstrap20- `persona_load("devops")` — nmap, openssl, curl, ssh tools21- `check_known_issues("nmap", "")`, `check_known_issues("openssl", "")`2223### 2. Port Scanning24- `nmap_quick_scan(target="{target}")` — open ports25- `nmap_service_scan(target="{target}")` — service/version detection26- If `full_scan`: `nmap_scan(target="{target}")`27- `nmap_vuln_scan(target="{target}")` — vulnerability scripts28- `nmap_script(target="{target}")` — default scripts2930### 3. TLS/SSL Checks (if check_certs)31- `openssl_s_client(host="{target}")` — TLS connection32- `openssl_s_client_cert(host="{target}")` — certificate details33- `openssl_x509_info(host="{target}")` — X.509 info34- `openssl_x509_verify(host="{target}")` — chain verification35- `openssl_ciphers(host="{target}")` — cipher suites3637### 4. HTTP Security Headers38- `curl_headers(url="https://{target}")`39- `curl_timing(url="https://{target}")`40- Check for: HSTS, CSP, X-Content-Type-Options, X-Frame-Options, X-XSS-Protection4142### 5. SSH Host Keys43- `ssh_keyscan(host="{target}")`4445### 6. Report46- Open ports count and list47- Vulnerability scan output48- TLS: version, cert valid, expiry, weak ciphers49- Missing security headers50- SSH host key fingerprint51- Log: `memory_session_log("Security audit on {target}", "ports={n}, full_scan={bool}")`5253### 7. Failure Learning54- No route to host → `learn_tool_fix("nmap_quick_scan", "no route to host", "Target unreachable", "Run vpn_connect() or verify hostname")`55- Connection refused → `learn_tool_fix("openssl_s_client", "connection refused", "TLS port not open", "Verify port 443")`5657## Key MCP Tools5859- `persona_load`, `nmap_quick_scan`, `nmap_service_scan`, `nmap_scan`, `nmap_vuln_scan`, `nmap_script`60- `openssl_s_client`, `openssl_s_client_cert`, `openssl_x509_info`, `openssl_x509_verify`, `openssl_ciphers`61- `curl_headers`, `curl_timing`, `ssh_keyscan`62- `check_known_issues`, `learn_tool_fix`, `memory_session_log`6364## Validates6566- `cert_check`