Skip to content

Vaikora-AzureSecurityCenter v3.0.2 — align playbook + rules with Vaikora /actions API schema#14367

Closed
mazamizo21 wants to merge 2 commits into
Azure:masterfrom
Data443:feature/vaikora-asc-v3.0.2-schema-fix
Closed

Vaikora-AzureSecurityCenter v3.0.2 — align playbook + rules with Vaikora /actions API schema#14367
mazamizo21 wants to merge 2 commits into
Azure:masterfrom
Data443:feature/vaikora-asc-v3.0.2-schema-fix

Conversation

@mazamizo21
Copy link
Copy Markdown
Contributor

Summary

This PR is the schema-alignment follow-up flagged in #14366. It depends on #14366 (v3.0.1) merging first or being folded in.

The 3.0.0 solution shipped against an assumed alert-shaped API response. The Vaikora `/api/v1/actions` endpoint actually returns action-shaped events. Concrete symptoms from end-to-end testing on a real Sentinel workspace:

  • `Send_to_Log_Analytics` crashed with `InvalidTemplate` because `replace()` ran against null `title` / `description` fields that do not exist on the response.
  • `Filter_High_Risk_Actions` referenced `threat_detected`, also missing from the response.
  • The three analytic rules queried `Vaikora_SecurityAlerts_CL` with columns (`AlertId_s`, `Title_s`, `Description_s`, `SourceIP_s`, `UserName_s`, etc.) that the playbook never wrote.
  • The standalone playbook wrote to `Vaikora_SecurityAlerts`; the inner mainTemplate playbook wrote to `Vaikora_AgentSignals`. Same solution, two divergent target tables, so rules failed to match in both install paths.

Fix

Align everything on the action-field schema and the `Vaikora_AgentSignals_CL` table:

  • Standalone playbook
    • `Send_to_Log_Analytics` body rewritten to action fields with `coalesce()` guards on nullable booleans/numbers. `Log-Type` set to `Vaikora_AgentSignals`.
    • `Parse_Response` schema declares the real response shape (`actions` array, `total`/`page`/`per_page`).
    • `Filter_High_Risk_Actions` drops the `threat_detected` check.
  • mainTemplate inner playbook
    • Filter mirrors the standalone fix (drops `threat_detected`).
  • Analytic rules (YAML + inner mainTemplate)
    • `Vaikora - High severity AI agent action` (was "High severity security alerts") — queries `Vaikora_AgentSignals_CL` with `severity_s in ("high", "critical")` and the action-field column set.
    • `Vaikora - Behavioral anomaly detected` (was "Anomaly detection") — filters on `is_anomaly_b == true` and orders by `AnomalyScore`.
    • `Vaikora - Feed outage detection` — table-name update and tightened description.
    • `entityMappings` reduced to mapping `AgentId` (from `agent_id_s`) to `Account.Name`. The action response has no IP/Host/Process fields; mapping them was misleading.
    • `alertDetailsOverride` placeholders updated and kept at or below the 3-placeholder cap.
  • Solution description updated to reference `Vaikora_AgentSignals_CL`.

Files changed

  • `Solutions/Vaikora-AzureSecurityCenter/Playbooks/VaikoraToAzureSecurityCenter/azuredeploy.json`
  • `Solutions/Vaikora-AzureSecurityCenter/Package/mainTemplate.json`
  • `Solutions/Vaikora-AzureSecurityCenter/Package/3.0.2.zip` (3.0.0.zip and 3.0.1.zip retained)
  • `Solutions/Vaikora-AzureSecurityCenter/Analytic Rules/Vaikora - High Severity Security Alerts.yaml`
  • `Solutions/Vaikora-AzureSecurityCenter/Analytic Rules/Vaikora - Anomaly Detection.yaml`
  • `Solutions/Vaikora-AzureSecurityCenter/Analytic Rules/Vaikora - Feed Outage Detection.yaml`
  • `Solutions/Vaikora-AzureSecurityCenter/Data/Solution_VaikoraSecurityCenter.json` — Version 3.0.2 + description
  • `Solutions/Vaikora-AzureSecurityCenter/ReleaseNotes.md` — v3.0.2 entry

