1---2name: cert-check3description: Check TLS certificate health for endpoints - expiry, chain verification, TLS version, cipher inspection, HTTP header validation. Use when user says "cert check", "certificate expiry".4---56# Certificate Check78## Inputs910| Input | Type | Default | Purpose |11|-------|------|---------|---------|12| `endpoints` | string | required | Comma-separated host:port endpoints |13| `warn_days` | string | 30 | Warn if cert expires within this many days |14| `environment` | string | stage | Environment (stage, production, ephemeral) |1516## Workflow1718### 1. Bootstrap19- `persona_load("devops")` — openssl, curl, nmap tools20- `check_known_issues("openssl", "")`, `check_known_issues("certificate", "")`2122### 2. Certificate Checks (first endpoint)23- Parse host from `endpoints.split(',')[0].strip()`24- `openssl_s_client(host="{host}")` — TLS connection25- `openssl_s_client_cert(host="{host}")` — certificate details26- `openssl_x509_info(host="{host}")` — X.509 info27- `openssl_x509_verify(host="{host}")` — chain verification28- `curl_headers(url="https://{host}")` — HSTS and security headers29- `nmap_scan(target="{host}")` — TLS port30- `nmap_script(target="{host}")` — SSL scripts3132### 3. Parse Certificate33- Extract: subject, issuer, expiry (Not After), days_left34- expiry_warning = days_left < warn_days35- chain_valid = "verify return code: 0" in verify output36- has_hsts = "strict-transport-security" in headers37- healthy = chain_valid and not expiry_warning and days_left > 03839### 4. InScope Lookup40- `inscope_ask("How do I manage TLS certificates for {environment} environment?")`4142### 5. Report43- Certificate details table44- Health status45- Nmap SSL analysis46- Documentation snippet47- Log: `memory_session_log("Certificate check on {endpoints}", "healthy={healthy}, days_left={days}")`4849### 6. Failure Learning50- Unable to get local issuer → `learn_tool_fix("openssl_x509_verify", "unable to get local issuer", "Missing CA bundle", "Ensure system CA certs up to date")`51- Certificate has expired → `learn_tool_fix("openssl_s_client", "certificate has expired", "Cert expired", "Renew via cert-manager or manual")`5253## Key MCP Tools5455- `persona_load`, `openssl_s_client`, `openssl_s_client_cert`, `openssl_x509_info`, `openssl_x509_verify`56- `curl_headers`, `nmap_scan`, `nmap_script`57- `inscope_ask`, `check_known_issues`, `learn_tool_fix`, `memory_session_log`5859## Chains To6061- `security_audit`