--- name: orca-account-health description: Cloud account coverage and sync-health audit — lists every connected cloud account, sync status, scanner deployment, integration health, and flags blind spots before any audit, investigation, or security review. Use when user asks about coverage, account health, sync status, scanner deployment, "are we monitoring X", or "do we have full coverage" (e.g., "account health", "are all accounts connected", "is everything synced", "coverage audit"). trigger: When user asks about Orca tenant coverage, account connectivity, integration status, scanner deployment, sync freshness, or wants confidence the data behind an investigation/audit is complete and recent. Also pre-audit ("prove we have full coverage") and pre-investigation ("is the data fresh?"). --- # Orca Account Health Skill Answers the question: **"Is every account connected, recently synced, and fully scanned — so we can trust the data we're about to act on?"** Blind spots in account coverage produce blind spots in every other skill: if `prod-eu-west` last synced 48 hours ago, the alerts you triage are stale. This skill audits the foundation. ## Usage ``` /orca-account-health /orca-account-health aws /orca-account-health degraded ``` Or natural language: - "are all accounts connected?" - "is everything synced?" - "coverage audit before the audit" - "any blind spots?" - "show me account health" ## Processing Logic ### Step 1: Determine Scope Parse the input: - **No arg**: full inventory across all clouds. - **Provider arg** (`aws`, `gcp`, `azure`, `kubernetes`, `oci`): filter to one cloud. - **Status arg** (`degraded`, `offline`, `healthy`): filter by health. ### Step 2: Pull integration configs (single call) ``` get_integration_configs_data: ``` This returns every configured integration / source: cloud accounts, log sources (CloudTrail, Azure Monitor, etc.), Kubernetes clusters, and their extraction settings. Parse out: - Source type and provider - Connection state - Last successful run / sync timestamp - Any error messages or degraded indicators ### Step 3: Cross-check coverage with discovery (parallel) In parallel with Step 2, run two `discovery_search` queries to spot-check that data is *actually* flowing — not just that the connection exists: **Query A: Asset freshness per account** ``` discovery_search: search_phrase: "assets grouped by cloud account" limit: 50 ``` **Query B: Recent CDR event flow** (confirms log ingestion, not just inventory) ``` discovery_search: search_phrase: "cloud audit events in the last 24 hours grouped by account" limit: 50 ``` If an account appears in `get_integration_configs_data` but returns **zero assets** or **zero recent CDR events**, that's a covert blind spot even though the integration reports "connected." ### Step 4: Compute per-account health For each account, derive a health verdict: | State | Definition | |---|---| | **Healthy** | Connected, synced in last 24h, scanner deployed, ≥1 recent CDR event | | **Sync Lag** | Connected, last sync 24–72h ago, scanner deployed | | **Stale** | Connected, last sync > 72h ago | | **Degraded** | Connection error reported, OR scanner missing, OR no CDR events in 72h | | **Offline** | Never synced, OR connection broken | | **Recently Added** | Onboarded in the last 7 days (verify onboarding finished) | ### Step 5: Detect specific blind-spot patterns Flag these patterns explicitly — they're the ones that bite during audits or investigations: 1. **Account is connected but produces no assets** → onboarding likely incomplete. 2. **Account is connected, has assets, but no CDR events in 24h** → audit log integration broken (CloudTrail / Azure Monitor / GCP Audit Logs misrouted). 3. **Scanner deployed but stuck on a stale scan** → SideScanning or workload scanner needs restart. 4. **New account added < 7 days ago, no successful sync yet** → onboarding incomplete or failed silently. 5. **Provider drift** — account listed in one cloud's console but missing from Orca. ## Proactive Behavior **This skill is diagnostic, not remediation-heavy** — but it should still surface the next step: 1. **Identify the worst blind spot** and recommend a specific fix: - "Reconnect `prod-eu-west` — last sync 48h ago, no CDR events. Open Orca Console → Cloud Accounts → Reconnect." 2. **For onboarding failures**, link to the docs: - `/orca-account-health` should reference `documentation_search` for "onboarding troubleshooting" if user asks "how do I fix it". 3. **Pre-audit framing**: if the user said "before the audit", explicitly say whether they can proceed or need to wait for re-sync. ## Output Format ### Layer 1: Coverage Dashboard ``` ═══════════════════════════════════════════════════════════════════ ACCOUNT HEALTH — Cloud Coverage Audit | ═══════════════════════════════════════════════════════════════════ VERDICT: ┌─────────────────────────────────────────────────────────────────┐ │ TOTAL ACCOUNTS │ │ HEALTHY │ │ SYNC LAG (24-72h since last sync) │ │ STALE (> 72h since last sync) │ │ DEGRADED (errors / scanner gap / no CDR) │ │ OFFLINE (broken / never synced) │ │ RECENTLY ADDED (onboarded < 7d, verify completion) │ │ BLIND SPOTS (connected but no data flowing) │ └─────────────────────────────────────────────────────────────────┘ ACCOUNT STATUS: Account Provider Last Sync Scanner CDR Status ──────────────────────────────────────────────────────────────────────── AWS 2 min ago YES OK Healthy AWS 26 hours ago YES OK Sync Lag Azure Never NO — Offline GCP 2h ago YES NO Degraded ... BLIND SPOTS (immediate attention): [!] — Impact: Fix: [!] — ... RECOMMENDED ACTION: Reconnect first — . After reconnect, re-run any pending investigation or audit. ═══════════════════════════════════════════════════════════════════ Or drill down: degraded | offline | sync-lag | recently-added | by-provider | full ═══════════════════════════════════════════════════════════════════ ``` ### Layer 2: Drill-Downs #### "degraded" — Accounts with active problems ``` ─────────────────────────────────────────────────────────────────── DEGRADED ACCOUNTS — Active Issues ─────────────────────────────────────────────────────────────────── [!] () Connection: Last sync: