|
| 1 | +fromversion: 6.10.0 |
| 2 | +action: ALERTS |
| 3 | +alert_category: OTHER |
| 4 | +alert_description: $alert_description |
| 5 | +alert_domain: DOMAIN_SECURITY |
| 6 | +alert_fields: |
| 7 | + action_file_path: filepath |
| 8 | + action_file_sha256: sha256 |
| 9 | + action_local_ip: local_ip |
| 10 | + action_remote_ip: remote_ip_str |
| 11 | + actor_effective_username: user_name |
| 12 | + actor_process_command_line: cmdline |
| 13 | + actor_process_image_name: filename |
| 14 | + actor_process_image_path: filepath |
| 15 | + actor_process_image_sha256: sha256 |
| 16 | + additionalindicators: ioc_value |
| 17 | + agent_device_domain: domain |
| 18 | + agent_hostname: v1_host_name |
| 19 | + agent_id: v1_host_guid |
| 20 | + alert_description: alert_description |
| 21 | + external_pivot_url: workbench_link |
| 22 | + externallink: workbench_link |
| 23 | + externalstatus: status |
| 24 | + filehash: sha256 |
| 25 | + mac: mac_address |
| 26 | + mitretechniqueid: mitre_ids_str |
| 27 | + originalalertid: id |
| 28 | + originalalertname: alert_name |
| 29 | + originalalertsource: alert_source |
| 30 | + parentprocessname: parent_process_name |
| 31 | + parentprocesspath: parent_process_path |
| 32 | + prenatsourceip: local_ip |
| 33 | + processcmd: cmdline |
| 34 | + severity: severity |
| 35 | + source_insert_ts: alert_time |
| 36 | + tim_main_indicator: ioc_value |
| 37 | + trendmicrovisiononexdrinvestigationstatus: investigation_status |
| 38 | + trendmicrovisiononexdrpriorityscore: score |
| 39 | + userid: user_id |
| 40 | +alert_name: Trend Micro - $alert_name |
| 41 | +alert_type: null |
| 42 | +crontab: null |
| 43 | +dataset: alerts |
| 44 | +description: null |
| 45 | +drilldown_query_timeframe: ALERT |
| 46 | +execution_mode: REAL_TIME |
| 47 | +global_rule_id: SOC Trend Micro Vision One V3 |
| 48 | +investigation_query_link: '' |
| 49 | +is_enabled: true |
| 50 | +lookup_mapping: [] |
| 51 | +mapping_strategy: CUSTOM |
| 52 | +mitre_defs: {} |
| 53 | +name: SOC Trend Micro Vision One V3 |
| 54 | +rule_id: 0 |
| 55 | +search_window: null |
| 56 | +severity: User Defined |
| 57 | +simple_schedule: null |
| 58 | +suppression_duration: null |
| 59 | +suppression_enabled: false |
| 60 | +suppression_fields: null |
| 61 | +timezone: null |
| 62 | +user_defined_category: null |
| 63 | +user_defined_severity: severity |
| 64 | +xql_query: "dataset = trend_micro_vision_one_v3_generic_alert_raw\n| filter alert_provider\ |
| 65 | + \ = \"SAE\"\n\n| alter j = _alert_data -> raw_json\n\n/* --- MITRE technique (cheap)\ |
| 66 | + \ --- */\n| alter j_str = to_string(j)\n| alter mitre_technique_id_raw =\n json_extract_scalar(j_str,\ |
| 67 | + \ \"$.matched_rules[0].matched_filters[0].mitre_technique_ids[0]\")\n| alter j_str\ |
| 68 | + \ = null\n\n| alter mitre_ids_str =\n if(\n mitre_technique_id_raw != null\ |
| 69 | + \ and mitre_technique_id_raw != \"\",\n replace(replace(mitre_technique_id_raw,\ |
| 70 | + \ \"\\\"\",\"\"), \"\\\\.[0-9]+$\",\"\"),\n \"\u2014\"\n )\n| alter mitre_ids_str\ |
| 71 | + \ =\n if(mitre_ids_str contains \".\", arrayindex(regextract(mitre_ids_str, \"\ |
| 72 | + (.*)\\.\"), 0), mitre_ids_str)\n\n/* --- MITRE Tactics Arrays ---- */\n| alter ta0043_reconnaissance\ |
| 73 | + \ = arraycreate(\"T1590\",\"T1591\",\"T1592\",\"T1593\",\"T1594\",\"T1595\"\ |
| 74 | + ,\"T1596\",\"T1597\",\"T1598\",\"T1599\")\n| alter ta0042_resource_development =\ |
| 75 | + \ arraycreate(\"T1583\",\"T1584\",\"T1585\",\"T1586\",\"T1587\",\"T1650\")\n| alter\ |
| 76 | + \ ta0001_initial_access = arraycreate(\"T1078\",\"T1189\",\"T1190\",\"T1195\"\ |
| 77 | + ,\"T1133\",\"T1200\",\"T1566\",\"T1091\")\n| alter ta0002_execution =\ |
| 78 | + \ arraycreate(\"T1059\",\"T1106\",\"T1047\",\"T1203\",\"T1129\",\"T1559\")\n| alter\ |
| 79 | + \ ta0003_persistence = arraycreate(\"T1547\",\"T1543\",\"T1136\",\"T1505\"\ |
| 80 | + ,\"T1053\",\"T1078\")\n| alter ta0004_privilege_escalation = arraycreate(\"T1548\"\ |
| 81 | + ,\"T1068\",\"T1078\",\"T1055\",\"T1134\")\n| alter ta0005_defense_evasion =\ |
| 82 | + \ arraycreate(\"T1027\",\"T1070\",\"T1218\",\"T1140\",\"T1562\",\"T1036\",\"T1055\"\ |
| 83 | + )\n| alter ta0006_credential_access = arraycreate(\"T1003\",\"T1555\",\"T1552\"\ |
| 84 | + ,\"T1110\",\"T1621\")\n| alter ta0007_discovery = arraycreate(\"T1082\"\ |
| 85 | + ,\"T1083\",\"T1046\",\"T1057\",\"T1016\",\"T1049\",\"T1033\")\n| alter ta0008_lateral_movement\ |
| 86 | + \ = arraycreate(\"T1021\",\"T1210\",\"T1091\",\"T1072\")\n| alter ta0009_collection\ |
| 87 | + \ = arraycreate(\"T1005\",\"T1039\",\"T1113\",\"T1114\",\"T1115\")\n|\ |
| 88 | + \ alter ta0011_command_and_control = arraycreate(\"T1071\",\"T1095\",\"T1105\"\ |
| 89 | + ,\"T1571\",\"T1572\",\"T1041\")\n| alter ta0010_exfiltration = arraycreate(\"\ |
| 90 | + T1041\",\"T1567\",\"T1020\")\n| alter ta0040_impact = arraycreate(\"\ |
| 91 | + T1485\",\"T1486\",\"T1490\",\"T1499\",\"T1561\")\n\n/* --- Match Tactic Name + ID\ |
| 92 | + \ --- */\n| alter mitre_tactic = if (ta0040_impact contains mitre_ids_str, \"Impact\"\ |
| 93 | + )\n| alter mitre_tactic = if (ta0010_exfiltration contains mitre_ids_str, \"Exfiltration\"\ |
| 94 | + , mitre_tactic)\n| alter mitre_tactic = if (ta0011_command_and_control contains\ |
| 95 | + \ mitre_ids_str, \"Command and Control\", mitre_tactic)\n| alter mitre_tactic =\ |
| 96 | + \ if (ta0009_collection contains mitre_ids_str, \"Collection\", mitre_tactic)\n\ |
| 97 | + | alter mitre_tactic = if (ta0008_lateral_movement contains mitre_ids_str, \"Lateral\ |
| 98 | + \ Movement\", mitre_tactic)\n| alter mitre_tactic = if (ta0007_discovery contains\ |
| 99 | + \ mitre_ids_str, \"Discovery\", mitre_tactic)\n| alter mitre_tactic = if (ta0006_credential_access\ |
| 100 | + \ contains mitre_ids_str, \"Credential Access\", mitre_tactic)\n| alter mitre_tactic\ |
| 101 | + \ = if (ta0005_defense_evasion contains mitre_ids_str, \"Defense Evasion\", mitre_tactic)\n\ |
| 102 | + | alter mitre_tactic = if (ta0004_privilege_escalation contains mitre_ids_str, \"\ |
| 103 | + Privilege Escalation\", mitre_tactic)\n| alter mitre_tactic = if (ta0003_persistence\ |
| 104 | + \ contains mitre_ids_str, \"Persistence\", mitre_tactic)\n| alter mitre_tactic =\ |
| 105 | + \ if (ta0002_execution contains mitre_ids_str, \"Execution\", mitre_tactic)\n| alter\ |
| 106 | + \ mitre_tactic = if (ta0001_initial_access contains mitre_ids_str, \"Initial Access\"\ |
| 107 | + , mitre_tactic)\n| alter mitre_tactic = if (ta0042_resource_development contains\ |
| 108 | + \ mitre_ids_str, \"Resource Development\", mitre_tactic)\n| alter mitre_tactic =\ |
| 109 | + \ if (ta0043_reconnaissance contains mitre_ids_str, \"Reconnaissance\", mitre_tactic)\n\ |
| 110 | + \n| alter mitre_tactic_id = if (ta0040_impact contains mitre_ids_str, \"TA0040\"\ |
| 111 | + )\n| alter mitre_tactic_id = if (ta0010_exfiltration contains mitre_ids_str, \"\ |
| 112 | + TA0010\", mitre_tactic_id)\n| alter mitre_tactic_id = if (ta0011_command_and_control\ |
| 113 | + \ contains mitre_ids_str, \"TA0011\", mitre_tactic_id)\n| alter mitre_tactic_id\ |
| 114 | + \ = if (ta0009_collection contains mitre_ids_str, \"TA0009\", mitre_tactic_id)\n\ |
| 115 | + | alter mitre_tactic_id = if (ta0008_lateral_movement contains mitre_ids_str, \"\ |
| 116 | + TA0008\", mitre_tactic_id)\n| alter mitre_tactic_id = if (ta0007_discovery contains\ |
| 117 | + \ mitre_ids_str, \"TA0007\", mitre_tactic_id)\n| alter mitre_tactic_id = if (ta0006_credential_access\ |
| 118 | + \ contains mitre_ids_str, \"TA0006\", mitre_tactic_id)\n| alter mitre_tactic_id\ |
| 119 | + \ = if (ta0005_defense_evasion contains mitre_ids_str, \"TA0005\", mitre_tactic_id)\n\ |
| 120 | + | alter mitre_tactic_id = if (ta0004_privilege_escalation contains mitre_ids_str,\ |
| 121 | + \ \"TA0004\", mitre_tactic_id)\n| alter mitre_tactic_id = if (ta0003_persistence\ |
| 122 | + \ contains mitre_ids_str, \"TA0003\", mitre_tactic_id)\n| alter mitre_tactic_id\ |
| 123 | + \ = if (ta0002_execution contains mitre_ids_str, \"TA0002\", mitre_tactic_id)\n\ |
| 124 | + | alter mitre_tactic_id = if (ta0001_initial_access contains mitre_ids_str, \"TA0001\"\ |
| 125 | + , mitre_tactic_id)\n| alter mitre_tactic_id = if (ta0042_resource_development contains\ |
| 126 | + \ mitre_ids_str, \"TA0042\", mitre_tactic_id)\n| alter mitre_tactic_id = if (ta0043_reconnaissance\ |
| 127 | + \ contains mitre_ids_str, \"TA0043\", mitre_tactic_id)\n\n/* ---- Split Anchor (required)\ |
| 128 | + \ ---- */\n| alter\n mitre_technique_id = mitre_ids_str,\n mitre_technique\ |
| 129 | + \ = null,\n mitre_tactic_id = mitre_tactic_id,\n mitre_tactic \ |
| 130 | + \ = mitre_tactic\n\n/* ---- Core metadata (keep legacy field names you mapped) ----\ |
| 131 | + \ */\n| alter\n id = j -> id,\n status = j\ |
| 132 | + \ -> status,\n investigation_status = j -> investigation_status,\n investigation_result\ |
| 133 | + \ = j -> investigation_result,\n workbench_link = j -> workbench_link,\n\ |
| 134 | + \ alert_provider = j -> alert_provider,\n alert_name = j ->\ |
| 135 | + \ model,\n score = to_integer(j -> score),\n severity \ |
| 136 | + \ = j -> severity,\n alert_time = j -> created_date_time,\n\ |
| 137 | + \ alert_description = j -> description,\n alert_source = coalesce(j\ |
| 138 | + \ -> alert_provider, \"Trend Micro Vision One\"),\n indicators = j\ |
| 139 | + \ -> indicators[]\n\n/* ---- FAST indicator extraction (no arraymap/indexof) ----\ |
| 140 | + \ */\n/* host */\n| alter i_host = arrayindex(arrayfilter(indicators, json_extract_scalar(\"\ |
| 141 | + @element\",\"$.type\") = \"host\"), 0)\n| alter\n v1_host_guid = json_extract_scalar(i_host,\ |
| 142 | + \ \"$.value.guid\"),\n v1_host_name = json_extract_scalar(i_host, \"$.value.name\"\ |
| 143 | + ),\n local_ip = replace(json_extract_scalar(i_host, \"$.value.ips[0]\"),\ |
| 144 | + \ \"\\\"\", \"\")\n\n/* mac (host indicator value has multiple possibilities in\ |
| 145 | + \ some feeds; keep best-effort) */\n| alter mac_address =\n coalesce(\n \ |
| 146 | + \ json_extract_scalar(i_host, \"$.value.mac\"),\n json_extract_scalar(i_host,\ |
| 147 | + \ \"$.value.mac_address\"),\n json_extract_scalar(i_host, \"$.value.macs[0]\"\ |
| 148 | + ),\n json_extract_scalar(i_host, \"$.value.macAddresses[0]\")\n )\n\n/*\ |
| 149 | + \ user */\n| alter i_user = arrayindex(arrayfilter(indicators, json_extract_scalar(\"\ |
| 150 | + @element\",\"$.type\") = \"user_account\"), 0)\n| alter\n user_name = json_extract_scalar(i_user,\ |
| 151 | + \ \"$.value\"),\n user_id = null\n\n/* cmdline */\n| alter i_cmd1 = arrayindex(arrayfilter(indicators,\ |
| 152 | + \ json_extract_scalar(\"@element\",\"$.type\") = \"command_line\"), 0)\n| alter\ |
| 153 | + \ i_cmd2 = arrayindex(arrayfilter(indicators, json_extract_scalar(\"@element\",\"\ |
| 154 | + $.field\") = \"processCmd\"), 0)\n| alter cmdline = coalesce(json_extract_scalar(i_cmd1,\ |
| 155 | + \ \"$.value\"), json_extract_scalar(i_cmd2, \"$.value\"))\n\n/* sha256 (main) */\n\ |
| 156 | + | alter i_sha = arrayindex(arrayfilter(indicators, json_extract_scalar(\"@element\"\ |
| 157 | + ,\"$.type\") = \"file_sha256\"), 0)\n| alter sha256 = json_extract_scalar(i_sha,\ |
| 158 | + \ \"$.value\")\n\n/* remote ip + domain */\n| alter i_peer = arrayindex(arrayfilter(indicators,\ |
| 159 | + \ json_extract_scalar(\"@element\",\"$.field\") = \"peerIp\"), 0)\n| alter remote_ip_str\ |
| 160 | + \ = json_extract_scalar(i_peer, \"$.value\")\n\n| alter i_dom = arrayindex(arrayfilter(indicators,\ |
| 161 | + \ json_extract_scalar(\"@element\",\"$.field\") = \"domain\"), 0)\n| alter domain\ |
| 162 | + \ = json_extract_scalar(i_dom, \"$.value\")\n\n/* parent process path */\n| alter\ |
| 163 | + \ i_pfp = arrayindex(arrayfilter(indicators, json_extract_scalar(\"@element\",\"\ |
| 164 | + $.field\") = \"parentFilePath\"), 0)\n| alter parent_process_path = json_extract_scalar(i_pfp,\ |
| 165 | + \ \"$.value\")\n| alter parent_process_name = replace(parent_process_path, \"^.*[\\\ |
| 166 | + \\\\\\/]\", \"\")\n\n/* filepath / filename (from registry object or cmdline fallback)\ |
| 167 | + \ */\n| alter i_reg = arrayindex(arrayfilter(indicators, json_extract_scalar(\"\ |
| 168 | + @element\",\"$.field\") = \"objectRegistryData\"), 0)\n| alter reg_path = json_extract_scalar(i_reg,\ |
| 169 | + \ \"$.value\")\n\n| alter filepath =\n coalesce(\n reg_path,\n arrayindex(regextract(cmdline,\ |
| 170 | + \ \"^\\\\s*([^\\\\s]+)\"), 0)\n )\n| alter filename = replace(filepath, \"^.*[\\\ |
| 171 | + \\\\\\/]\", \"\")\n\n/* convenience */\n| alter ioc_value = coalesce(sha256, null)\n\ |
| 172 | + \n| fields\n id, workbench_link, alert_name, alert_source, status,\n investigation_status,\ |
| 173 | + \ investigation_result,\n score, severity, alert_time, alert_description,\n \ |
| 174 | + \ v1_host_guid, v1_host_name, local_ip, mac_address,\n user_name, user_id,\n\ |
| 175 | + \ filename, filepath, parent_process_path, parent_process_name, cmdline,\n \ |
| 176 | + \ sha256, ioc_value, domain, remote_ip_str,\n mitre_technique, mitre_technique_id,\ |
| 177 | + \ mitre_tactic, mitre_tactic_id, mitre_ids_str\n" |
0 commit comments