Test plan

cc @v-maheshbh @v-shukore

mazamizo21 added 2 commits May 28, 2026 12:33
…ikoraAgentId is empty

Poll_Vaikora_Actions used a queries object that always sent agent_id, even when VaikoraAgentId was empty. The resulting URL was /actions?agent_id=&per_page=100, which the Vaikora API rejects with HTTP 422 (Pydantic cannot parse '' as a UUID).

Fix switches the action from a queries object to URI concatenation with an if(empty(...)) guard so the agent_id segment is omitted entirely when blank.

Verified end-to-end against api.vaikora.com on a real Sentinel workspace: Poll_Vaikora_Actions now returns 200 OK with URL https://api.vaikora.com/api/v1/actions?per_page=100.

arm-ttk local: 49/49 pass on Package/3.0.1.zip. 3.0.0.zip retained per repo policy.

Known follow-up flagged in PR description: a separate schema mismatch (Send_to_Log_Analytics in standalone playbook builds an alert-shaped JSON body that the Vaikora API does not return; analytic rules query a different table name than the playbook writes to). That deserves its own v3.0.2 PR after this URI fix lands.
…ra /actions API schema

The 3.0.1 PR fixed the agent_id query param. End-to-end testing surfaced a deeper schema mismatch: the standalone playbook assumed an alert-shaped response (title, description, source_ip, destination_ip, source_host, destination_host, process_name, user_name, file_path, threat_detected, confidence_score, created_at, updated_at) while the Vaikora /api/v1/actions endpoint returns action-shaped events (action_type, agent_id, severity, policy_decision, is_anomaly, anomaly_score, anomaly_reason, log_hash, timestamp).

Concrete symptoms in 3.0.1:
- Send_to_Log_Analytics crashed with InvalidTemplate because replace() ran against null fields.
- Filter_High_Risk_Actions referenced threat_detected which does not exist on the response.
- Three analytic rules queried Vaikora_SecurityAlerts_CL with column names (AlertId_s, Title_s, etc.) that the playbook never wrote.
- Standalone playbook wrote to Vaikora_SecurityAlerts; mainTemplate inner playbook wrote to Vaikora_AgentSignals. Same solution shipped two divergent target tables.

This PR aligns everything on the action-field schema and the Vaikora_AgentSignals_CL table:
- Standalone playbook Send_to_Log_Analytics body rewritten to action fields with coalesce guards on nullable booleans/numbers; Log-Type set to Vaikora_AgentSignals.
- Standalone Parse_Response schema updated to declare the real response shape.
- Standalone Filter_High_Risk_Actions drops the threat_detected check.
- mainTemplate inner playbook Filter mirrors the same fix.
- All three analytic rules (Vaikora - High severity AI agent action, Vaikora - Behavioral anomaly detected, Vaikora - Feed outage detection) rewritten to query Vaikora_AgentSignals_CL with action-field columns. entityMappings reduced to mapping agent_id to Account.Name. alertDetailsOverride placeholders updated and kept under the 3-placeholder cap.
- Solution description updated to reference Vaikora_AgentSignals_CL.

arm-ttk local: 49/49 pass on Package/3.0.2.zip. 3.0.0.zip and 3.0.1.zip retained per repo policy.

Pairs with PR Azure#14366 (v3.0.1 agent_id fix); v3.0.2 depends on v3.0.1 merging first or being folded in.
@mazamizo21 mazamizo21 requested review from a team as code owners May 28, 2026 16:53
@mazamizo21
Copy link
Copy Markdown
Contributor Author

Closing in favor of folding the schema-alignment changes into #14366 (the v3.0.1 PR) so this solution ships a single consolidated v3.0.1 instead of two version bumps under review at the same time. I'll force-push the consolidated v3.0.1 branch shortly and update the #14366 description. Sorry for the noise.

@mazamizo21 mazamizo21 closed this May 28, 2026
@v-atulyadav v-atulyadav added the Solution Solution specialty review needed label May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Solution Solution specialty review needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants