Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.
Python agentic-aiai-securityalert-triageblue-teamcybersecuritydetection-engineeringincident-responselanggraphllm-agentsmcpmitre-attackmodel-context-protocolpurple-teamsecurity-operationsself-hostedsiemsoarsocthreat-detectionthreat-intelligence
feat(connectors): add osctrl + FleetDM osquery fleet manager connectors (issue #44 PR1/6)
Beenu2864f82574ab
diff --git a/apps/docs/docs/connectors/fleetdm.md b/apps/docs/docs/connectors/fleetdm.mdnew file mode 100644index 000000000..948ed8209--- /dev/null+++ b/apps/docs/docs/connectors/fleetdm.md@@ -0,0 +1,87 @@+---+sidebar_position: 15+title: FleetDM+description: Pull host posture and saved-query report rows from FleetDM into AiSOC.+---++# FleetDM++[FleetDM](https://fleetdm.com/) is an open-source-friendly osquery fleet+manager. The FleetDM connector polls the Fleet REST API for two distinct event+streams:++1. **Host posture changes** — hosts going `online`, `offline`, or `missing`.+2. **Saved-query report rows** — every row of every saved query, normalized as one event per row.++Severity is derived per-stream so that posture changes and query rows can be+routed independently downstream.++## What you get++| Source | Fleet endpoint | Notes |+|---|---|---|+| Hosts | `GET /api/v1/fleet/hosts` | One event per host whose status changed since `since_seconds` |+| Saved queries | `GET /api/v1/fleet/queries` | Discovery only |+| Saved-query report rows | `GET /api/v1/fleet/queries/{id}/report` | One event per row |++Events are normalized with `category: endpoint`. The `kind` field on the event+distinguishes `host` vs `query_row` so playbooks and detections can branch.++## Prerequisites++- A reachable **Fleet server** (`https://fleet.example.com`).+- A **long-lived API token** issued from **Settings → Users → \[user\] → Get API token**.+- Optional **Team ID** if you want to scope polling to a single Fleet team.++## Setup walkthrough++### 1. Issue an API token in Fleet++1. Sign in to Fleet as a global admin or team admin.+2. Open **Settings → Users**, select the service-account user, and click **Get API token**.+3. Copy the token.++Tokens are scoped to the user. Use a dedicated service-account user so+revocation does not lock out a real operator.++### 2. Add the connector in AiSOC++1. **Connectors → Add connector → FleetDM**.+2. Fill in `base_url` (no trailing slash; `/api` is appended automatically), `api_token`, and optionally `team_id`.+3. **Test connection** — the connector calls `GET /api/v1/fleet/me` to validate auth.+4. **Save**.++## Polling details++- Default interval: **300 seconds**, overridable per-instance via `connector_config.poll_interval_seconds`.+- The connector pulls hosts and saved-query reports independently in the same poll cycle so a slow saved query does not block host posture ingestion.++## Severity mapping++### Host posture++| Fleet `status` | AiSOC severity |+|---|---|+| `missing` | `medium` |+| `offline` | `low` |+| `online` | `info` |++### Saved-query report rows++Identical table-driven mapping as the [osctrl connector](/docs/connectors/osctrl)+— persistence and execution tables (`startup_items`, `scheduled_tasks`,+`launchd`, `crontab`, `kernel_modules`, `browser_extensions`) get `high`,+`file_events` gets `medium`, inventory tables get `info`.++## Troubleshooting++**`auth failure 401/403`** — the token is invalid or the user has been deleted. Re-issue from the Fleet UI.++**`team_id` is set but no events** — confirm the team has hosts assigned and that the saved queries are scheduled against that team.++**Many duplicate `host` events** — Fleet emits status transitions on poll, not on change. The detection layer is responsible for deduplication via the standard `dedupe_key`.++## Related++- [osctrl](/docs/connectors/osctrl) — alternative open-source fleet manager.+- [Detection coverage](/docs/detections/coverage) — endpoint rules that fire on osquery data.diff --git a/apps/docs/docs/connectors/osctrl.md b/apps/docs/docs/connectors/osctrl.mdnew file mode 100644index 000000000..ac8196d40--- /dev/null+++ b/apps/docs/docs/connectors/osctrl.md@@ -0,0 +1,88 @@+---+sidebar_position: 14+title: osctrl+description: Pull osquery distributed-query results from osctrl into AiSOC for endpoint detection.+---++# osctrl++[osctrl](https://osctrl.net/) is an open-source osquery fleet manager. The osctrl+connector polls the admin REST API for **distributed-query results** and turns+each result row into a normalized AiSOC endpoint event. Severity is synthesised+from the osquery table that produced the row, so detection rules in+`detections/endpoint/` can promote interesting rows (e.g. a new entry in+`startup_items`) to high without having to reason about vendor-specific severity+fields.++This connector is read-only on its own. The companion [aisoc-direct+TLS endpoint](/docs/connectors/aisoc-direct) and the live-query response action+(see [agent capabilities](/docs/concepts/capabilities)) build on the same+auth surface to dispatch ad-hoc queries from playbooks.++## What you get++| Source | osctrl endpoint | Notes |+|---|---|---|+| Distributed-query results | `GET /api/v1/queries/{env}/list` + `/results/{name}` | One AiSOC event per result row |++Events are normalized with `category: endpoint` and the originating osquery+table is preserved as `osquery_table` for downstream routing.++## Prerequisites++- An installed and reachable **osctrl admin server** (`https://osctrl.example.com`).+- An **API token** issued from **Manage Users → \[user\] → generate token** in the osctrl UI.+- The **environment name** you want to poll (typically `prod`).++## Setup walkthrough++### 1. Issue an API token in osctrl++1. Sign in to the osctrl admin UI as an administrator.+2. Navigate to **Manage Users**, choose the service-account user, and click **generate token**.+3. Copy the token — it is only shown once.++osctrl tokens are long-lived; rotate them on the same cadence as your other+infrastructure secrets.++### 2. Add the connector in AiSOC++1. **Connectors → Add connector → osctrl**.+2. Fill in `base_url` (no trailing slash), `api_token`, and `environment`.+3. Leave **Verify TLS** enabled in production. Disable it only for self-signed lab deployments.+4. **Test connection** — the connector calls `GET /api/v1/nodes` to validate auth.+5. **Save**.++## Polling details++- Default interval: **300 seconds** (5 minutes), overridable per-instance via `connector_config.poll_interval_seconds`.+- `since_seconds` is honoured client-side because osctrl's list endpoint does not accept a server-side filter.++## Severity mapping++osctrl is a query/event platform, so it does not emit alerts with vendor+severity. AiSOC synthesises severity from the table queried:++| osquery table | AiSOC severity | Why |+|---|---|---|+| `startup_items`, `scheduled_tasks`, `launchd`, `crontab`, `kernel_extensions`, `kernel_modules`, `browser_extensions` | `high` | Persistence + execution surfaces |+| `file_events` | `medium` | FIM rows; detection rules promote write/delete events |+| `processes`, `process_open_sockets`, `listening_ports`, `logged_in_users` | `medium` | Runtime telemetry |+| `system_info`, `os_version`, `uptime` | `info` | Pure inventory |+| Anything else | `medium` | Conservative default |++Operators tune the mapping per environment via detections — the connector keeps+the defaults stable so detection authors have a predictable substrate.++## Troubleshooting++**`auth failure 401/403`** — the API token is missing or revoked. Re-issue from the osctrl UI.++**`no events_added`** — verify the environment name matches a valid osctrl environment, and that at least one distributed query has run recently.++**TLS handshake errors** — set `verify_tls: false` only when you are deliberately running an osctrl instance with a self-signed certificate. In production, install the CA chain instead.++## Related++- [FleetDM](/docs/connectors/fleetdm) — alternative osquery fleet manager with a similar event shape.+- [Detection coverage](/docs/detections/coverage) — endpoint rules that fire on osquery data.diff --git a/apps/docs/docs/detections/coverage.md b/apps/docs/docs/detections/coverage.mdindex b41007338..49db9a9b9 100644--- a/apps/docs/docs/detections/coverage.md+++ b/apps/docs/docs/detections/coverage.md@@ -11,7 +11,7 @@ sidebar_position: 2# Detection Coverage-Generated: `2026-05-09T22:49:53Z`+Generated: `2026-05-10T14:50:52Z`## Headline numbersdiff --git a/apps/docs/sidebars.ts b/apps/docs/sidebars.tsindex 968d12c70..6d9fca6a6 100644--- a/apps/docs/sidebars.ts+++ b/apps/docs/sidebars.ts@@ -48,6 +48,8 @@ const sidebars: SidebarsConfig = {"connectors/cloudflare","connectors/github","connectors/tailscale",+ "connectors/osctrl",+ "connectors/fleetdm",],},{diff --git a/apps/web/public/marketplace/curated.json b/apps/web/public/marketplace/curated.jsonindex fbd87340f..119fb750b 100644--- a/apps/web/public/marketplace/curated.json+++ b/apps/web/public/marketplace/curated.json@@ -1,7 +1,7 @@{"$schema": "https://aisoc.example.com/schemas/curated/v1.json","version": "1.0.0",- "generated": "2026-05-09T22:49:53Z",+ "generated": "2026-05-10T14:50:52Z","stats": {"considered": 1011,"eligible": 1008,diff --git a/apps/web/public/marketplace/index.json b/apps/web/public/marketplace/index.jsonindex 896357e13..acb637e34 100644--- a/apps/web/public/marketplace/index.json+++ b/apps/web/public/marketplace/index.json@@ -1,7 +1,7 @@{"$schema": "https://example.com/schemas/marketplace/v1.json","version": "1.0.0",- "generated": "2026-05-09T14:55:50Z",+ "generated": "2026-05-10T14:50:51Z","categories": [{"id": "playbooks",@@ -20,20 +20,20 @@}],"stats": {- "total": 7038,- "playbooks": 50,- "detections": 6948,- "plugins": 40,- "verified": 923,+ "total": 7077,+ "playbooks": 62,+ "detections": 6973,+ "plugins": 42,+ "verified": 962,"community": 0,"by_tier": {"beta": 2,"imported": 6113,- "stable": 923+ "stable": 962},"detections_by_tier": {"imported": 6113,- "stable": 835+ "stable": 860},"quarantined": 5937},@@ -99,10 +99,10 @@"T1037.005": 1,"T1039": 4,"T1040": 14,- "T1041": 19,- "T1046": 32,+ "T1041": 20,+ "T1046": 33,"T1047": 72,- "T1048": 14,+ "T1048": 15,"T1048.001": 1,"T1048.003": 19,"T1049": 16,@@ -128,7 +128,7 @@"T1056.001": 3,"T1056.002": 4,"T1057": 8,- "T1059": 119,+ "T1059": 120,"T1059.001": 243,"T1059.002": 10,"T1059.003": 41,@@ -139,7 +139,7 @@"T1059.009": 4,"T1059.012": 9,"T1059.013": 1,- "T1068": 36,+ "T1068": 37,"T1069": 8,"T1069.001": 29,"T1069.002": 35,@@ -152,7 +152,7 @@"T1070.005": 5,"T1070.006": 6,"T1070.008": 7,- "T1071": 12,+ "T1071": 14,"T1071.001": 54,"T1071.002": 1,"T1071.003": 3,@@ -160,11 +160,11 @@"T1072": 9,"T1074": 3,"T1074.001": 6,- "T1078": 126,+ "T1078": 127,"T1078.001": 10,"T1078.002": 14,"T1078.003": 11,- "T1078.004": 96,+ "T1078.004": 97,"T1082": 49,"T1083": 28,"T1087": 21,@@ -190,10 +190,10 @@"T1102.003": 2,"T1105": 118,"T1106": 11,- "T1110": 55,- "T1110.001": 17,+ "T1110": 57,+ "T1110.001": 18,"T1110.002": 1,- "T1110.003": 43,+ "T1110.003": 44,"T1110.004": 16,"T1112": 164,"T1113": 16,@@ -212,7 +212,7 @@"T1129": 2,"T1132.001": 4,"T1133": 67,- "T1134": 5,+ "T1134": 6,"T1134.001": 13,"T1134.002": 7,"T1134.003": 3,@@ -233,7 +233,7 @@"T1185": 12,"T1187": 12,"T1189": 4,- "T1190": 175,+ "T1190": 177,"T1195": 23,"T1195.001": 2,"T1195.002": 17,@@ -243,7 +243,7 @@"T1201": 14,"T1202": 45,"T1203": 28,- "T1204": 35,+ "T1204": 37,"T1204.001": 7,"T1204.002": 50,"T1204.003": 10,@@ -287,7 +287,7 @@"T1484.002": 6,"T1485": 83,"T1485.001": 2,- "T1486": 26,+ "T1486": 27,"T1489": 37,"T1490": 48,"T1491": 2,@@ -306,7 +306,7 @@"T1505": 4,"T1505.001": 7,"T1505.002": 3,- "T1505.003": 40,+ "T1505.003": 41,"T1505.004": 14,"T1505.005": 1,"T1505.006": 1,@@ -318,7 +318,7 @@"T1529": 16,"T1530": 46,"T1531": 20,- "T1535": 5,+ "T1535": 6,"T1537": 23,"T1538": 1,"T1539": 7,@@ -358,7 +358,7 @@"T1547.012": 7,"T1547.014": 3,"T1547.015": 3,- "T1548": 33,+ "T1548": 34,"T1548.001": 10,"T1548.002": 76,"T1548.003": 38,@@ -388,7 +388,7 @@"T1555.003": 15,"T1555.004": 6,"T1555.005": 5,- "T1556": 70,+ "T1556": 71,"T1556.001": 1,"T1556.002": 3,"T1556.003": 1,@@ -412,7 +412,7 @@"T1561.001": 2,"T1561.002": 4,"T1562": 28,- "T1562.001": 135,+ "T1562.001": 137,"T1562.002": 13,"T1562.003": 2,"T1562.004": 18,@@ -431,11 +431,11 @@"T1565": 3,"T1565.001": 11,"T1565.002": 3,- "T1566": 29,- "T1566.001": 51,+ "T1566": 30,+ "T1566.001": 52,"T1566.002": 14,"T1566.003": 1,- "T1567": 32,+ "T1567": 33,"T1567.001": 2,"T1567.002": 23,"T1568": 1,@@ -495,6 +495,7 @@"T1595.002": 7,"T1598": 1,"T1598.002": 1,+ "T1599": 1,"T1599.001": 1,"T1600.001": 1,"T1601.001": 1,@@ -503,8 +504,8 @@"T1608": 2,"T1608.003": 1,"T1609": 4,- "T1610": 11,- "T1611": 28,+ "T1610": 12,+ "T1611": 29,"T1612": 1,"T1613": 1,"T1614.001": 2,@@ -532,8 +533,8 @@"T1689": 1,"T1690": 1},- "unique_techniques": 492,- "total_with_mitre": 5745,+ "unique_techniques": 493,+ "total_with_mitre": 5757,"by_tier": {"stable": {"T1003": 2,@@ -555,9 +556,10 @@"T1037.001": 1,"T1037.004": 2,"T1040": 2,- "T1041": 7,- "T1046": 1,+ "T1041": 8,+ "T1046": 2,"T1047": 3,+ "T1048": 1,"T1048.003": 2,"T1052": 2,"T1052.001": 1,@@ -568,26 +570,26 @@"T1055": 2,"T1055.001": 1,"T1055.012": 1,- "T1059": 6,+ "T1059": 7,"T1059.001": 5,"T1059.002": 2,"T1059.004": 7,"T1059.005": 1,- "T1068": 1,+ "T1068": 2,"T1069.003": 1,"T1070": 2,"T1070.001": 3,"T1070.002": 1,"T1070.003": 2,- "T1071": 2,+ "T1071": 4,"T1071.001": 10,"T1071.004": 5,"T1074.001": 1,- "T1078": 35,+ "T1078": 36,"T1078.001": 4,"T1078.002": 3,"T1078.003": 1,- "T1078.004": 37,+ "T1078.004": 38,"T1083": 2,"T1087.001": 2,"T1087.002": 5,@@ -601,9 +603,9 @@"T1098.004": 6,"T1098.007": 1,"T1105": 3,- "T1110": 7,- "T1110.001": 3,- "T1110.003": 3,+ "T1110": 9,+ "T1110.001": 4,+ "T1110.003": 4,"T1110.004": 4,"T1112": 1,"T1113": 2,@@ -611,6 +613,7 @@"T1114.003": 4,"T1127.001": 1,"T1133": 13,+ "T1134": 1,"T1135": 2,"T1136": 2,"T1136.001": 4,@@ -618,11 +621,12 @@"T1140": 1,"T1176": 1,"T1185": 1,- "T1190": 28,+ "T1190": 30,"T1195": 2,"T1195.002": 10,"T1197": 1,"T1199": 15,+ "T1204": 2,"T1204.001": 1,"T1204.002": 5,"T1212": 2,@@ -642,7 +646,7 @@"T1484.001": 2,"T1484.002": 2,"T1485": 28,- "T1486": 7,+ "T1486": 8,"T1489": 1,"T1490": 7,"T1496": 2,@@ -650,11 +654,12 @@"T1498.001": 2,"T1498.002": 2,"T1499": 1,- "T1505.003": 2,+ "T1505.003": 3,"T1525": 8,"T1528": 6,"T1530": 36,"T1531": 5,+ "T1535": 1,"T1537": 10,"T1539": 4,"T1542.001": 1,@@ -677,6 +682,7 @@"T1547.006": 5,"T1547.010": 1,"T1547.015": 2,+ "T1548": 1,"T1548.001": 4,"T1548.002": 4,"T1548.003": 2,@@ -700,7 +706,7 @@"T1555.003": 3,"T1555.004": 1,"T1555.005": 1,- "T1556": 39,+ "T1556": 40,"T1556.001": 1,"T1556.003": 1,"T1556.004": 1,@@ -716,7 +722,7 @@"T1560.001": 3,"T1561.002": 1,"T1562": 5,- "T1562.001": 38,+ "T1562.001": 40,"T1562.004": 7,"T1562.006": 2,"T1562.007": 1,@@ -725,11 +731,11 @@"T1564.008": 1,"T1565.001": 4,"T1565.002": 1,- "T1566": 2,- "T1566.001": 1,+ "T1566": 3,+ "T1566.001": 2,"T1566.002": 2,"T1566.003": 1,- "T1567": 11,+ "T1567": 12,"T1567.002": 7,"T1568.001": 2,"T1568.002": 2,@@ -744,11 +750,12 @@"T1583.001": 4,"T1592": 2,"T1595.002": 1,+ "T1599": 1,"T1600.001": 1,"T1606.002": 1,"T1609": 1,- "T1610": 11,- "T1611": 24,+ "T1610": 12,+ "T1611": 25,"T1612": 1,"T1620": 2,"T1621": 5,@@ -1228,6 +1235,105 @@}},"items": [+ {+ "id": "account-takeover-response-v1",+ "type": "detection",+ "name": "Account Takeover Response",+ "description": "Responds to suspected account takeover (ATO) events. Forces session termination, resets credentials, enables MFA enforcement, and notifies the user and security team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "account-takeover",+ "identity",+ "iam",+ "credential-compromise"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/account-takeover-response.yaml"+ },+ {+ "id": "anomalous-behavior-response-v1",+ "type": "detection",+ "name": "Anomalous User Behavior Response",+ "description": "Responds to anomalous user behavior flagged by UEBA systems including unusual access patterns, after-hours activity, mass data access, or deviation from behavioral baselines. Escalates based on risk score and enables adaptive authentication controls.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "anomalous",+ "ueba",+ "behavioral-analytics",+ "identity",+ "insider"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/anomalous-behavior-response.yaml"+ },+ {+ "id": "bec-response-v1",+ "type": "detection",+ "name": "Business Email Compromise (BEC) Response",+ "description": "Responds to Business Email Compromise alerts. Identifies spoofed or compromised executive accounts used to initiate fraudulent wire transfers or sensitive data requests. Blocks sender, alerts finance/legal, and coordinates with email gateway.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "bec",+ "email",+ "fraud",+ "executive",+ "financial-fraud"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/bec-response.yaml"+ },+ {+ "id": "brute-force-response-v1",+ "type": "detection",+ "name": "Brute Force Attack Response",+ "description": "Responds to brute force and credential stuffing attacks against authentication endpoints. Implements progressive lockout, blocks attacking IPs, enables CAPTCHA enforcement, and notifies the security team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "brute-force",+ "credential-stuffing",+ "authentication",+ "network",+ "identity"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/brute-force-response.yaml"+ },{"id": "chronicle-detection-rules-a-scheduled-task-was-created","type": "detection",@@ -28415,6 +28521,82 @@"upstream_path": "rules/_deprecated/soc_prime_rules/threat_hunting/sysmon/zusy_malware_detector__sysmon_behavior___august_2019.yaral"}},+ {+ "id": "cloud-takeover-response-v1",+ "type": "detection",+ "name": "Cloud Account Takeover Response",+ "description": "Responds to cloud account takeover or unauthorized IAM activity. Disables compromised credentials, revokes suspicious API keys, audits recent API calls, and alerts the cloud security team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "cloud",+ "account-takeover",+ "iam",+ "aws",+ "gcp",+ "azure"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/cloud-takeover-response.yaml"+ },+ {+ "id": "container-escape-response-v1",+ "type": "detection",+ "name": "Container Escape Response",+ "description": "Responds to detected container escape attempts or privileged container misuse. Terminates the offending container, cordons the node, captures runtime forensics, and alerts the platform security team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "container",+ "kubernetes",+ "docker",+ "escape",+ "runtime-security"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/container-escape-response.yaml"+ },+ {+ "id": "critical-vulnerability-response-v1",+ "type": "detection",+ "name": "Critical Vulnerability Response",+ "description": "Responds to critical CVEs (CVSS >= 9.0) affecting production systems. Triggers emergency patch workflows, scans for exploitation indicators, applies virtual patching via WAF/IPS where possible, and escalates to the vulnerability management team with a remediation deadline.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "vulnerability",+ "cve",+ "patch-management",+ "critical",+ "vuln-management"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/critical-vulnerability-response.yaml"+ },{"id": "det-application-001","type": "detection",@@ -47665,6 +47847,232 @@"enabled": true,"path": "detections/network/net-stp-topology-change-from-edge.yaml"},+ {+ "id": "dlp-violation-response-v1",+ "type": "detection",+ "name": "DLP Policy Violation Response",+ "description": "Responds to data loss prevention (DLP) policy violations including unauthorized data transfers, sensitive document uploads to personal storage, or PII/PHI exfiltration attempts. Blocks the transfer, notifies compliance, and preserves audit evidence.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "dlp",+ "data-loss-prevention",+ "compliance",+ "pii",+ "phi",+ "exfiltration"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/dlp-violation-response.yaml"+ },+ {+ "id": "host-containment-response-v1",+ "type": "detection",+ "name": "Host Containment Response",+ "description": "General-purpose host containment playbook for any threat requiring immediate endpoint isolation. Performs pre-isolation forensic collection, isolates the host, notifies the IR team, and starts the investigation workflow.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "containment",+ "endpoint",+ "isolation",+ "edr",+ "incident-response"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/host-containment-response.yaml"+ },+ {+ "id": "iam-key-compromise-response-v1",+ "type": "detection",+ "name": "IAM Key Compromise Response",+ "description": "Responds to compromised IAM access keys including keys exposed in public repositories, leaked in logs, or used from unexpected geolocations. Immediately disables the key, audits recent API usage, and rotates credentials.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "iam",+ "aws",+ "cloud",+ "key-compromise",+ "credential-leak"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/iam-key-compromise-response.yaml"+ },+ {+ "id": "ids-alert-response-v1",+ "type": "detection",+ "name": "IDS/IPS Alert Response",+ "description": "Responds to Intrusion Detection/Prevention System alerts including network scans, exploitation attempts, and protocol anomalies. Blocks the attacking source, captures PCAP evidence, and notifies the network security team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "ids",+ "ips",+ "network",+ "intrusion-detection",+ "nids"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/ids-alert-response.yaml"+ },+ {+ "id": "insider-threat-response-v1",+ "type": "detection",+ "name": "Insider Threat Response",+ "description": "Responds to suspected insider threat activity including unauthorized data access, bulk downloads, privilege abuse, or off-hours anomalous activity. Escalates to HR and Legal with full audit trail.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "insider-threat",+ "dlp",+ "ueba",+ "identity",+ "data-exfiltration"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/insider-threat-response.yaml"+ },+ {+ "id": "iso-27001-violation-response-v1",+ "type": "detection",+ "name": "ISO 27001 Control Violation Response",+ "description": "Responds to ISO 27001 information security control violations including unauthorized access to sensitive information, policy breaches, and audit findings. Creates compliance records, notifies the CISO, and initiates corrective action procedures.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "iso27001",+ "compliance",+ "governance",+ "policy-violation",+ "audit"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/iso-27001-violation-response.yaml"+ },+ {+ "id": "lateral-movement-response-v1",+ "type": "detection",+ "name": "Lateral Movement Response",+ "description": "Responds to detected lateral movement activity including pass-the-hash, pass-the-ticket, remote service abuse, and admin share enumeration. Isolates affected hosts, revokes lateral credentials, and maps the blast radius.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "lateral-movement",+ "endpoint",+ "network",+ "credential-abuse",+ "active-directory"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/lateral-movement-response.yaml"+ },+ {+ "id": "malware-detection-response-v1",+ "type": "detection",+ "name": "Malware Detection Response",+ "description": "Responds to malware detections across endpoints. Quarantines the malicious file, isolates the host if needed, runs deep scan, and notifies the IR team. Supports trojan, spyware, adware, worm, and backdoor classifications.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "malware",+ "endpoint",+ "edr",+ "antivirus",+ "containment"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/malware-detection-response.yaml"+ },+ {+ "id": "mfa-fatigue-response-v1",+ "type": "detection",+ "name": "MFA Fatigue Attack Response",+ "description": "Responds to MFA push fatigue attacks where attackers spam authentication requests hoping the user accidentally approves. Detects rapid successive MFA prompts, temporarily blocks push notifications, and forces re-enrollment.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "mfa-fatigue",+ "identity",+ "authentication",+ "push-bombing",+ "account-takeover"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/mfa-fatigue-response.yaml"+ },{"id": "mitre-car-car-2013-01-003","type": "detection",@@ -50883,6 +51291,130 @@"upstream_path": "analytics/CAR-2022-03-001.yaml"}},+ {+ "id": "oauth-abuse-response-v1",+ "type": "detection",+ "name": "OAuth Application Abuse Response",+ "description": "Responds to OAuth application abuse including consent phishing, malicious app grants, and unauthorized OAuth token usage. Revokes malicious app access, audits all consented apps, and notifies affected users.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "oauth",+ "identity",+ "saas",+ "consent-phishing",+ "app-abuse"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/oauth-abuse-response.yaml"+ },+ {+ "id": "phishing-response-v1",+ "type": "detection",+ "name": "Phishing Email Response",+ "description": "Responds to confirmed or suspected phishing emails. Quarantines the message across the tenant, extracts and blocks malicious URLs and sender domains, identifies other recipients, and triggers user awareness notifications.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "phishing",+ "email",+ "identity",+ "containment"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/phishing-response.yaml"+ },+ {+ "id": "privilege-escalation-response-v1",+ "type": "detection",+ "name": "Privilege Escalation Response",+ "description": "Responds to detected privilege escalation attempts including sudo abuse, SUID/SGID exploitation, token impersonation, or role assignment anomalies. Revokes elevated privileges, isolates the session, and logs forensic evidence.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "privilege-escalation",+ "endpoint",+ "linux",+ "windows",+ "iam"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/privilege-escalation-response.yaml"+ },+ {+ "id": "ransomware-containment-v1",+ "type": "detection",+ "name": "Ransomware Containment & Eradication",+ "description": "Automated containment and eradication playbook for ransomware incidents. Isolates affected hosts, blocks C2 IPs, snapshots disk state for forensics, and notifies the security team with remediation steps.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "ransomware",+ "malware",+ "containment",+ "endpoint",+ "high-severity"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/ransomware-containment.yaml"+ },+ {+ "id": "s3-bucket-exposure-response-v1",+ "type": "detection",+ "name": "S3 Bucket Exposure Response",+ "description": "Responds to S3 bucket misconfigurations including public access enablement, ACL changes granting anonymous access, and unexpected data exfiltration from buckets. Remediates public access, audits bucket policy, and notifies cloud security.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "s3",+ "cloud",+ "aws",+ "misconfiguration",+ "data-exposure"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/s3-bucket-exposure-response.yaml"+ },{"id": "sigmahq-sigma-0022869c-49f7-4ff2-ba03-85ac42ddac58","type": "detection",@@ -221156,6 +221688,136 @@"upstream_path": "detections/endpoint/windows_registry_delete_task_sd.yml"}},+ {+ "id": "supply-chain-compromise-v1",+ "type": "detection",+ "name": "Supply Chain Compromise Response",+ "description": "Responds to suspected supply chain attacks including malicious package updates, compromised third-party libraries, or tampered build artifacts. Quarantines affected builds, notifies DevSecOps, and triggers a software inventory audit.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "supply-chain",+ "devops",+ "sca",+ "build-security",+ "oss"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/supply-chain-compromise.yaml"+ },+ {+ "id": "suspicious-signin-response-v1",+ "type": "detection",+ "name": "Suspicious Sign-In Response",+ "description": "Responds to suspicious sign-in events including impossible travel, new country logins, known bad IP addresses, or sign-ins outside business hours. Triggers step-up authentication or session termination based on risk score.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "sign-in",+ "identity",+ "authentication",+ "impossible-travel",+ "conditional-access"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/suspicious-signin-response.yaml"+ },+ {+ "id": "token-theft-response-v1",+ "type": "detection",+ "name": "Authentication Token Theft Response",+ "description": "Responds to stolen authentication token usage including JWT hijacking, session cookie theft, and bearer token replay attacks. Revokes tokens, forces re-authentication, and checks for downstream unauthorized access.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "token-theft",+ "identity",+ "jwt",+ "session-hijacking",+ "authentication"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/token-theft-response.yaml"+ },+ {+ "id": "web-application-attack-v1",+ "type": "detection",+ "name": "Web Application Attack Response",+ "description": "Responds to web application attacks including SQL injection, XSS, RCE, and directory traversal. Blocks attacking IPs, captures forensic evidence, checks for data exfiltration, and notifies the AppSec team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "web",+ "appsec",+ "waf",+ "sqli",+ "xss",+ "rce"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/web-application-attack.yaml"+ },+ {+ "id": "anomalous-data-transfer-response-v1",+ "type": "playbook",+ "name": "Anomalous Data Transfer: DLP / Exfiltration Response",+ "description": "Triggered by a DLP or UEBA alert detecting an anomalously large or out-of-policy data transfer, potential exfiltration to external destination, or sensitive data leaving the organization. Correlates evidence, blocks destination if malicious, and disables the user if compromise is confirmed.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "data-exfiltration",+ "dlp",+ "ueba",+ "anomalous-data",+ "insider-threat"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 11,+ "category": "anomalous-data",+ "mitre_techniques": [+ "T1041",+ "T1048",+ "T1567"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/anomalous-data/anomalous-data-transfer-response.playbook.json"+ },{"id": "ato-credential-stuffing-v1","type": "playbook",@@ -221409,6 +222071,61 @@"enabled": true,"path": "playbooks/packs/v1/bec/bec-vendor-payment-redirect.playbook.json"},+ {+ "id": "brute-force-lockout-v1",+ "type": "playbook",+ "name": "Brute Force: Account Lockout and Source Block",+ "description": "Triggered by detection of repeated failed authentication attempts (password spray, credential stuffing, RDP/SSH brute force). Locks out the targeted account, blocks the source IP, and triggers investigation.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "brute-force",+ "credential-stuffing",+ "password-spray",+ "authentication"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 10,+ "category": "brute-force",+ "mitre_techniques": [+ "T1110",+ "T1110.001",+ "T1110.003"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/brute-force/brute-force-lockout.playbook.json"+ },+ {+ "id": "cloud-ato-response-v1",+ "type": "playbook",+ "name": "Cloud ATO: Compromised Cloud Account Response",+ "description": "Triggered by anomalous API activity, impossible travel, or cloud CSPM alert indicating a compromised cloud account. Revokes active sessions, rotates credentials, preserves audit trail, and notifies cloud security team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "cloud-account-takeover",+ "cloud",+ "iam",+ "identity"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 9,+ "category": "cloud-account-takeover",+ "mitre_techniques": [+ "T1078.004",+ "T1535"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/cloud-account-takeover/cloud-ato-response.playbook.json"+ },{"id": "cloud-azure-blob-public-v1","type": "playbook",@@ -221668,6 +222385,32 @@"enabled": true,"path": "playbooks/packs/v1/cloud-misconfig/cloud-security-group-open.playbook.json"},+ {+ "id": "container-escape-response-v1",+ "type": "playbook",+ "name": "Container Escape: Runtime Breach Response",+ "description": "Triggered by container runtime security alert (Falco, Sysdig, or similar) indicating a container escape attempt or successful breakout to the host. Kills the offending container, isolates the node, and preserves evidence.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "container-escape",+ "container",+ "kubernetes"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 9,+ "category": "container-escape",+ "mitre_techniques": [+ "T1611",+ "T1610"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/container-escape/container-escape-response.playbook.json"+ },{"id": "ddos-amplification-dns-v1","type": "playbook",@@ -221793,6 +222536,34 @@"enabled": true,"path": "playbooks/packs/v1/ddos/ddos-volumetric-l3.playbook.json"},+ {+ "id": "endpoint-isolation-response-v1",+ "type": "playbook",+ "name": "Endpoint Isolation: EDR-Driven Host Quarantine",+ "description": "Triggered when an endpoint requires emergency isolation due to confirmed or high-confidence compromise (ransomware spread, active C2 communication, lateral movement staging). Uses EDR to network-isolate the host while preserving management connectivity, collects forensic artifacts, and notifies the SOC.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "endpoint-isolation",+ "edr",+ "quarantine",+ "host-isolation"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 11,+ "category": "endpoint-isolation",+ "mitre_techniques": [+ "T1562.001",+ "T1204",+ "T1486"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/endpoint-isolation/endpoint-isolation-response.playbook.json"+ },{"id": "exfil-archive-egress-v1","type": "playbook",@@ -221918,6 +222689,35 @@"enabled": true,"path": "playbooks/packs/v1/data-exfil/exfil-removable-media.playbook.json"},+ {+ "id": "ids-critical-response-v1",+ "type": "playbook",+ "name": "IDS/IPS Critical Alert: Network Intrusion Response",+ "description": "Triggered by an IDS/IPS signature at critical severity indicating active exploitation, C2 communication, or lateral movement detected at the network layer. Enriches source IP, blocks traffic, and escalates.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "ids-critical",+ "ids",+ "ips",+ "network",+ "intrusion"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 9,+ "category": "ids-critical",+ "mitre_techniques": [+ "T1046",+ "T1190",+ "T1071"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/ids-critical/ids-critical-response.playbook.json"+ },{"id": "insider-after-hours-access-v1","type": "playbook",@@ -222168,6 +222968,112 @@"enabled": true,"path": "playbooks/packs/v1/lateral-movement/lateral-rdp-spray.playbook.json"},+ {+ "id": "malware-execution-response-v1",+ "type": "playbook",+ "name": "Malware Execution: Detection & Containment",+ "description": "Triggered by EDR alert for confirmed or suspected malware execution (trojan, infostealer, dropper, RAT). Quarantines the host, kills the malicious process, collects evidence, and notifies the SOC.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "malware",+ "endpoint",+ "execution"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 10,+ "category": "malware",+ "mitre_techniques": [+ "T1204",+ "T1059",+ "T1071"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/malware/malware-execution-response.playbook.json"+ },+ {+ "id": "network-containment-response-v1",+ "type": "playbook",+ "name": "Network Containment: Segment Isolation Response",+ "description": "Triggered by an alert requiring network-level containment of a host or subnet. Coordinates firewall/security-group rule changes to block lateral movement while preserving forensics and management access.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "network-containment",+ "containment",+ "network"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 9,+ "category": "network-containment",+ "mitre_techniques": [+ "T1562.001",+ "T1599"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/network-containment/network-containment-response.playbook.json"+ },+ {+ "id": "phishing-investigation-v1",+ "type": "playbook",+ "name": "Phishing: Email Investigation & Remediation",+ "description": "Triggered by a phishing alert from email gateway or user report. Extracts IOCs, retracts the message fleet-wide, blocks sender domain, and resets any credentials that may have been compromised.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "phishing",+ "email",+ "identity"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 11,+ "category": "phishing",+ "mitre_techniques": [+ "T1566",+ "T1566.001"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/phishing/phishing-investigation.playbook.json"+ },+ {+ "id": "privesc-response-v1",+ "type": "playbook",+ "name": "Privilege Escalation: Detection & Containment",+ "description": "Triggered by EDR or SIEM alert for privilege escalation activity (sudo abuse, token impersonation, LSASS dump, UAC bypass, etc.). Collects forensics, disables the account if confirmed malicious, and escalates to Tier-2 for post-exploitation review.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "privilege-escalation",+ "endpoint",+ "identity"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 9,+ "category": "privilege-escalation",+ "mitre_techniques": [+ "T1068",+ "T1548",+ "T1134"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/privilege-escalation/privesc-response.playbook.json"+ },{"id": "ransomware-c2-block-v1","type": "playbook",@@ -222417,6 +223323,59 @@"enabled": true,"path": "playbooks/packs/v1/supply-chain/supply-vendor-breach.playbook.json"},+ {+ "id": "suspicious-signin-response-v1",+ "type": "playbook",+ "name": "Suspicious Sign-In: Anomalous Authentication Response",+ "description": "Triggered by identity provider or SIEM alert for a suspicious sign-in event (impossible travel, new device, unknown location, off-hours, anomalous behavior score). Verifies legitimacy, enforces MFA step-up, and disables if confirmed malicious.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "suspicious-signin",+ "identity",+ "authentication"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 10,+ "category": "suspicious-signin",+ "mitre_techniques": [+ "T1078",+ "T1110",+ "T1556"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/suspicious-signin/suspicious-signin-response.playbook.json"+ },+ {+ "id": "web-compromise-response-v1",+ "type": "playbook",+ "name": "Web Compromise: Defacement / Webshell Response",+ "description": "Triggered by WAF alert, IDS signature, or file-integrity alert indicating a compromised web server (webshell upload, defacement, or unauthorized content modification). Isolates the server, captures forensics, and initiates recovery workflow.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "web-compromise",+ "web",+ "endpoint"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 10,+ "category": "web-compromise",+ "mitre_techniques": [+ "T1505.003",+ "T1190"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/web-compromise/web-compromise-response.playbook.json"+ },{"id": "auth0","type": "plugin",@@ -222745,6 +223704,31 @@"tier": "beta","path": "plugins/email-inbox/plugin.yaml"},+ {+ "id": "fleetdm",+ "type": "plugin",+ "name": "FleetDM Connector",+ "description": "FleetDM \u2014 osquery fleet manager (commercial-friendly OSS). Pulls host posture changes (online/offline/missing) and saved-query report rows from the Fleet REST API. Severity for query rows is derived from the osquery table queried; host posture transitions get their own severity ladder.",+ "version": "1.0.0",+ "author": "AiSOC Core Team",+ "tags": [+ "edr",+ "fleetdm",+ "osquery",+ "endpoint",+ "open-source"+ ],+ "plugin_type": "connector",+ "license": "MIT",+ "homepage": "https://github.com/beenuar/AiSOC/tree/main/services/connectors/app/connectors/fleetdm.py",+ "min_aisoc_version": "4.0.0",+ "sdks": [],+ "mitre_techniques": [],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "path": "plugins/fleetdm/plugin.yaml"+ },{"id": "gcp-cloud-audit","type": "plugin",@@ -223121,6 +224105,31 @@"tier": "stable","path": "plugins/onepassword-events/plugin.yaml"},+ {+ "id": "osctrl",+ "type": "plugin",+ "name": "osctrl Connector",+ "description": "osctrl \u2014 open-source osquery fleet manager. Pulls distributed-query results and node telemetry from the osctrl admin API. Synthesises severity from the osquery table queried so detection rules can promote interesting rows.",+ "version": "1.0.0",+ "author": "AiSOC Core Team",+ "tags": [+ "edr",+ "osctrl",+ "osquery",+ "endpoint",+ "open-source"+ ],+ "plugin_type": "connector",+ "license": "MIT",+ "homepage": "https://github.com/beenuar/AiSOC/tree/main/services/connectors/app/connectors/osctrl.py",+ "min_aisoc_version": "4.0.0",+ "sdks": [],+ "mitre_techniques": [],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "path": "plugins/osctrl/plugin.yaml"+ },{"id": "pagerduty-paging","type": "plugin",diff --git a/marketplace/curated.json b/marketplace/curated.jsonindex fbd87340f..119fb750b 100644--- a/marketplace/curated.json+++ b/marketplace/curated.json@@ -1,7 +1,7 @@{"$schema": "https://aisoc.example.com/schemas/curated/v1.json","version": "1.0.0",- "generated": "2026-05-09T22:49:53Z",+ "generated": "2026-05-10T14:50:52Z","stats": {"considered": 1011,"eligible": 1008,diff --git a/marketplace/index.json b/marketplace/index.jsonindex 896357e13..acb637e34 100644--- a/marketplace/index.json+++ b/marketplace/index.json@@ -1,7 +1,7 @@{"$schema": "https://example.com/schemas/marketplace/v1.json","version": "1.0.0",- "generated": "2026-05-09T14:55:50Z",+ "generated": "2026-05-10T14:50:51Z","categories": [{"id": "playbooks",@@ -20,20 +20,20 @@}],"stats": {- "total": 7038,- "playbooks": 50,- "detections": 6948,- "plugins": 40,- "verified": 923,+ "total": 7077,+ "playbooks": 62,+ "detections": 6973,+ "plugins": 42,+ "verified": 962,"community": 0,"by_tier": {"beta": 2,"imported": 6113,- "stable": 923+ "stable": 962},"detections_by_tier": {"imported": 6113,- "stable": 835+ "stable": 860},"quarantined": 5937},@@ -99,10 +99,10 @@"T1037.005": 1,"T1039": 4,"T1040": 14,- "T1041": 19,- "T1046": 32,+ "T1041": 20,+ "T1046": 33,"T1047": 72,- "T1048": 14,+ "T1048": 15,"T1048.001": 1,"T1048.003": 19,"T1049": 16,@@ -128,7 +128,7 @@"T1056.001": 3,"T1056.002": 4,"T1057": 8,- "T1059": 119,+ "T1059": 120,"T1059.001": 243,"T1059.002": 10,"T1059.003": 41,@@ -139,7 +139,7 @@"T1059.009": 4,"T1059.012": 9,"T1059.013": 1,- "T1068": 36,+ "T1068": 37,"T1069": 8,"T1069.001": 29,"T1069.002": 35,@@ -152,7 +152,7 @@"T1070.005": 5,"T1070.006": 6,"T1070.008": 7,- "T1071": 12,+ "T1071": 14,"T1071.001": 54,"T1071.002": 1,"T1071.003": 3,@@ -160,11 +160,11 @@"T1072": 9,"T1074": 3,"T1074.001": 6,- "T1078": 126,+ "T1078": 127,"T1078.001": 10,"T1078.002": 14,"T1078.003": 11,- "T1078.004": 96,+ "T1078.004": 97,"T1082": 49,"T1083": 28,"T1087": 21,@@ -190,10 +190,10 @@"T1102.003": 2,"T1105": 118,"T1106": 11,- "T1110": 55,- "T1110.001": 17,+ "T1110": 57,+ "T1110.001": 18,"T1110.002": 1,- "T1110.003": 43,+ "T1110.003": 44,"T1110.004": 16,"T1112": 164,"T1113": 16,@@ -212,7 +212,7 @@"T1129": 2,"T1132.001": 4,"T1133": 67,- "T1134": 5,+ "T1134": 6,"T1134.001": 13,"T1134.002": 7,"T1134.003": 3,@@ -233,7 +233,7 @@"T1185": 12,"T1187": 12,"T1189": 4,- "T1190": 175,+ "T1190": 177,"T1195": 23,"T1195.001": 2,"T1195.002": 17,@@ -243,7 +243,7 @@"T1201": 14,"T1202": 45,"T1203": 28,- "T1204": 35,+ "T1204": 37,"T1204.001": 7,"T1204.002": 50,"T1204.003": 10,@@ -287,7 +287,7 @@"T1484.002": 6,"T1485": 83,"T1485.001": 2,- "T1486": 26,+ "T1486": 27,"T1489": 37,"T1490": 48,"T1491": 2,@@ -306,7 +306,7 @@"T1505": 4,"T1505.001": 7,"T1505.002": 3,- "T1505.003": 40,+ "T1505.003": 41,"T1505.004": 14,"T1505.005": 1,"T1505.006": 1,@@ -318,7 +318,7 @@"T1529": 16,"T1530": 46,"T1531": 20,- "T1535": 5,+ "T1535": 6,"T1537": 23,"T1538": 1,"T1539": 7,@@ -358,7 +358,7 @@"T1547.012": 7,"T1547.014": 3,"T1547.015": 3,- "T1548": 33,+ "T1548": 34,"T1548.001": 10,"T1548.002": 76,"T1548.003": 38,@@ -388,7 +388,7 @@"T1555.003": 15,"T1555.004": 6,"T1555.005": 5,- "T1556": 70,+ "T1556": 71,"T1556.001": 1,"T1556.002": 3,"T1556.003": 1,@@ -412,7 +412,7 @@"T1561.001": 2,"T1561.002": 4,"T1562": 28,- "T1562.001": 135,+ "T1562.001": 137,"T1562.002": 13,"T1562.003": 2,"T1562.004": 18,@@ -431,11 +431,11 @@"T1565": 3,"T1565.001": 11,"T1565.002": 3,- "T1566": 29,- "T1566.001": 51,+ "T1566": 30,+ "T1566.001": 52,"T1566.002": 14,"T1566.003": 1,- "T1567": 32,+ "T1567": 33,"T1567.001": 2,"T1567.002": 23,"T1568": 1,@@ -495,6 +495,7 @@"T1595.002": 7,"T1598": 1,"T1598.002": 1,+ "T1599": 1,"T1599.001": 1,"T1600.001": 1,"T1601.001": 1,@@ -503,8 +504,8 @@"T1608": 2,"T1608.003": 1,"T1609": 4,- "T1610": 11,- "T1611": 28,+ "T1610": 12,+ "T1611": 29,"T1612": 1,"T1613": 1,"T1614.001": 2,@@ -532,8 +533,8 @@"T1689": 1,"T1690": 1},- "unique_techniques": 492,- "total_with_mitre": 5745,+ "unique_techniques": 493,+ "total_with_mitre": 5757,"by_tier": {"stable": {"T1003": 2,@@ -555,9 +556,10 @@"T1037.001": 1,"T1037.004": 2,"T1040": 2,- "T1041": 7,- "T1046": 1,+ "T1041": 8,+ "T1046": 2,"T1047": 3,+ "T1048": 1,"T1048.003": 2,"T1052": 2,"T1052.001": 1,@@ -568,26 +570,26 @@"T1055": 2,"T1055.001": 1,"T1055.012": 1,- "T1059": 6,+ "T1059": 7,"T1059.001": 5,"T1059.002": 2,"T1059.004": 7,"T1059.005": 1,- "T1068": 1,+ "T1068": 2,"T1069.003": 1,"T1070": 2,"T1070.001": 3,"T1070.002": 1,"T1070.003": 2,- "T1071": 2,+ "T1071": 4,"T1071.001": 10,"T1071.004": 5,"T1074.001": 1,- "T1078": 35,+ "T1078": 36,"T1078.001": 4,"T1078.002": 3,"T1078.003": 1,- "T1078.004": 37,+ "T1078.004": 38,"T1083": 2,"T1087.001": 2,"T1087.002": 5,@@ -601,9 +603,9 @@"T1098.004": 6,"T1098.007": 1,"T1105": 3,- "T1110": 7,- "T1110.001": 3,- "T1110.003": 3,+ "T1110": 9,+ "T1110.001": 4,+ "T1110.003": 4,"T1110.004": 4,"T1112": 1,"T1113": 2,@@ -611,6 +613,7 @@"T1114.003": 4,"T1127.001": 1,"T1133": 13,+ "T1134": 1,"T1135": 2,"T1136": 2,"T1136.001": 4,@@ -618,11 +621,12 @@"T1140": 1,"T1176": 1,"T1185": 1,- "T1190": 28,+ "T1190": 30,"T1195": 2,"T1195.002": 10,"T1197": 1,"T1199": 15,+ "T1204": 2,"T1204.001": 1,"T1204.002": 5,"T1212": 2,@@ -642,7 +646,7 @@"T1484.001": 2,"T1484.002": 2,"T1485": 28,- "T1486": 7,+ "T1486": 8,"T1489": 1,"T1490": 7,"T1496": 2,@@ -650,11 +654,12 @@"T1498.001": 2,"T1498.002": 2,"T1499": 1,- "T1505.003": 2,+ "T1505.003": 3,"T1525": 8,"T1528": 6,"T1530": 36,"T1531": 5,+ "T1535": 1,"T1537": 10,"T1539": 4,"T1542.001": 1,@@ -677,6 +682,7 @@"T1547.006": 5,"T1547.010": 1,"T1547.015": 2,+ "T1548": 1,"T1548.001": 4,"T1548.002": 4,"T1548.003": 2,@@ -700,7 +706,7 @@"T1555.003": 3,"T1555.004": 1,"T1555.005": 1,- "T1556": 39,+ "T1556": 40,"T1556.001": 1,"T1556.003": 1,"T1556.004": 1,@@ -716,7 +722,7 @@"T1560.001": 3,"T1561.002": 1,"T1562": 5,- "T1562.001": 38,+ "T1562.001": 40,"T1562.004": 7,"T1562.006": 2,"T1562.007": 1,@@ -725,11 +731,11 @@"T1564.008": 1,"T1565.001": 4,"T1565.002": 1,- "T1566": 2,- "T1566.001": 1,+ "T1566": 3,+ "T1566.001": 2,"T1566.002": 2,"T1566.003": 1,- "T1567": 11,+ "T1567": 12,"T1567.002": 7,"T1568.001": 2,"T1568.002": 2,@@ -744,11 +750,12 @@"T1583.001": 4,"T1592": 2,"T1595.002": 1,+ "T1599": 1,"T1600.001": 1,"T1606.002": 1,"T1609": 1,- "T1610": 11,- "T1611": 24,+ "T1610": 12,+ "T1611": 25,"T1612": 1,"T1620": 2,"T1621": 5,@@ -1228,6 +1235,105 @@}},"items": [+ {+ "id": "account-takeover-response-v1",+ "type": "detection",+ "name": "Account Takeover Response",+ "description": "Responds to suspected account takeover (ATO) events. Forces session termination, resets credentials, enables MFA enforcement, and notifies the user and security team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "account-takeover",+ "identity",+ "iam",+ "credential-compromise"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/account-takeover-response.yaml"+ },+ {+ "id": "anomalous-behavior-response-v1",+ "type": "detection",+ "name": "Anomalous User Behavior Response",+ "description": "Responds to anomalous user behavior flagged by UEBA systems including unusual access patterns, after-hours activity, mass data access, or deviation from behavioral baselines. Escalates based on risk score and enables adaptive authentication controls.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "anomalous",+ "ueba",+ "behavioral-analytics",+ "identity",+ "insider"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/anomalous-behavior-response.yaml"+ },+ {+ "id": "bec-response-v1",+ "type": "detection",+ "name": "Business Email Compromise (BEC) Response",+ "description": "Responds to Business Email Compromise alerts. Identifies spoofed or compromised executive accounts used to initiate fraudulent wire transfers or sensitive data requests. Blocks sender, alerts finance/legal, and coordinates with email gateway.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "bec",+ "email",+ "fraud",+ "executive",+ "financial-fraud"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/bec-response.yaml"+ },+ {+ "id": "brute-force-response-v1",+ "type": "detection",+ "name": "Brute Force Attack Response",+ "description": "Responds to brute force and credential stuffing attacks against authentication endpoints. Implements progressive lockout, blocks attacking IPs, enables CAPTCHA enforcement, and notifies the security team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "brute-force",+ "credential-stuffing",+ "authentication",+ "network",+ "identity"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/brute-force-response.yaml"+ },{"id": "chronicle-detection-rules-a-scheduled-task-was-created","type": "detection",@@ -28415,6 +28521,82 @@"upstream_path": "rules/_deprecated/soc_prime_rules/threat_hunting/sysmon/zusy_malware_detector__sysmon_behavior___august_2019.yaral"}},+ {+ "id": "cloud-takeover-response-v1",+ "type": "detection",+ "name": "Cloud Account Takeover Response",+ "description": "Responds to cloud account takeover or unauthorized IAM activity. Disables compromised credentials, revokes suspicious API keys, audits recent API calls, and alerts the cloud security team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "cloud",+ "account-takeover",+ "iam",+ "aws",+ "gcp",+ "azure"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/cloud-takeover-response.yaml"+ },+ {+ "id": "container-escape-response-v1",+ "type": "detection",+ "name": "Container Escape Response",+ "description": "Responds to detected container escape attempts or privileged container misuse. Terminates the offending container, cordons the node, captures runtime forensics, and alerts the platform security team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "container",+ "kubernetes",+ "docker",+ "escape",+ "runtime-security"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/container-escape-response.yaml"+ },+ {+ "id": "critical-vulnerability-response-v1",+ "type": "detection",+ "name": "Critical Vulnerability Response",+ "description": "Responds to critical CVEs (CVSS >= 9.0) affecting production systems. Triggers emergency patch workflows, scans for exploitation indicators, applies virtual patching via WAF/IPS where possible, and escalates to the vulnerability management team with a remediation deadline.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "vulnerability",+ "cve",+ "patch-management",+ "critical",+ "vuln-management"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/critical-vulnerability-response.yaml"+ },{"id": "det-application-001","type": "detection",@@ -47665,6 +47847,232 @@"enabled": true,"path": "detections/network/net-stp-topology-change-from-edge.yaml"},+ {+ "id": "dlp-violation-response-v1",+ "type": "detection",+ "name": "DLP Policy Violation Response",+ "description": "Responds to data loss prevention (DLP) policy violations including unauthorized data transfers, sensitive document uploads to personal storage, or PII/PHI exfiltration attempts. Blocks the transfer, notifies compliance, and preserves audit evidence.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "dlp",+ "data-loss-prevention",+ "compliance",+ "pii",+ "phi",+ "exfiltration"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/dlp-violation-response.yaml"+ },+ {+ "id": "host-containment-response-v1",+ "type": "detection",+ "name": "Host Containment Response",+ "description": "General-purpose host containment playbook for any threat requiring immediate endpoint isolation. Performs pre-isolation forensic collection, isolates the host, notifies the IR team, and starts the investigation workflow.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "containment",+ "endpoint",+ "isolation",+ "edr",+ "incident-response"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/host-containment-response.yaml"+ },+ {+ "id": "iam-key-compromise-response-v1",+ "type": "detection",+ "name": "IAM Key Compromise Response",+ "description": "Responds to compromised IAM access keys including keys exposed in public repositories, leaked in logs, or used from unexpected geolocations. Immediately disables the key, audits recent API usage, and rotates credentials.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "iam",+ "aws",+ "cloud",+ "key-compromise",+ "credential-leak"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/iam-key-compromise-response.yaml"+ },+ {+ "id": "ids-alert-response-v1",+ "type": "detection",+ "name": "IDS/IPS Alert Response",+ "description": "Responds to Intrusion Detection/Prevention System alerts including network scans, exploitation attempts, and protocol anomalies. Blocks the attacking source, captures PCAP evidence, and notifies the network security team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "ids",+ "ips",+ "network",+ "intrusion-detection",+ "nids"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/ids-alert-response.yaml"+ },+ {+ "id": "insider-threat-response-v1",+ "type": "detection",+ "name": "Insider Threat Response",+ "description": "Responds to suspected insider threat activity including unauthorized data access, bulk downloads, privilege abuse, or off-hours anomalous activity. Escalates to HR and Legal with full audit trail.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "insider-threat",+ "dlp",+ "ueba",+ "identity",+ "data-exfiltration"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/insider-threat-response.yaml"+ },+ {+ "id": "iso-27001-violation-response-v1",+ "type": "detection",+ "name": "ISO 27001 Control Violation Response",+ "description": "Responds to ISO 27001 information security control violations including unauthorized access to sensitive information, policy breaches, and audit findings. Creates compliance records, notifies the CISO, and initiates corrective action procedures.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "iso27001",+ "compliance",+ "governance",+ "policy-violation",+ "audit"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/iso-27001-violation-response.yaml"+ },+ {+ "id": "lateral-movement-response-v1",+ "type": "detection",+ "name": "Lateral Movement Response",+ "description": "Responds to detected lateral movement activity including pass-the-hash, pass-the-ticket, remote service abuse, and admin share enumeration. Isolates affected hosts, revokes lateral credentials, and maps the blast radius.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "lateral-movement",+ "endpoint",+ "network",+ "credential-abuse",+ "active-directory"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/lateral-movement-response.yaml"+ },+ {+ "id": "malware-detection-response-v1",+ "type": "detection",+ "name": "Malware Detection Response",+ "description": "Responds to malware detections across endpoints. Quarantines the malicious file, isolates the host if needed, runs deep scan, and notifies the IR team. Supports trojan, spyware, adware, worm, and backdoor classifications.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "malware",+ "endpoint",+ "edr",+ "antivirus",+ "containment"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/malware-detection-response.yaml"+ },+ {+ "id": "mfa-fatigue-response-v1",+ "type": "detection",+ "name": "MFA Fatigue Attack Response",+ "description": "Responds to MFA push fatigue attacks where attackers spam authentication requests hoping the user accidentally approves. Detects rapid successive MFA prompts, temporarily blocks push notifications, and forces re-enrollment.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "mfa-fatigue",+ "identity",+ "authentication",+ "push-bombing",+ "account-takeover"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/mfa-fatigue-response.yaml"+ },{"id": "mitre-car-car-2013-01-003","type": "detection",@@ -50883,6 +51291,130 @@"upstream_path": "analytics/CAR-2022-03-001.yaml"}},+ {+ "id": "oauth-abuse-response-v1",+ "type": "detection",+ "name": "OAuth Application Abuse Response",+ "description": "Responds to OAuth application abuse including consent phishing, malicious app grants, and unauthorized OAuth token usage. Revokes malicious app access, audits all consented apps, and notifies affected users.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "oauth",+ "identity",+ "saas",+ "consent-phishing",+ "app-abuse"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/oauth-abuse-response.yaml"+ },+ {+ "id": "phishing-response-v1",+ "type": "detection",+ "name": "Phishing Email Response",+ "description": "Responds to confirmed or suspected phishing emails. Quarantines the message across the tenant, extracts and blocks malicious URLs and sender domains, identifies other recipients, and triggers user awareness notifications.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "phishing",+ "email",+ "identity",+ "containment"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/phishing-response.yaml"+ },+ {+ "id": "privilege-escalation-response-v1",+ "type": "detection",+ "name": "Privilege Escalation Response",+ "description": "Responds to detected privilege escalation attempts including sudo abuse, SUID/SGID exploitation, token impersonation, or role assignment anomalies. Revokes elevated privileges, isolates the session, and logs forensic evidence.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "privilege-escalation",+ "endpoint",+ "linux",+ "windows",+ "iam"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/privilege-escalation-response.yaml"+ },+ {+ "id": "ransomware-containment-v1",+ "type": "detection",+ "name": "Ransomware Containment & Eradication",+ "description": "Automated containment and eradication playbook for ransomware incidents. Isolates affected hosts, blocks C2 IPs, snapshots disk state for forensics, and notifies the security team with remediation steps.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "ransomware",+ "malware",+ "containment",+ "endpoint",+ "high-severity"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/ransomware-containment.yaml"+ },+ {+ "id": "s3-bucket-exposure-response-v1",+ "type": "detection",+ "name": "S3 Bucket Exposure Response",+ "description": "Responds to S3 bucket misconfigurations including public access enablement, ACL changes granting anonymous access, and unexpected data exfiltration from buckets. Remediates public access, audits bucket policy, and notifies cloud security.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "s3",+ "cloud",+ "aws",+ "misconfiguration",+ "data-exposure"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/s3-bucket-exposure-response.yaml"+ },{"id": "sigmahq-sigma-0022869c-49f7-4ff2-ba03-85ac42ddac58","type": "detection",@@ -221156,6 +221688,136 @@"upstream_path": "detections/endpoint/windows_registry_delete_task_sd.yml"}},+ {+ "id": "supply-chain-compromise-v1",+ "type": "detection",+ "name": "Supply Chain Compromise Response",+ "description": "Responds to suspected supply chain attacks including malicious package updates, compromised third-party libraries, or tampered build artifacts. Quarantines affected builds, notifies DevSecOps, and triggers a software inventory audit.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "supply-chain",+ "devops",+ "sca",+ "build-security",+ "oss"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/supply-chain-compromise.yaml"+ },+ {+ "id": "suspicious-signin-response-v1",+ "type": "detection",+ "name": "Suspicious Sign-In Response",+ "description": "Responds to suspicious sign-in events including impossible travel, new country logins, known bad IP addresses, or sign-ins outside business hours. Triggers step-up authentication or session termination based on risk score.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "sign-in",+ "identity",+ "authentication",+ "impossible-travel",+ "conditional-access"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/suspicious-signin-response.yaml"+ },+ {+ "id": "token-theft-response-v1",+ "type": "detection",+ "name": "Authentication Token Theft Response",+ "description": "Responds to stolen authentication token usage including JWT hijacking, session cookie theft, and bearer token replay attacks. Revokes tokens, forces re-authentication, and checks for downstream unauthorized access.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "token-theft",+ "identity",+ "jwt",+ "session-hijacking",+ "authentication"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/token-theft-response.yaml"+ },+ {+ "id": "web-application-attack-v1",+ "type": "detection",+ "name": "Web Application Attack Response",+ "description": "Responds to web application attacks including SQL injection, XSS, RCE, and directory traversal. Blocks attacking IPs, captures forensic evidence, checks for data exfiltration, and notifies the AppSec team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "web",+ "appsec",+ "waf",+ "sqli",+ "xss",+ "rce"+ ],+ "severity": null,+ "category": "playbooks",+ "mitre_techniques": [],+ "log_source": null,+ "playbook": null,+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "detections/playbooks/web-application-attack.yaml"+ },+ {+ "id": "anomalous-data-transfer-response-v1",+ "type": "playbook",+ "name": "Anomalous Data Transfer: DLP / Exfiltration Response",+ "description": "Triggered by a DLP or UEBA alert detecting an anomalously large or out-of-policy data transfer, potential exfiltration to external destination, or sensitive data leaving the organization. Correlates evidence, blocks destination if malicious, and disables the user if compromise is confirmed.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "data-exfiltration",+ "dlp",+ "ueba",+ "anomalous-data",+ "insider-threat"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 11,+ "category": "anomalous-data",+ "mitre_techniques": [+ "T1041",+ "T1048",+ "T1567"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/anomalous-data/anomalous-data-transfer-response.playbook.json"+ },{"id": "ato-credential-stuffing-v1","type": "playbook",@@ -221409,6 +222071,61 @@"enabled": true,"path": "playbooks/packs/v1/bec/bec-vendor-payment-redirect.playbook.json"},+ {+ "id": "brute-force-lockout-v1",+ "type": "playbook",+ "name": "Brute Force: Account Lockout and Source Block",+ "description": "Triggered by detection of repeated failed authentication attempts (password spray, credential stuffing, RDP/SSH brute force). Locks out the targeted account, blocks the source IP, and triggers investigation.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "brute-force",+ "credential-stuffing",+ "password-spray",+ "authentication"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 10,+ "category": "brute-force",+ "mitre_techniques": [+ "T1110",+ "T1110.001",+ "T1110.003"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/brute-force/brute-force-lockout.playbook.json"+ },+ {+ "id": "cloud-ato-response-v1",+ "type": "playbook",+ "name": "Cloud ATO: Compromised Cloud Account Response",+ "description": "Triggered by anomalous API activity, impossible travel, or cloud CSPM alert indicating a compromised cloud account. Revokes active sessions, rotates credentials, preserves audit trail, and notifies cloud security team.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "cloud-account-takeover",+ "cloud",+ "iam",+ "identity"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 9,+ "category": "cloud-account-takeover",+ "mitre_techniques": [+ "T1078.004",+ "T1535"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/cloud-account-takeover/cloud-ato-response.playbook.json"+ },{"id": "cloud-azure-blob-public-v1","type": "playbook",@@ -221668,6 +222385,32 @@"enabled": true,"path": "playbooks/packs/v1/cloud-misconfig/cloud-security-group-open.playbook.json"},+ {+ "id": "container-escape-response-v1",+ "type": "playbook",+ "name": "Container Escape: Runtime Breach Response",+ "description": "Triggered by container runtime security alert (Falco, Sysdig, or similar) indicating a container escape attempt or successful breakout to the host. Kills the offending container, isolates the node, and preserves evidence.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "container-escape",+ "container",+ "kubernetes"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 9,+ "category": "container-escape",+ "mitre_techniques": [+ "T1611",+ "T1610"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/container-escape/container-escape-response.playbook.json"+ },{"id": "ddos-amplification-dns-v1","type": "playbook",@@ -221793,6 +222536,34 @@"enabled": true,"path": "playbooks/packs/v1/ddos/ddos-volumetric-l3.playbook.json"},+ {+ "id": "endpoint-isolation-response-v1",+ "type": "playbook",+ "name": "Endpoint Isolation: EDR-Driven Host Quarantine",+ "description": "Triggered when an endpoint requires emergency isolation due to confirmed or high-confidence compromise (ransomware spread, active C2 communication, lateral movement staging). Uses EDR to network-isolate the host while preserving management connectivity, collects forensic artifacts, and notifies the SOC.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "endpoint-isolation",+ "edr",+ "quarantine",+ "host-isolation"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 11,+ "category": "endpoint-isolation",+ "mitre_techniques": [+ "T1562.001",+ "T1204",+ "T1486"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/endpoint-isolation/endpoint-isolation-response.playbook.json"+ },{"id": "exfil-archive-egress-v1","type": "playbook",@@ -221918,6 +222689,35 @@"enabled": true,"path": "playbooks/packs/v1/data-exfil/exfil-removable-media.playbook.json"},+ {+ "id": "ids-critical-response-v1",+ "type": "playbook",+ "name": "IDS/IPS Critical Alert: Network Intrusion Response",+ "description": "Triggered by an IDS/IPS signature at critical severity indicating active exploitation, C2 communication, or lateral movement detected at the network layer. Enriches source IP, blocks traffic, and escalates.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "ids-critical",+ "ids",+ "ips",+ "network",+ "intrusion"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 9,+ "category": "ids-critical",+ "mitre_techniques": [+ "T1046",+ "T1190",+ "T1071"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/ids-critical/ids-critical-response.playbook.json"+ },{"id": "insider-after-hours-access-v1","type": "playbook",@@ -222168,6 +222968,112 @@"enabled": true,"path": "playbooks/packs/v1/lateral-movement/lateral-rdp-spray.playbook.json"},+ {+ "id": "malware-execution-response-v1",+ "type": "playbook",+ "name": "Malware Execution: Detection & Containment",+ "description": "Triggered by EDR alert for confirmed or suspected malware execution (trojan, infostealer, dropper, RAT). Quarantines the host, kills the malicious process, collects evidence, and notifies the SOC.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "malware",+ "endpoint",+ "execution"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 10,+ "category": "malware",+ "mitre_techniques": [+ "T1204",+ "T1059",+ "T1071"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/malware/malware-execution-response.playbook.json"+ },+ {+ "id": "network-containment-response-v1",+ "type": "playbook",+ "name": "Network Containment: Segment Isolation Response",+ "description": "Triggered by an alert requiring network-level containment of a host or subnet. Coordinates firewall/security-group rule changes to block lateral movement while preserving forensics and management access.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "network-containment",+ "containment",+ "network"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 9,+ "category": "network-containment",+ "mitre_techniques": [+ "T1562.001",+ "T1599"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/network-containment/network-containment-response.playbook.json"+ },+ {+ "id": "phishing-investigation-v1",+ "type": "playbook",+ "name": "Phishing: Email Investigation & Remediation",+ "description": "Triggered by a phishing alert from email gateway or user report. Extracts IOCs, retracts the message fleet-wide, blocks sender domain, and resets any credentials that may have been compromised.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "phishing",+ "email",+ "identity"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 11,+ "category": "phishing",+ "mitre_techniques": [+ "T1566",+ "T1566.001"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/phishing/phishing-investigation.playbook.json"+ },+ {+ "id": "privesc-response-v1",+ "type": "playbook",+ "name": "Privilege Escalation: Detection & Containment",+ "description": "Triggered by EDR or SIEM alert for privilege escalation activity (sudo abuse, token impersonation, LSASS dump, UAC bypass, etc.). Collects forensics, disables the account if confirmed malicious, and escalates to Tier-2 for post-exploitation review.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "privilege-escalation",+ "endpoint",+ "identity"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 9,+ "category": "privilege-escalation",+ "mitre_techniques": [+ "T1068",+ "T1548",+ "T1134"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/privilege-escalation/privesc-response.playbook.json"+ },{"id": "ransomware-c2-block-v1","type": "playbook",@@ -222417,6 +223323,59 @@"enabled": true,"path": "playbooks/packs/v1/supply-chain/supply-vendor-breach.playbook.json"},+ {+ "id": "suspicious-signin-response-v1",+ "type": "playbook",+ "name": "Suspicious Sign-In: Anomalous Authentication Response",+ "description": "Triggered by identity provider or SIEM alert for a suspicious sign-in event (impossible travel, new device, unknown location, off-hours, anomalous behavior score). Verifies legitimacy, enforces MFA step-up, and disables if confirmed malicious.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "suspicious-signin",+ "identity",+ "authentication"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 10,+ "category": "suspicious-signin",+ "mitre_techniques": [+ "T1078",+ "T1110",+ "T1556"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/suspicious-signin/suspicious-signin-response.playbook.json"+ },+ {+ "id": "web-compromise-response-v1",+ "type": "playbook",+ "name": "Web Compromise: Defacement / Webshell Response",+ "description": "Triggered by WAF alert, IDS signature, or file-integrity alert indicating a compromised web server (webshell upload, defacement, or unauthorized content modification). Isolates the server, captures forensics, and initiates recovery workflow.",+ "version": "1.0.0",+ "author": "Beenu - [email protected]",+ "tags": [+ "web-compromise",+ "web",+ "endpoint"+ ],+ "severity": "critical",+ "trigger": "alert",+ "steps": 10,+ "category": "web-compromise",+ "mitre_techniques": [+ "T1505.003",+ "T1190"+ ],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "enabled": true,+ "path": "playbooks/packs/v1/web-compromise/web-compromise-response.playbook.json"+ },{"id": "auth0","type": "plugin",@@ -222745,6 +223704,31 @@"tier": "beta","path": "plugins/email-inbox/plugin.yaml"},+ {+ "id": "fleetdm",+ "type": "plugin",+ "name": "FleetDM Connector",+ "description": "FleetDM \u2014 osquery fleet manager (commercial-friendly OSS). Pulls host posture changes (online/offline/missing) and saved-query report rows from the Fleet REST API. Severity for query rows is derived from the osquery table queried; host posture transitions get their own severity ladder.",+ "version": "1.0.0",+ "author": "AiSOC Core Team",+ "tags": [+ "edr",+ "fleetdm",+ "osquery",+ "endpoint",+ "open-source"+ ],+ "plugin_type": "connector",+ "license": "MIT",+ "homepage": "https://github.com/beenuar/AiSOC/tree/main/services/connectors/app/connectors/fleetdm.py",+ "min_aisoc_version": "4.0.0",+ "sdks": [],+ "mitre_techniques": [],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "path": "plugins/fleetdm/plugin.yaml"+ },{"id": "gcp-cloud-audit","type": "plugin",@@ -223121,6 +224105,31 @@"tier": "stable","path": "plugins/onepassword-events/plugin.yaml"},+ {+ "id": "osctrl",+ "type": "plugin",+ "name": "osctrl Connector",+ "description": "osctrl \u2014 open-source osquery fleet manager. Pulls distributed-query results and node telemetry from the osctrl admin API. Synthesises severity from the osquery table queried so detection rules can promote interesting rows.",+ "version": "1.0.0",+ "author": "AiSOC Core Team",+ "tags": [+ "edr",+ "osctrl",+ "osquery",+ "endpoint",+ "open-source"+ ],+ "plugin_type": "connector",+ "license": "MIT",+ "homepage": "https://github.com/beenuar/AiSOC/tree/main/services/connectors/app/connectors/osctrl.py",+ "min_aisoc_version": "4.0.0",+ "sdks": [],+ "mitre_techniques": [],+ "verified": true,+ "source": "core",+ "tier": "stable",+ "path": "plugins/osctrl/plugin.yaml"+ },{"id": "pagerduty-paging","type": "plugin",diff --git a/plugins/fleetdm/plugin.yaml b/plugins/fleetdm/plugin.yamlnew file mode 100644index 000000000..20af1301d--- /dev/null+++ b/plugins/fleetdm/plugin.yaml@@ -0,0 +1,33 @@+id: fleetdm+name: FleetDM Connector+version: "1.0.0"+plugin_type: connector+tier: stable+description: >+ FleetDM — osquery fleet manager (commercial-friendly OSS). Pulls host posture+ changes (online/offline/missing) and saved-query report rows from the Fleet+ REST API. Severity for query rows is derived from the osquery table queried;+ host posture transitions get their own severity ladder.+author: AiSOC Core Team+tags: [edr, fleetdm, osquery, endpoint, open-source]+homepage: https://github.com/beenuar/AiSOC/tree/main/services/connectors/app/connectors/fleetdm.py+license: MIT+min_aisoc_version: "4.0.0"+config_schema:+ type: object+ required: [base_url, api_token]+ properties:+ base_url:+ type: string+ description: "Base URL of the Fleet server (no trailing slash). The /api prefix is added automatically."+ api_token:+ type: string+ description: "Long-lived token issued from the Fleet UI under Settings -> Users -> [user] -> Get API token."+ secret: true+ team_id:+ type: string+ description: "Optional Fleet Team ID to scope queries to. Leave empty to span all teams."+ verify_tls:+ type: boolean+ description: "Verify TLS certificate when calling the Fleet REST API."+ default: truediff --git a/plugins/osctrl/plugin.yaml b/plugins/osctrl/plugin.yamlnew file mode 100644index 000000000..c9289a07f--- /dev/null+++ b/plugins/osctrl/plugin.yaml@@ -0,0 +1,33 @@+id: osctrl+name: osctrl Connector+version: "1.0.0"+plugin_type: connector+tier: stable+description: >+ osctrl — open-source osquery fleet manager. Pulls distributed-query results+ and node telemetry from the osctrl admin API. Synthesises severity from the+ osquery table queried so detection rules can promote interesting rows.+author: AiSOC Core Team+tags: [edr, osctrl, osquery, endpoint, open-source]+homepage: https://github.com/beenuar/AiSOC/tree/main/services/connectors/app/connectors/osctrl.py+license: MIT+min_aisoc_version: "4.0.0"+config_schema:+ type: object+ required: [base_url, api_token]+ properties:+ base_url:+ type: string+ description: "Base URL of the osctrl admin server (no trailing slash). Use https in production."+ api_token:+ type: string+ description: "Long-lived admin token issued from the osctrl UI under Manage Users -> generate token."+ secret: true+ environment:+ type: string+ description: "osctrl environment to scope queries to (e.g. 'prod', 'corp'). Required for distributed queries."+ default: "prod"+ verify_tls:+ type: boolean+ description: "Verify TLS certificate when calling the osctrl admin API."+ default: truediff --git a/services/connectors/app/connectors/__init__.py b/services/connectors/app/connectors/__init__.pyindex 24529ec52..73aa888a2 100644--- a/services/connectors/app/connectors/__init__.py+++ b/services/connectors/app/connectors/__init__.py@@ -33,6 +33,7 @@ from app.connectors.datadog_cloud_siem import DatadogCloudSIEMConnectorfrom app.connectors.duo_security import DuoSecurityConnectorfrom app.connectors.elastic import ElasticConnectorfrom app.connectors.email_inbox import EmailInboxConnector+from app.connectors.fleetdm import FleetDMConnectorfrom app.connectors.gcp_cloud_audit import GCPCloudAuditConnectorfrom app.connectors.gcp_scc import GCPSCCConnectorfrom app.connectors.github import GitHubConnector@@ -44,6 +45,7 @@ from app.connectors.microsoft_sentinel import MicrosoftSentinelConnectorfrom app.connectors.mimecast import MimecastConnectorfrom app.connectors.okta import OktaConnectorfrom app.connectors.onepassword import OnePasswordConnector+from app.connectors.osctrl import OsctrlConnectorfrom app.connectors.proofpoint import ProofpointConnectorfrom app.connectors.rapid7_insightidr import Rapid7InsightIDRConnectorfrom app.connectors.salesforce import SalesforceConnector@@ -83,6 +85,7 @@ _CONNECTOR_CLASSES: tuple[type[BaseConnector], ...] = (DuoSecurityConnector,ElasticConnector,EmailInboxConnector,+ FleetDMConnector,GCPCloudAuditConnector,GCPSCCConnector,GitHubConnector,@@ -94,6 +97,7 @@ _CONNECTOR_CLASSES: tuple[type[BaseConnector], ...] = (MimecastConnector,OktaConnector,OnePasswordConnector,+ OsctrlConnector,ProofpointConnector,Rapid7InsightIDRConnector,SalesforceConnector,@@ -173,6 +177,7 @@ __all__ = ["ElasticConnector","EmailInboxConnector","Field",+ "FleetDMConnector","GCPCloudAuditConnector","GCPSCCConnector","GitHubConnector",@@ -185,6 +190,7 @@ __all__ = ["OAuthHints","OktaConnector","OnePasswordConnector",+ "OsctrlConnector","ProofpointConnector","Rapid7InsightIDRConnector","SalesforceConnector",diff --git a/services/connectors/app/connectors/fleetdm.py b/services/connectors/app/connectors/fleetdm.pynew file mode 100644index 000000000..37470491c--- /dev/null+++ b/services/connectors/app/connectors/fleetdm.py@@ -0,0 +1,350 @@+"""+FleetDM connector — commercial-grade osquery fleet manager.++FleetDM exposes a versioned REST API under ``/api/v1/fleet`` (alias+``/api/latest/fleet``) authenticated with a long-lived API token from a+service-account user.++The two telemetry surfaces we care about for v1 are:++ * ``GET /api/v1/fleet/hosts`` — host inventory + posture (online/offline,+ last_seen, gigs free, OS/version, MDM enrolment).+ * ``GET /api/v1/fleet/queries/<id>/report`` — saved-query result rows+ aggregated across hosts.++PR1 wires up read-only fetch + normalize. The action client in PR3 layers+the live-query verb (``POST /api/v1/fleet/queries/run``) on top of the+same auth surface, which is why ``QUERY_PROCESSES`` is declared here.++API references:+ https://fleetdm.com/docs/rest-api/rest-api+ https://fleetdm.com/docs/using-fleet/api-versioning+"""++from __future__ import annotations++from datetime import UTC, datetime+from typing import Any++import httpx+import structlog++from app.connectors.base import BaseConnector, Capability, ConnectorSchema, Field++logger = structlog.get_logger()+++# ---------------------------------------------------------------------------+# FleetDM host status -> AiSOC severity+#+# FleetDM does not stream "alerts" in the traditional sense — its primary+# signal at the host level is the ``status`` field (online / offline /+# missing / new). We map host posture changes into the four-tier ladder+# so downstream detections can fire on transitions ("host went missing")+# without having to special-case the connector.+#+# Saved-query report rows reuse the same severity logic as osctrl+# (table-driven, defaults to medium) — see _table_severity.+# ---------------------------------------------------------------------------++_FLEET_HOST_STATUS_SEVERITY: dict[str, str] = {+ "online": "info",+ "new": "info",+ "offline": "low",+ "missing": "medium",+ "mia": "medium",+}++_FLEET_TABLE_SEVERITY: dict[str, str] = {+ # Persistence+ "startup_items": "high",+ "scheduled_tasks": "high",+ "launchd": "high",+ "crontab": "high",+ "kernel_extensions": "high",+ "kernel_modules": "high",+ "browser_extensions": "high",+ # FIM+ "file_events": "medium",+ # Runtime+ "processes": "medium",+ "process_open_sockets": "medium",+ "listening_ports": "medium",+ "logged_in_users": "medium",+ # Inventory+ "system_info": "info",+ "os_version": "info",+ "uptime": "info",+}+++def _table_severity(table: str | None) -> str:+ if not table:+ return "medium"+ return _FLEET_TABLE_SEVERITY.get(table.strip().lower(), "medium")+++def _host_status_severity(status: str | None) -> str:+ if not status:+ return "info"+ return _FLEET_HOST_STATUS_SEVERITY.get(status.strip().lower(), "info")+++class FleetDMConnector(BaseConnector):+ """FleetDM — osquery fleet manager (commercial-friendly OSS)."""++ connector_id = "fleetdm"+ connector_name = "FleetDM"+ connector_category = "edr"++ @classmethod+ def capabilities(cls) -> tuple[Capability, ...]:+ return (+ Capability.PULL_LOGS,+ Capability.QUERY_LOGS,+ Capability.QUERY_PROCESSES,+ Capability.PIVOT_HOST,+ )++ @classmethod+ def schema(cls) -> ConnectorSchema:+ return ConnectorSchema(+ connector_id=cls.connector_id,+ connector_name=cls.connector_name,+ category=cls.connector_category,+ description=("FleetDM — osquery fleet manager. Pulls host posture and saved-query results from the Fleet REST API."),+ docs_url="/docs/connectors/fleetdm",+ fields=[+ Field(+ "base_url",+ "string",+ "Fleet Server URL",+ placeholder="https://fleet.example.com",+ help_text=("Base URL of the Fleet server (no trailing slash). The /api prefix is added automatically."),+ ),+ Field(+ "api_token",+ "secret",+ "API Token",+ help_text=("Long-lived token issued from the Fleet UI under Settings -> Users -> [user] -> Get API token."),+ ),+ Field(+ "team_id",+ "string",+ "Team ID",+ required=False,+ help_text=("Optional Fleet Team ID to scope queries to. Leave empty to span all teams."),+ ),+ Field(+ "verify_tls",+ "boolean",+ "Verify TLS Certificate",+ required=False,+ default=True,+ ),+ ],+ )++ def __init__(+ self,+ base_url: str,+ api_token: str,+ team_id: str | None = None,+ verify_tls: bool = True,+ ):+ self._base_url = base_url.rstrip("/")+ self._api_token = api_token+ self._team_id = team_id or None+ self._verify_tls = bool(verify_tls)++ # ---- helpers ------------------------------------------------------++ def _headers(self) -> dict[str, str]:+ return {+ "Authorization": f"Bearer {self._api_token}",+ "Accept": "application/json",+ "User-Agent": "AiSOC/connectors-fleetdm",+ }++ # ---- runtime ------------------------------------------------------++ async def test_connection(self) -> dict[str, Any]:+ try:+ async with httpx.AsyncClient(timeout=15.0, verify=self._verify_tls) as client:+ resp = await client.get(+ f"{self._base_url}/api/v1/fleet/me",+ headers=self._headers(),+ )+ if resp.status_code == 200:+ return {"success": True, "connector": self.connector_id}+ if resp.status_code in (401, 403):+ return {+ "success": False,+ "connector": self.connector_id,+ "error": "authentication failed; check api_token",+ }+ return {+ "success": False,+ "connector": self.connector_id,+ "error": f"unexpected status {resp.status_code}",+ }+ except httpx.RequestError as exc:+ return {+ "success": False,+ "connector": self.connector_id,+ "error": f"network error: {exc}",+ }++ async def fetch_alerts(self, since_seconds: int = 300) -> list[dict[str, Any]]:+ """Pull host posture changes + recent saved-query report rows.++ We deliberately fetch *both* surfaces in a single poll so the SOC+ sees host-level signals (offline/missing) alongside query+ evidence rows. The two are clearly tagged via ``raw_event.kind``+ for downstream routing.+ """+ events: list[dict[str, Any]] = []+ cutoff = datetime.now(UTC).timestamp() - max(since_seconds, 0)+ params: dict[str, str] = {"per_page": "200"}+ if self._team_id:+ params["team_id"] = self._team_id++ try:+ async with httpx.AsyncClient(timeout=30.0, verify=self._verify_tls) as client:+ # ---- hosts -----------------------------------------+ hosts_resp = await client.get(+ f"{self._base_url}/api/v1/fleet/hosts",+ headers=self._headers(),+ params=params,+ )+ if hosts_resp.status_code == 200:+ body = hosts_resp.json() or {}+ hosts = body.get("hosts") if isinstance(body, dict) else []+ if isinstance(hosts, list):+ for host in hosts:+ seen = _parse_iso(host.get("seen_time"))+ # Only emit hosts that changed within the+ # window. We fall back to including the host+ # when seen_time is missing rather than drop+ # signal.+ if seen is not None and seen < cutoff:+ continue+ events.append(self.normalize({"kind": "host", "host": host}))+ else:+ logger.warning(+ "fleetdm.hosts_fetch_failed",+ status=hosts_resp.status_code,+ body=hosts_resp.text[:300],+ )++ # ---- saved-query reports ---------------------------+ queries_resp = await client.get(+ f"{self._base_url}/api/v1/fleet/queries",+ headers=self._headers(),+ params={"per_page": "100", **({"team_id": self._team_id} if self._team_id else {})},+ )+ if queries_resp.status_code == 200:+ qbody = queries_resp.json() or {}+ queries = qbody.get("queries") if isinstance(qbody, dict) else []+ if isinstance(queries, list):+ for q in queries[:50]:+ qid = q.get("id")+ if qid is None:+ continue+ rep_resp = await client.get(+ f"{self._base_url}/api/v1/fleet/queries/{qid}/report",+ headers=self._headers(),+ )+ if rep_resp.status_code != 200:+ continue+ rbody = rep_resp.json() or {}+ rows = rbody.get("results") if isinstance(rbody, dict) else []+ if not isinstance(rows, list):+ continue+ for row in rows:+ last_fetched = _parse_iso(row.get("last_fetched"))+ if last_fetched is not None and last_fetched < cutoff:+ continue+ events.append(+ self.normalize(+ {+ "kind": "query_row",+ "query": q,+ "row": row,+ }+ )+ )+ except httpx.RequestError as exc:+ logger.warning("fleetdm.fetch_exception", error=str(exc))+ return []++ return events++ def normalize(self, raw: dict[str, Any]) -> dict[str, Any]:+ kind = raw.get("kind")+ if kind == "host":+ host = raw.get("host") or {}+ status = host.get("status")+ return {+ "source": self.connector_id,+ "category": "endpoint",+ "severity": _host_status_severity(status),+ "title": f"FleetDM host status: {status or 'unknown'}",+ "description": (f"hostname={host.get('hostname')} platform={host.get('platform')} os={host.get('os_version')}"),+ "alert_id": f"fleetdm-host-{host.get('id')}-{status}",+ "hostname": host.get("hostname"),+ "host": host.get("hostname"),+ "external_id": str(host.get("id")) if host.get("id") is not None else None,+ "raw_event": host,+ "raw": raw,+ }++ # default: query report row+ query = raw.get("query") or {}+ row = raw.get("row") or {}+ table = _infer_table(query.get("query"))+ host_name = row.get("host_hostname") or row.get("hostname")+ return {+ "source": self.connector_id,+ "category": "endpoint",+ "severity": _table_severity(table),+ "title": f"FleetDM query: {query.get('name') or query.get('id')}",+ "description": (query.get("query") or "")[:400],+ "alert_id": (f"fleetdm-q{query.get('id')}-h{row.get('host_id') or row.get('host_hostname')}"),+ "hostname": host_name,+ "host": host_name,+ "external_id": str(query.get("id")) if query.get("id") is not None else None,+ "osquery_table": table,+ "raw_event": row,+ "raw": raw,+ }+++# ---------------------------------------------------------------------------+# Helpers+# ---------------------------------------------------------------------------+++def _parse_iso(value: Any) -> float | None:+ if value is None:+ return None+ if isinstance(value, (int, float)):+ return float(value)+ if isinstance(value, str):+ try:+ return datetime.fromisoformat(value.replace("Z", "+00:00")).timestamp()+ except ValueError:+ return None+ return None+++def _infer_table(query_sql: str | None) -> str | None:+ if not query_sql:+ return None+ lower = query_sql.lower()+ idx = lower.find(" from ")+ if idx < 0:+ return None+ rest = query_sql[idx + len(" from ") :].strip()+ token = rest.split()[0] if rest else ""+ return token.strip(",;()`'\"") or Nonediff --git a/services/connectors/app/connectors/osctrl.py b/services/connectors/app/connectors/osctrl.pynew file mode 100644index 000000000..fa8efeb54--- /dev/null+++ b/services/connectors/app/connectors/osctrl.py@@ -0,0 +1,319 @@+"""+osctrl connector — open-source osquery fleet manager.++osctrl exposes a REST API under /api/v1 for node management, distributed+queries, and result retrieval. Auth is a long-lived API token issued from+the osctrl admin console (Manage Users -> generate token).++Why a dedicated connector (vs. routing through fleetdm) — osctrl is a+distinct project with a different data model (no "host status" bucketing,+flat node list, environment-scoped queries) and a different deployment+profile (often run by labs / smaller teams that explicitly chose+not-FleetDM). Treating them as separate first-class connectors keeps the+schema stable for both deployment patterns.++API references:+ https://osctrl.net/installation/ # admin token issuance+ https://osctrl.net/usage/ # /api/v1/queries, /api/v1/nodes+ https://osctrl.net/api/ # endpoint reference+"""++from __future__ import annotations++from datetime import UTC, datetime+from typing import Any++import httpx+import structlog++from app.connectors.base import BaseConnector, Capability, ConnectorSchema, Field++logger = structlog.get_logger()++# ---------------------------------------------------------------------------+# Severity mapping+#+# osctrl is a query/event platform — it does not emit "alerts" with vendor+# severity. We synthesise severity from the table queried so the rest of+# the AiSOC pipeline (which assumes events carry severity) has something+# to work with. Operators tune the mapping per environment via the+# detection layer; the defaults here just pick sensible "this is worth+# looking at by default" buckets.+#+# `medium` is the catch-all for "you asked for this query, here's a row" —+# we don't want to drown the SOC in `info` for routine inventory pulls,+# but we also don't want to escalate every row to `high` and burn alert+# budget. Detections in detections/endpoint/ promote interesting rows.+# ---------------------------------------------------------------------------++_OSCTRL_SEVERITY_BY_TABLE: dict[str, str] = {+ # Persistence + execution surfaces — high signal.+ "startup_items": "high",+ "scheduled_tasks": "high",+ "launchd": "high",+ "crontab": "high",+ "kernel_extensions": "high",+ "kernel_modules": "high",+ "browser_extensions": "high",+ # FIM — file_events is the canonical FIM table; severity bumps for+ # writes/deletes happen in detection rules, not here.+ "file_events": "medium",+ # Runtime telemetry — we treat these as `medium` so detections can+ # bubble specific rows up.+ "processes": "medium",+ "process_open_sockets": "medium",+ "listening_ports": "medium",+ "logged_in_users": "medium",+ # Pure inventory — low by default, detections promote.+ "system_info": "info",+ "os_version": "info",+ "uptime": "info",+}+++def _osctrl_severity(table: str | None) -> str:+ if not table:+ return "medium"+ return _OSCTRL_SEVERITY_BY_TABLE.get(table.strip().lower(), "medium")+++class OsctrlConnector(BaseConnector):+ """osctrl — open-source osquery fleet manager."""++ connector_id = "osctrl"+ connector_name = "osctrl"+ connector_category = "edr"++ @classmethod+ def capabilities(cls) -> tuple[Capability, ...]:+ # PR1 declares the read + query verbs. The ad-hoc live-query verb+ # (QUERY_PROCESSES) is the bridge into PR3 — the action client+ # uses the same auth + base URL to issue distributed queries.+ return (+ Capability.PULL_LOGS,+ Capability.QUERY_LOGS,+ Capability.QUERY_PROCESSES,+ Capability.PIVOT_HOST,+ )++ @classmethod+ def schema(cls) -> ConnectorSchema:+ return ConnectorSchema(+ connector_id=cls.connector_id,+ connector_name=cls.connector_name,+ category=cls.connector_category,+ description=("osctrl — open-source osquery fleet manager. Pulls query results and node telemetry from the osctrl admin API."),+ docs_url="/docs/connectors/osctrl",+ fields=[+ Field(+ "base_url",+ "string",+ "osctrl Admin URL",+ placeholder="https://osctrl.example.com",+ help_text=("Base URL of the osctrl admin server (no trailing slash). Use https in production."),+ ),+ Field(+ "api_token",+ "secret",+ "API Token",+ help_text=("Long-lived admin token issued from the osctrl UI under Manage Users -> generate token."),+ ),+ Field(+ "environment",+ "string",+ "Environment Name",+ required=False,+ default="prod",+ help_text=("osctrl environment to scope queries to (e.g. 'prod', 'corp'). Required for distributed queries."),+ ),+ Field(+ "verify_tls",+ "boolean",+ "Verify TLS Certificate",+ required=False,+ default=True,+ ),+ ],+ )++ def __init__(+ self,+ base_url: str,+ api_token: str,+ environment: str = "prod",+ verify_tls: bool = True,+ ):+ # Strip trailing slash so URL composition is predictable. osctrl+ # paths begin with /api/v1; double-slash works but looks alarming+ # in audit logs.+ self._base_url = base_url.rstrip("/")+ self._api_token = api_token+ self._environment = environment or "prod"+ self._verify_tls = bool(verify_tls)++ # ---- helpers ------------------------------------------------------++ def _headers(self) -> dict[str, str]:+ return {+ "Authorization": f"Bearer {self._api_token}",+ "Accept": "application/json",+ "User-Agent": "AiSOC/connectors-osctrl",+ }++ # ---- runtime ------------------------------------------------------++ async def test_connection(self) -> dict[str, Any]:+ try:+ async with httpx.AsyncClient(timeout=15.0, verify=self._verify_tls) as client:+ resp = await client.get(+ f"{self._base_url}/api/v1/nodes",+ headers=self._headers(),+ )+ if resp.status_code == 200:+ return {"success": True, "connector": self.connector_id}+ if resp.status_code in (401, 403):+ return {+ "success": False,+ "connector": self.connector_id,+ "error": "authentication failed; check api_token",+ }+ return {+ "success": False,+ "connector": self.connector_id,+ "error": f"unexpected status {resp.status_code}",+ }+ except httpx.RequestError as exc:+ return {+ "success": False,+ "connector": self.connector_id,+ "error": f"network error: {exc}",+ }++ async def fetch_alerts(self, since_seconds: int = 300) -> list[dict[str, Any]]:+ """Pull recent query results.++ osctrl persists distributed-query results under+ ``/api/v1/queries/<env>/results/<query_id>``. Listing all results+ across all queries in one shot is expensive; instead we ask for+ the most recent N completed queries in this environment and pull+ their result rows.++ ``since_seconds`` is honoured client-side because osctrl's list+ endpoint returns a `created_at` field but does not accept a+ server-side filter.+ """+ results: list[dict[str, Any]] = []+ cutoff_epoch = datetime.now(UTC).timestamp() - max(since_seconds, 0)++ try:+ async with httpx.AsyncClient(timeout=30.0, verify=self._verify_tls) as client:+ queries_resp = await client.get(+ f"{self._base_url}/api/v1/queries/{self._environment}/list",+ headers=self._headers(),+ )+ if queries_resp.status_code != 200:+ logger.warning(+ "osctrl.queries_list_failed",+ status=queries_resp.status_code,+ body=queries_resp.text[:300],+ )+ return []++ queries = queries_resp.json() or []+ if not isinstance(queries, list):+ queries = (queries or {}).get("queries") or []++ for q in queries[:100]:+ created_at = _parse_epoch(q.get("created_at"))+ if created_at is not None and created_at < cutoff_epoch:+ continue++ qname = q.get("name") or q.get("query_name") or q.get("uuid")+ if not qname:+ continue++ results_resp = await client.get(+ f"{self._base_url}/api/v1/queries/{self._environment}/results/{qname}",+ headers=self._headers(),+ )+ if results_resp.status_code != 200:+ continue++ payload = results_resp.json() or {}+ rows = payload.get("results") if isinstance(payload, dict) else payload+ if not isinstance(rows, list):+ continue++ for row in rows:+ results.append(+ self.normalize(+ {+ "query": q,+ "row": row,+ "environment": self._environment,+ }+ )+ )+ except httpx.RequestError as exc:+ logger.warning("osctrl.fetch_exception", error=str(exc))+ return []++ return results++ def normalize(self, raw: dict[str, Any]) -> dict[str, Any]:+ query = raw.get("query") or {}+ row = raw.get("row") or {}+ table_name = query.get("query_table") or _infer_table(query.get("query"))++ hostname = row.get("hostname") or row.get("host_identifier") or row.get("computer_name")+ return {+ "source": self.connector_id,+ "category": "endpoint",+ "severity": _osctrl_severity(table_name),+ "title": (f"osctrl query: {query.get('name') or query.get('uuid') or 'distributed-query'}"),+ "description": (query.get("query") or "")[:400],+ "alert_id": f"{query.get('name') or 'q'}::{row.get('uuid') or row.get('host_identifier') or ''}",+ "hostname": hostname,+ "host": hostname,+ "external_id": query.get("uuid"),+ "osquery_table": table_name,+ "raw_event": row,+ "raw": raw,+ }+++# ---------------------------------------------------------------------------+# Helpers — kept module-private so the connector class stays focused.+# ---------------------------------------------------------------------------+++def _parse_epoch(value: Any) -> float | None:+ """Best-effort conversion of osctrl's `created_at` to epoch seconds."""+ if value is None:+ return None+ if isinstance(value, (int, float)):+ return float(value)+ if isinstance(value, str):+ try:+ return datetime.fromisoformat(value.replace("Z", "+00:00")).timestamp()+ except ValueError:+ return None+ return None+++def _infer_table(query_sql: str | None) -> str | None:+ """Pull the FROM table out of an osquery SQL fragment.++ osctrl exposes the raw SQL of the query, not a parsed table name.+ We use a tiny heuristic — the first identifier after FROM — so we+ can populate ``osquery_table`` for downstream severity routing.+ """+ if not query_sql:+ return None+ lower = query_sql.lower()+ idx = lower.find(" from ")+ if idx < 0:+ return None+ rest = query_sql[idx + len(" from ") :].strip()+ token = rest.split()[0] if rest else ""+ return token.strip(",;()`'\"") or Nonediff --git a/services/connectors/tests/test_osquery_connectors.py b/services/connectors/tests/test_osquery_connectors.pynew file mode 100644index 000000000..97cc15fcb--- /dev/null+++ b/services/connectors/tests/test_osquery_connectors.py@@ -0,0 +1,328 @@+"""+Unit tests for the osctrl + FleetDM osquery-fleet connectors.++These tests follow the same pattern as ``test_saas_connectors.py``:++ 1. Schema sanity — the wizard form has the fields the docs promise and+ the secret-typed fields are masked.+ 2. ``normalize()`` produces the canonical AiSOC alert shape and applies+ the table-driven severity ladder.+ 3. HTTP routing through ``respx`` exercises the real ``httpx`` paths+ and proves we hit the documented osctrl / Fleet endpoints.++We intentionally do not test against a live osctrl or Fleet instance+here — those are integration tests that live with the docker-compose+harness in PR4.+"""++from __future__ import annotations++import httpx+import pytest+import respx+from app.connectors.base import Capability+from app.connectors.fleetdm import FleetDMConnector+from app.connectors.osctrl import OsctrlConnector++OSCTRL_BASE = "https://osctrl.test.local"+OSCTRL_TOKEN = "osctrl-fake-admin-token"+OSCTRL_ENV = "prod"++FLEET_BASE = "https://fleet.test.local"+FLEET_TOKEN = "fleet-fake-token"+++# ===========================================================================+# osctrl+# ===========================================================================+++def test_osctrl_schema_has_required_fields():+ schema = OsctrlConnector.schema()+ names = {f.name for f in schema.fields}+ assert {"base_url", "api_token", "environment", "verify_tls"} <= names+ assert schema.category == "edr"+ token = next(f for f in schema.fields if f.name == "api_token")+ assert token.type == "secret"+++def test_osctrl_capabilities_include_query_and_pivot():+ caps = set(OsctrlConnector.capabilities())+ # PR1 only declares the read + query verbs. The kinetic verbs that+ # PR3 layers on (live-query response action) are not declared here+ # because the action is dispatched via the action client, not the+ # connector itself.+ assert Capability.PULL_LOGS in caps+ assert Capability.QUERY_LOGS in caps+ assert Capability.QUERY_PROCESSES in caps+ assert Capability.PIVOT_HOST in caps+++def test_osctrl_normalize_high_severity_for_persistence_table():+ connector = OsctrlConnector(OSCTRL_BASE, OSCTRL_TOKEN, OSCTRL_ENV)+ raw = {+ "query": {+ "name": "list-startup-items",+ "uuid": "q-1",+ "query": "select * from startup_items where username='root'",+ },+ "row": {+ "uuid": "host-uuid-1",+ "hostname": "macbook-01.corp",+ "name": "evil.app",+ "path": "/Library/StartupItems/evil",+ },+ "environment": OSCTRL_ENV,+ }+ normalized = connector.normalize(raw)+ assert normalized["source"] == "osctrl"+ assert normalized["category"] == "endpoint"+ assert normalized["severity"] == "high"+ assert normalized["hostname"] == "macbook-01.corp"+ assert normalized["host"] == "macbook-01.corp"+ assert normalized["osquery_table"] == "startup_items"+ assert normalized["raw_event"]["path"] == "/Library/StartupItems/evil"+++def test_osctrl_normalize_inventory_table_is_info():+ connector = OsctrlConnector(OSCTRL_BASE, OSCTRL_TOKEN, OSCTRL_ENV)+ raw = {+ "query": {+ "name": "uptime",+ "uuid": "q-2",+ "query": "select * from uptime",+ },+ "row": {"hostname": "linux-edge-01", "days": 12},+ }+ normalized = connector.normalize(raw)+ assert normalized["severity"] == "info"+ assert normalized["osquery_table"] == "uptime"+++def test_osctrl_normalize_unknown_table_defaults_medium():+ connector = OsctrlConnector(OSCTRL_BASE, OSCTRL_TOKEN, OSCTRL_ENV)+ raw = {+ "query": {+ "name": "custom-thing",+ "uuid": "q-3",+ "query": "select * from totally_made_up_table",+ },+ "row": {"hostname": "h1"},+ }+ assert connector.normalize(raw)["severity"] == "medium"++[email protected](assert_all_called=True)+async def test_osctrl_test_connection_ok(respx_mock):+ respx_mock.get(f"{OSCTRL_BASE}/api/v1/nodes").mock(return_value=httpx.Response(200, json={"nodes": []}))+ connector = OsctrlConnector(OSCTRL_BASE, OSCTRL_TOKEN, OSCTRL_ENV)+ result = await connector.test_connection()+ assert result["success"] is True++[email protected](assert_all_called=True)+async def test_osctrl_test_connection_auth_failure(respx_mock):+ respx_mock.get(f"{OSCTRL_BASE}/api/v1/nodes").mock(return_value=httpx.Response(401))+ connector = OsctrlConnector(OSCTRL_BASE, OSCTRL_TOKEN, OSCTRL_ENV)+ result = await connector.test_connection()+ assert result["success"] is False+ assert "auth" in result["error"].lower()++[email protected](assert_all_called=False)+async def test_osctrl_fetch_alerts_pulls_query_results(respx_mock):+ queries_payload = [+ {+ "name": "running-processes",+ "uuid": "q-aa",+ "query": "select pid, name from processes",+ "created_at": "2099-01-01T00:00:00Z", # always within window+ },+ {+ "name": "stale-q",+ "uuid": "q-bb",+ "query": "select * from system_info",+ "created_at": "1970-01-01T00:00:00Z", # ancient — should skip+ },+ ]+ results_payload = {+ "results": [+ {"hostname": "h1", "pid": "100", "name": "ssh"},+ {"hostname": "h2", "pid": "200", "name": "bash"},+ ]+ }++ respx_mock.get(f"{OSCTRL_BASE}/api/v1/queries/{OSCTRL_ENV}/list").mock(return_value=httpx.Response(200, json=queries_payload))+ respx_mock.get(f"{OSCTRL_BASE}/api/v1/queries/{OSCTRL_ENV}/results/running-processes").mock(+ return_value=httpx.Response(200, json=results_payload)+ )++ connector = OsctrlConnector(OSCTRL_BASE, OSCTRL_TOKEN, OSCTRL_ENV)+ events = await connector.fetch_alerts(since_seconds=300)+ assert len(events) == 2+ assert {e["hostname"] for e in events} == {"h1", "h2"}+ # All rows must inherit the query's source + table+ assert all(e["osquery_table"] == "processes" for e in events)+ assert all(e["source"] == "osctrl" for e in events)+++# ===========================================================================+# FleetDM+# ===========================================================================+++def test_fleetdm_schema_has_required_fields():+ schema = FleetDMConnector.schema()+ names = {f.name for f in schema.fields}+ assert {"base_url", "api_token", "team_id", "verify_tls"} <= names+ assert schema.category == "edr"+ token = next(f for f in schema.fields if f.name == "api_token")+ assert token.type == "secret"+++def test_fleetdm_capabilities_match_osctrl():+ caps = set(FleetDMConnector.capabilities())+ assert Capability.PULL_LOGS in caps+ assert Capability.QUERY_LOGS in caps+ assert Capability.QUERY_PROCESSES in caps+ assert Capability.PIVOT_HOST in caps+++def test_fleetdm_normalize_host_status_missing_is_medium():+ connector = FleetDMConnector(FLEET_BASE, FLEET_TOKEN)+ raw = {+ "kind": "host",+ "host": {+ "id": 17,+ "hostname": "ws-finance-04",+ "platform": "darwin",+ "os_version": "macOS 14.5",+ "status": "missing",+ },+ }+ norm = connector.normalize(raw)+ assert norm["source"] == "fleetdm"+ assert norm["severity"] == "medium"+ assert norm["hostname"] == "ws-finance-04"+ assert norm["external_id"] == "17"+ assert "missing" in norm["title"].lower()+++def test_fleetdm_normalize_host_status_online_is_info():+ connector = FleetDMConnector(FLEET_BASE, FLEET_TOKEN)+ raw = {+ "kind": "host",+ "host": {"id": 1, "hostname": "h1", "status": "online"},+ }+ assert connector.normalize(raw)["severity"] == "info"+++def test_fleetdm_normalize_query_row_uses_table_severity():+ connector = FleetDMConnector(FLEET_BASE, FLEET_TOKEN)+ raw = {+ "kind": "query_row",+ "query": {+ "id": 5,+ "name": "scheduled-tasks",+ "query": "select * from scheduled_tasks where state='Ready'",+ },+ "row": {+ "host_id": 22,+ "host_hostname": "win-jumphost",+ "name": "evil-task",+ },+ }+ norm = connector.normalize(raw)+ assert norm["severity"] == "high"+ assert norm["osquery_table"] == "scheduled_tasks"+ assert norm["hostname"] == "win-jumphost"++[email protected](assert_all_called=True)+async def test_fleetdm_test_connection_ok(respx_mock):+ respx_mock.get(f"{FLEET_BASE}/api/v1/fleet/me").mock(return_value=httpx.Response(200, json={"user": {"id": 1}}))+ connector = FleetDMConnector(FLEET_BASE, FLEET_TOKEN)+ res = await connector.test_connection()+ assert res["success"] is True++[email protected](assert_all_called=True)+async def test_fleetdm_test_connection_unauthorised(respx_mock):+ respx_mock.get(f"{FLEET_BASE}/api/v1/fleet/me").mock(return_value=httpx.Response(403))+ connector = FleetDMConnector(FLEET_BASE, FLEET_TOKEN)+ res = await connector.test_connection()+ assert res["success"] is False++[email protected](assert_all_called=False)+async def test_fleetdm_fetch_alerts_returns_hosts_and_query_rows(respx_mock):+ respx_mock.get(f"{FLEET_BASE}/api/v1/fleet/hosts").mock(+ return_value=httpx.Response(+ 200,+ json={+ "hosts": [+ {+ "id": 7,+ "hostname": "ws-finance-04",+ "platform": "darwin",+ "os_version": "macOS 14.5",+ "status": "missing",+ }+ ]+ },+ )+ )+ respx_mock.get(f"{FLEET_BASE}/api/v1/fleet/queries").mock(+ return_value=httpx.Response(+ 200,+ json={+ "queries": [+ {+ "id": 3,+ "name": "running-procs",+ "query": "select pid, name from processes",+ }+ ]+ },+ )+ )+ respx_mock.get(f"{FLEET_BASE}/api/v1/fleet/queries/3/report").mock(+ return_value=httpx.Response(+ 200,+ json={+ "results": [+ {+ "host_id": 7,+ "host_hostname": "ws-finance-04",+ "pid": "1234",+ "name": "suspicious",+ }+ ]+ },+ )+ )++ connector = FleetDMConnector(FLEET_BASE, FLEET_TOKEN)+ events = await connector.fetch_alerts(since_seconds=999_999_999)+ # one host event + one query-row event+ assert len(events) == 2+ kinds = {e["raw"].get("kind") for e in events}+ assert kinds == {"host", "query_row"}+++# ===========================================================================+# Registry sanity+# ===========================================================================+++def test_both_connectors_register_under_expected_ids():+ from app.connectors import CONNECTOR_REGISTRY++ assert CONNECTOR_REGISTRY["osctrl"] is OsctrlConnector+ assert CONNECTOR_REGISTRY["fleetdm"] is FleetDMConnector