nldcsc-elastic-rules 0.0.8__py3-none-any.whl → 0.0.16__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. nldcsc_elastic_rules/__init__.py +1 -1
  2. nldcsc_elastic_rules/rules/{linux → cross-platform}/command_and_control_curl_wget_spawn_via_nodejs_parent.toml +32 -11
  3. nldcsc_elastic_rules/rules/cross-platform/command_and_control_genai_process_suspicious_tld_connection.toml +134 -0
  4. nldcsc_elastic_rules/rules/cross-platform/command_and_control_genai_process_unusual_domain.toml +128 -0
  5. nldcsc_elastic_rules/rules/cross-platform/credential_access_genai_process_sensitive_file_access.toml +154 -0
  6. nldcsc_elastic_rules/rules/cross-platform/credential_access_gitleaks_execution.toml +114 -0
  7. nldcsc_elastic_rules/rules/cross-platform/credential_access_multi_could_secrets_via_api.toml +198 -0
  8. nldcsc_elastic_rules/rules/cross-platform/credential_access_trufflehog_execution.toml +24 -5
  9. nldcsc_elastic_rules/rules/cross-platform/defense_evasion_genai_config_modification.toml +120 -0
  10. nldcsc_elastic_rules/rules/cross-platform/defense_evasion_genai_process_compiling_executables.toml +158 -0
  11. nldcsc_elastic_rules/rules/cross-platform/defense_evasion_genai_process_encoding_prior_to_network_activity.toml +172 -0
  12. nldcsc_elastic_rules/rules/cross-platform/defense_evasion_potential_http_downgrade_attack.toml +98 -0
  13. nldcsc_elastic_rules/rules/cross-platform/discovery_web_server_local_file_inclusion_activity.toml +172 -0
  14. nldcsc_elastic_rules/rules/cross-platform/discovery_web_server_remote_file_inclusion_activity.toml +133 -0
  15. nldcsc_elastic_rules/rules/cross-platform/execution_aws_ec2_lolbin_via_ssm.toml +250 -0
  16. nldcsc_elastic_rules/rules/{linux/persistence_nodejs_pre_or_post_install_script_execution.toml → cross-platform/execution_nodejs_pre_or_post_install_script_execution.toml} +40 -24
  17. nldcsc_elastic_rules/rules/cross-platform/execution_privileged_container_creation_with_host_reference.toml +146 -0
  18. nldcsc_elastic_rules/rules/cross-platform/execution_register_github_actions_runner.toml +126 -0
  19. nldcsc_elastic_rules/rules/cross-platform/execution_via_github_actions_runner.toml +130 -0
  20. nldcsc_elastic_rules/rules/cross-platform/execution_via_github_runner_with_runner_tracking_id_tampering_via_env_vars.toml +163 -0
  21. nldcsc_elastic_rules/rules/cross-platform/initial_access_execution_susp_react_serv_child.toml +130 -0
  22. nldcsc_elastic_rules/rules/cross-platform/initial_access_file_upload_followed_by_get_request.toml +145 -0
  23. nldcsc_elastic_rules/rules/cross-platform/multiple_alerts_elastic_defend_netsecurity_by_host.toml +4 -1
  24. nldcsc_elastic_rules/rules/cross-platform/persistence_credential_access_modify_auth_module_or_config.toml +3 -4
  25. nldcsc_elastic_rules/rules/cross-platform/persistence_web_server_potential_command_injection.toml +23 -25
  26. nldcsc_elastic_rules/rules/cross-platform/reconnaissance_web_server_discovery_or_fuzzing_activity.toml +13 -14
  27. nldcsc_elastic_rules/rules/cross-platform/reconnaissance_web_server_unusual_spike_in_error_logs.toml +8 -5
  28. nldcsc_elastic_rules/rules/cross-platform/reconnaissance_web_server_unusual_spike_in_error_response_codes.toml +12 -12
  29. nldcsc_elastic_rules/rules/cross-platform/reconnaissance_web_server_unusual_user_agents.toml +37 -43
  30. nldcsc_elastic_rules/rules/integrations/aws/defense_evasion_rds_instance_restored.toml +137 -45
  31. nldcsc_elastic_rules/rules/integrations/aws/discovery_iam_principal_enumeration_via_update_assume_role_policy.toml +152 -0
  32. nldcsc_elastic_rules/rules/integrations/aws/discovery_multiple_discovery_api_calls_via_cli.toml +242 -0
  33. nldcsc_elastic_rules/rules/integrations/aws/exfiltration_rds_snapshot_export.toml +141 -33
  34. nldcsc_elastic_rules/rules/integrations/aws/exfiltration_rds_snapshot_shared_with_another_account.toml +108 -30
  35. nldcsc_elastic_rules/rules/integrations/aws/exfiltration_s3_bucket_policy_added_for_external_account_access.toml +2 -1
  36. nldcsc_elastic_rules/rules/integrations/aws/exfiltration_s3_bucket_replicated_to_external_account.toml +114 -27
  37. nldcsc_elastic_rules/rules/integrations/aws/impact_efs_filesystem_deleted.toml +174 -0
  38. nldcsc_elastic_rules/rules/integrations/aws/impact_kms_cmk_disabled_or_scheduled_for_deletion.toml +111 -33
  39. nldcsc_elastic_rules/rules/integrations/aws/impact_rds_instance_cluster_deletion.toml +129 -43
  40. nldcsc_elastic_rules/rules/integrations/aws/impact_rds_instance_cluster_deletion_protection_disabled.toml +89 -27
  41. nldcsc_elastic_rules/rules/integrations/aws/impact_rds_snapshot_deleted.toml +127 -37
  42. nldcsc_elastic_rules/rules/integrations/aws/impact_s3_object_encryption_with_external_key.toml +160 -43
  43. nldcsc_elastic_rules/rules/integrations/aws/initial_access_iam_session_token_used_from_multiple_addresses.toml +20 -10
  44. nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_error_message_spike.toml +35 -1
  45. nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_rare_error_code.toml +59 -1
  46. nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_rare_method_by_city.toml +19 -1
  47. nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_rare_method_by_country.toml +19 -1
  48. nldcsc_elastic_rules/rules/integrations/aws/ml_cloudtrail_rare_method_by_user.toml +58 -1
  49. nldcsc_elastic_rules/rules/integrations/aws/persistence_rds_db_instance_password_modified.toml +109 -35
  50. nldcsc_elastic_rules/rules/integrations/aws/persistence_rds_instance_made_public.toml +103 -22
  51. nldcsc_elastic_rules/rules/integrations/aws/persistence_redshift_instance_creation.toml +3 -3
  52. nldcsc_elastic_rules/rules/integrations/aws/privilege_escalation_sts_assume_root_from_rare_user_and_member_account.toml +126 -69
  53. nldcsc_elastic_rules/rules/integrations/azure/credential_access_azure_entra_susp_device_code_signin.toml +134 -0
  54. nldcsc_elastic_rules/rules/integrations/azure/credential_access_entra_id_excessive_account_lockouts.toml +2 -2
  55. nldcsc_elastic_rules/rules/integrations/azure/ml_azure_event_failures.toml +124 -0
  56. nldcsc_elastic_rules/rules/integrations/azure/ml_azure_rare_event_failures.toml +148 -0
  57. nldcsc_elastic_rules/rules/integrations/azure/ml_azure_rare_method_by_city.toml +109 -0
  58. nldcsc_elastic_rules/rules/integrations/azure/ml_azure_rare_method_by_country.toml +108 -0
  59. nldcsc_elastic_rules/rules/integrations/azure/ml_azure_rare_method_by_user.toml +147 -0
  60. nldcsc_elastic_rules/rules/integrations/fim/persistence_suspicious_file_modifications.toml +9 -1
  61. nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_error_message_spike.toml +95 -0
  62. nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_rare_error_code.toml +118 -0
  63. nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_rare_method_by_city.toml +79 -0
  64. nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_rare_method_by_country.toml +79 -0
  65. nldcsc_elastic_rules/rules/integrations/gcp/ml_gcp_rare_method_by_user.toml +117 -0
  66. nldcsc_elastic_rules/rules/integrations/github/initial_access_github_register_self_hosted_runner.toml +92 -0
  67. nldcsc_elastic_rules/rules/integrations/o365/collection_onedrive_excessive_file_downloads.toml +24 -14
  68. nldcsc_elastic_rules/rules/linux/defense_evasion_file_deletion_via_shred.toml +12 -5
  69. nldcsc_elastic_rules/rules/linux/execution_suspicious_pod_or_container_creation_command_execution.toml +150 -0
  70. nldcsc_elastic_rules/rules/linux/persistence_at_job_creation.toml +4 -4
  71. nldcsc_elastic_rules/rules/linux/persistence_pluggable_authentication_module_creation.toml +12 -7
  72. nldcsc_elastic_rules/rules/linux/persistence_pth_file_creation.toml +6 -1
  73. nldcsc_elastic_rules/rules/linux/persistence_site_and_user_customize_file_creation.toml +6 -1
  74. nldcsc_elastic_rules/rules/linux/persistence_web_server_unusual_command_execution.toml +155 -0
  75. nldcsc_elastic_rules/rules/ml/ml_high_count_events_for_a_host_name.toml +58 -1
  76. nldcsc_elastic_rules/rules/ml/ml_high_count_network_denies.toml +71 -1
  77. nldcsc_elastic_rules/rules/ml/ml_high_count_network_events.toml +53 -1
  78. nldcsc_elastic_rules/rules/ml/ml_linux_anomalous_network_activity.toml +56 -1
  79. nldcsc_elastic_rules/rules/ml/ml_linux_anomalous_network_port_activity.toml +40 -1
  80. nldcsc_elastic_rules/rules/ml/ml_low_count_events_for_a_host_name.toml +27 -1
  81. nldcsc_elastic_rules/rules/ml/ml_packetbeat_rare_server_domain.toml +63 -1
  82. nldcsc_elastic_rules/rules/ml/ml_rare_destination_country.toml +68 -1
  83. nldcsc_elastic_rules/rules/ml/ml_spike_in_traffic_to_a_country.toml +53 -1
  84. nldcsc_elastic_rules/rules/ml/ml_windows_anomalous_network_activity.toml +56 -1
  85. nldcsc_elastic_rules/rules/network/initial_access_react_server_components_rce_attempt.toml +123 -0
  86. nldcsc_elastic_rules/rules/promotions/external_alerts.toml +2 -2
  87. nldcsc_elastic_rules/rules/windows/command_and_control_common_webservices.toml +4 -3
  88. nldcsc_elastic_rules/rules/windows/credential_access_rare_webdav_destination.toml +3 -4
  89. nldcsc_elastic_rules/rules/windows/defense_evasion_masquerading_as_svchost.toml +11 -8
  90. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation.toml +25 -2
  91. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_backtick.toml +2 -3
  92. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_backtick_var.toml +2 -3
  93. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_char_arrays.toml +2 -3
  94. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_concat_dynamic.toml +2 -3
  95. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_high_number_proportion.toml +2 -3
  96. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_iex_env_vars_reconstruction.toml +2 -3
  97. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_iex_string_reconstruction.toml +2 -3
  98. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_index_reversal.toml +2 -3
  99. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_reverse_keyword.toml +2 -3
  100. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_string_concat.toml +2 -3
  101. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_string_format.toml +2 -3
  102. nldcsc_elastic_rules/rules/windows/defense_evasion_posh_obfuscation_whitespace_special_proportion.toml +2 -3
  103. nldcsc_elastic_rules/rules/windows/defense_evasion_wsl_filesystem.toml +13 -10
  104. nldcsc_elastic_rules/rules/windows/execution_posh_hacktool_functions.toml +3 -2
  105. nldcsc_elastic_rules/rules/windows/execution_suspicious_powershell_imgload.toml +7 -2
  106. nldcsc_elastic_rules/rules/windows/execution_windows_powershell_susp_args.toml +9 -2
  107. nldcsc_elastic_rules/rules/windows/impact_mod_critical_os_files.toml +16 -6
  108. nldcsc_elastic_rules/rules/windows/lateral_movement_credential_access_kerberos_correlation.toml +7 -2
  109. nldcsc_elastic_rules/rules/windows/lateral_movement_scheduled_task_target.toml +2 -2
  110. nldcsc_elastic_rules/rules/windows/persistence_browser_extension_install.toml +19 -2
  111. nldcsc_elastic_rules/rules/windows/persistence_msi_installer_task_startup.toml +50 -13
  112. nldcsc_elastic_rules/rules/windows/persistence_via_application_shimming.toml +12 -2
  113. nldcsc_elastic_rules/rules/windows/privilege_escalation_tokenmanip_sedebugpriv_enabled.toml +24 -18
  114. nldcsc_elastic_rules/rules/windows/privilege_escalation_unusual_printspooler_childprocess.toml +14 -2
  115. nldcsc_elastic_rules/rules/windows/privilege_escalation_via_ppid_spoofing.toml +3 -2
  116. {nldcsc_elastic_rules-0.0.8.dist-info → nldcsc_elastic_rules-0.0.16.dist-info}/METADATA +1 -1
  117. {nldcsc_elastic_rules-0.0.8.dist-info → nldcsc_elastic_rules-0.0.16.dist-info}/RECORD +119 -87
  118. nldcsc_elastic_rules/rules/integrations/aws/credential_access_aws_iam_assume_role_brute_force.toml +0 -105
  119. nldcsc_elastic_rules/rules/integrations/aws/discovery_ec2_multi_region_describe_instances.toml +0 -135
  120. nldcsc_elastic_rules/rules/integrations/aws/discovery_ec2_multiple_discovery_api_calls_via_cli.toml +0 -155
  121. nldcsc_elastic_rules/rules/integrations/aws/impact_efs_filesystem_or_mount_deleted.toml +0 -95
  122. {nldcsc_elastic_rules-0.0.8.dist-info → nldcsc_elastic_rules-0.0.16.dist-info}/WHEEL +0 -0
  123. {nldcsc_elastic_rules-0.0.8.dist-info → nldcsc_elastic_rules-0.0.16.dist-info}/top_level.txt +0 -0
@@ -1 +1 @@
1
- __version__ = "d10dc0809"
1
+ __version__ = "56574c99c"
@@ -1,8 +1,8 @@
1
1
  [metadata]
2
2
  creation_date = "2025/09/18"
3
- integration = ["endpoint", "crowdstrike"]
3
+ integration = ["endpoint", "windows", "system", "sentinel_one_cloud_funnel", "crowdstrike", "auditd_manager"]
4
4
  maturity = "production"
5
- updated_date = "2025/10/17"
5
+ updated_date = "2025/11/26"
6
6
 
7
7
  [rule]
8
8
  author = ["Elastic"]
@@ -12,7 +12,18 @@ command and control behavior. Adversaries may use Node.js to download additional
12
12
  the system.
13
13
  """
14
14
  from = "now-9m"
15
- index = ["logs-endpoint.events.process*", "logs-crowdstrike.fdr*"]
15
+ index = [
16
+ "endgame-*",
17
+ "logs-crowdstrike.fdr*",
18
+ "logs-endpoint.events.process-*",
19
+ "logs-sentinel_one_cloud_funnel.*",
20
+ "logs-system.security*",
21
+ "logs-windows.forwarded*",
22
+ "logs-windows.sysmon_operational-*",
23
+ "winlogbeat-*",
24
+ "auditbeat-*",
25
+ "logs-auditd_manager.auditd-*"
26
+ ]
16
27
  language = "eql"
17
28
  license = "Elastic License v2"
18
29
  name = "Curl or Wget Spawned via Node.js"
@@ -46,7 +57,7 @@ This rule flags Node.js launching curl or wget, directly or via a shell, a commo
46
57
  - Rebuild and redeploy the workload from a known-good image, remove the malicious child_process code path from the Node.js application, restore validated configs/data, rotate any keys or tokens used by that service, and verify no further curl/wget spawns occur post-recovery.
47
58
  - Harden by removing curl/wget from runtime images where not required, enforcing egress allowlists for the service, constraining execution with AppArmor/SELinux/seccomp and least-privilege service accounts, and adding CI/CD checks to block package.json postinstall scripts or code that shells out to downloaders.
48
59
  """
49
- risk_score = 21
60
+ risk_score = 47
50
61
  rule_id = "d9af2479-ad13-4471-a312-f586517f1243"
51
62
  setup = """## Setup
52
63
 
@@ -73,28 +84,38 @@ For more details on Elastic Agent configuration settings, refer to the [helper g
73
84
  - To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts.
74
85
  For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
75
86
  """
76
- severity = "low"
87
+ severity = "medium"
77
88
  tags = [
78
89
  "Domain: Endpoint",
79
90
  "OS: Linux",
91
+ "OS: Windows",
92
+ "OS: macOS",
80
93
  "Use Case: Threat Detection",
81
94
  "Tactic: Command and Control",
82
- "Data Source: Elastic Defend",
83
95
  "Resources: Investigation Guide",
96
+ "Data Source: Elastic Defend",
97
+ "Data Source: Elastic Endgame",
98
+ "Data Source: Windows Security Event Logs",
99
+ "Data Source: Sysmon",
100
+ "Data Source: SentinelOne",
84
101
  "Data Source: Crowdstrike",
102
+ "Data Source: Auditd Manager",
85
103
  ]
86
104
  timestamp_override = "event.ingested"
87
105
  type = "eql"
88
106
  query = '''
89
- process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "ProcessRollup2") and process.parent.name == "node" and (
107
+ process where event.type == "start" and
108
+ event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and
109
+ process.parent.name in ("node", "bun", "node.exe", "bun.exe") and (
90
110
  (
91
- process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish") and
92
- process.args == "-c" and process.command_line like~ ("*curl*", "*wget*")
111
+ process.name in ("bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "cmd.exe", "bash.exe", "powershell.exe") and
112
+ process.command_line like~ ("*curl*http*", "*wget*http*")
93
113
  ) or
94
114
  (
95
- process.name in ("curl", "wget")
115
+ process.name in ("curl", "wget", "curl.exe", "wget.exe")
96
116
  )
97
- )
117
+ ) and
118
+ not process.command_line like ("*127.0.0.1*", "*localhost*")
98
119
  '''
99
120
 
100
121
  [[rule.threat]]
@@ -0,0 +1,134 @@
1
+ [metadata]
2
+ creation_date = "2025/12/04"
3
+ integration = ["endpoint", "windows"]
4
+ maturity = "production"
5
+ updated_date = "2025/12/04"
6
+
7
+ [rule]
8
+ author = ["Elastic"]
9
+ description = """
10
+ Detects when GenAI tools connect to domains using suspicious TLDs commonly abused for malware C2 infrastructure. TLDs
11
+ like .top, .xyz, .ml, .cf, .onion are frequently used in phishing and malware campaigns. Legitimate GenAI services use
12
+ well-established domains (.com, .ai, .io), so connections to suspicious TLDs may indicate compromised tools, malicious
13
+ plugins, or AI-generated code connecting to attacker infrastructure.
14
+ """
15
+ from = "now-9m"
16
+ index = ["logs-endpoint.events.network*", "winlogbeat-*", "logs-windows.sysmon_operational-*"]
17
+ language = "eql"
18
+ license = "Elastic License v2"
19
+ name = "GenAI Process Connection to Suspicious Top Level Domain"
20
+ note = """## Triage and analysis
21
+
22
+ ### Investigating GenAI Process Connection to Suspicious Top Level Domain
23
+
24
+ This rule detects GenAI tools connecting to domains with TLDs commonly abused by malware. The suspicious TLD filter makes this a high-signal rule with low expected volume.
25
+
26
+ ### Possible investigation steps
27
+
28
+ - Review the GenAI process command line to identify which tool is running and verify if it's an expected/authorized tool.
29
+ - Examine the network connection details (destination IP, port, protocol) to understand the nature of the communication.
30
+ - Check the process execution chain to identify the full attack path and initial entry point.
31
+ - Investigate the user account associated with the GenAI process to determine if this activity is expected for that user.
32
+ - Review network traffic patterns to identify data exfiltration or command and control communications.
33
+ - Check for other alerts or suspicious activity on the same host around the same time.
34
+ - Verify if the GenAI tool is from a trusted source and if it's authorized for use in your environment.
35
+ - Confirm whether the suspicious domain is used by package registries, CDN mirrors, or AI plugin repos.
36
+ - Check if the GenAI tool attempted follow-up actions such as downloading scripts, connecting to IPs directly, or loading remote models.
37
+ - Inspect whether the domain matches prompt-redirections, malicious AI plugins, or compromised package dependencies.
38
+
39
+ ### False positive analysis
40
+
41
+ - Legitimate GenAI tools may occasionally connect to domains using suspicious TLDs if they're legitimate services.
42
+ - Package managers (npx, pnpm, yarn, bunx) may connect to package registries or CDNs that use suspicious TLDs. Review and exclude known legitimate package registries if needed.
43
+ - Some third-party AI plugin ecosystems (VSCode AI plugins, Cursor extensions) may download assets from unusual TLDs; verify allowlists.
44
+
45
+ ### Response and remediation
46
+
47
+ - Terminate the GenAI process and any spawned child processes to stop the malicious activity.
48
+ - Review and revoke any API keys, tokens, or credentials that may have been exposed or used by the GenAI tool.
49
+ - Block the identified suspicious domains at the network level.
50
+ - Investigate the GenAI tool configuration to identify how it was configured and what it was authorized to access.
51
+ - Update security policies to restrict or monitor GenAI tool usage in the environment, especially for network communications.
52
+ - Add detection for secondary indicators (reverse shells, encoded C2 traffic, odd user-agent strings).
53
+ """
54
+ references = [
55
+ "https://www.cybercrimeinfocenter.org/top-20-tlds-by-malicious-phishing-domains",
56
+ "https://atlas.mitre.org/techniques/AML.T0086",
57
+ "https://www.elastic.co/security-labs/elastic-advances-llm-security",
58
+ ]
59
+ risk_score = 47
60
+ rule_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
61
+ severity = "medium"
62
+ tags = [
63
+ "Domain: Endpoint",
64
+ "OS: macOS",
65
+ "OS: Windows",
66
+ "Use Case: Threat Detection",
67
+ "Tactic: Command and Control",
68
+ "Data Source: Elastic Defend",
69
+ "Data Source: Sysmon",
70
+ "Resources: Investigation Guide",
71
+ "Domain: LLM",
72
+ "Mitre Atlas: T0086",
73
+ ]
74
+ timestamp_override = "event.ingested"
75
+ type = "eql"
76
+
77
+ query = '''
78
+ network where host.os.type in ("macos", "windows") and
79
+
80
+ // GenAI processes
81
+ process.name in (
82
+ "ollama.exe", "ollama", "Ollama",
83
+ "textgen.exe", "textgen", "text-generation-webui.exe", "oobabooga.exe",
84
+ "lmstudio.exe", "lmstudio", "LM Studio",
85
+ "claude.exe", "claude", "Claude",
86
+ "cursor.exe", "cursor", "Cursor",
87
+ "copilot.exe", "copilot", "Copilot",
88
+ "codex.exe", "codex",
89
+ "Jan", "jan.exe", "jan",
90
+ "gpt4all.exe", "gpt4all", "GPT4All",
91
+ "gemini-cli.exe", "gemini-cli",
92
+ "genaiscript.exe", "genaiscript",
93
+ "grok.exe", "grok",
94
+ "qwen.exe", "qwen",
95
+ "koboldcpp.exe", "koboldcpp", "KoboldCpp",
96
+ "llama-server", "llama-cli",
97
+ "deno.exe", "deno",
98
+ "npx", "pnpm", "yarn", "bunx"
99
+ ) and
100
+
101
+ // Suspicious TLDs
102
+ (
103
+ // Windows DNS events
104
+ (host.os.type == "windows" and dns.question.name != null and
105
+ dns.question.name regex """.*\.(top|buzz|xyz|rest|ml|cf|gq|ga|onion|monster|cyou|quest|cc|bar|cfd|click|cam|surf|tk|shop|club|icu|pw|ws|online|fun|life|boats|store|hair|skin|motorcycles|christmas|lol|makeup|mom|bond|beauty|biz|live|work|zip|country|accountant|date|party|science|loan|win|men|faith|review|racing|download|host)""") or
106
+
107
+ // macOS network events
108
+ (host.os.type == "macos" and destination.domain != null and
109
+ destination.domain regex """.*\.(top|buzz|xyz|rest|ml|cf|gq|ga|onion|monster|cyou|quest|cc|bar|cfd|click|cam|surf|tk|shop|club|icu|pw|ws|online|fun|life|boats|store|hair|skin|motorcycles|christmas|lol|makeup|mom|bond|beauty|biz|live|work|zip|country|accountant|date|party|science|loan|win|men|faith|review|racing|download|host)""")
110
+
111
+ // Linux DNS events
112
+ // Revist when available
113
+ )
114
+ '''
115
+
116
+
117
+ [[rule.threat]]
118
+ framework = "MITRE ATT&CK"
119
+ [[rule.threat.technique]]
120
+ id = "T1071"
121
+ name = "Application Layer Protocol"
122
+ reference = "https://attack.mitre.org/techniques/T1071/"
123
+ [[rule.threat.technique.subtechnique]]
124
+ id = "T1071.004"
125
+ name = "DNS"
126
+ reference = "https://attack.mitre.org/techniques/T1071/004/"
127
+
128
+
129
+
130
+ [rule.threat.tactic]
131
+ id = "TA0011"
132
+ name = "Command and Control"
133
+ reference = "https://attack.mitre.org/tactics/TA0011/"
134
+
@@ -0,0 +1,128 @@
1
+ [metadata]
2
+ creation_date = "2025/12/04"
3
+ integration = ["endpoint"]
4
+ maturity = "production"
5
+ updated_date = "2025/12/04"
6
+
7
+ [rule]
8
+ author = ["Elastic"]
9
+ description = """
10
+ Detects GenAI tools connecting to unusual domains on macOS. Adversaries may compromise GenAI tools through prompt
11
+ injection, malicious MCP servers, or poisoned plugins to establish C2 channels or exfiltrate sensitive data to
12
+ attacker-controlled infrastructure. AI agents with network access can be manipulated to beacon to external servers,
13
+ download malicious payloads, or transmit harvested credentials and documents.
14
+ """
15
+ from = "now-9m"
16
+ index = ["logs-endpoint.events.network*"]
17
+ language = "kuery"
18
+ license = "Elastic License v2"
19
+ name = "GenAI Process Connection to Unusual Domain"
20
+ note = """## Triage and analysis
21
+
22
+ ### Investigating GenAI Process Connection to Unusual Domain
23
+
24
+ GenAI tools with network access can be weaponized to contact attacker infrastructure for C2, data exfiltration, or payload retrieval. Compromised MCP servers, malicious plugins, or prompt injection attacks can redirect AI agents to connect to arbitrary domains. While legitimate GenAI tools connect to vendor APIs and CDNs, connections to unusual domains may indicate exploitation.
25
+
26
+ ### Possible investigation steps
27
+
28
+ - Review the destination domain to determine if it's a legitimate GenAI service, CDN, package registry, or potentially malicious infrastructure.
29
+ - Investigate the GenAI process command line and configuration to identify what triggered the connection (plugin, MCP server, user prompt).
30
+ - Check if the domain was recently registered, uses a suspicious TLD, or has a low reputation score in threat intelligence feeds.
31
+ - Review the timing and context of the connection to determine if it correlates with user activity or was automated.
32
+ - Examine network traffic to and from the domain to identify the nature of the communication (API calls, file downloads, data exfiltration).
33
+ - Check for other hosts in the environment connecting to the same domain to determine if this is an isolated incident.
34
+ - Investigate whether the GenAI tool's configuration files were recently modified to add new MCP servers or plugins.
35
+ - Correlate with file events to see if the GenAI tool downloaded or created files around the same time as the connection.
36
+
37
+ ### False positive analysis
38
+
39
+ - GenAI tools may connect to new domains as vendors update their infrastructure, CDNs, or API endpoints.
40
+ - Package managers (npm, pip) used by MCP servers may connect to package registries for dependency resolution.
41
+ - Legitimate MCP servers and AI plugins connect to their respective backend services.
42
+ - Developer workflows testing new AI integrations or MCP servers will naturally trigger alerts for novel domain connections.
43
+
44
+ ### Response and remediation
45
+
46
+ - If the domain is confirmed malicious, block it at the network level and investigate the source of the compromise.
47
+ - Review the GenAI tool's configuration for unauthorized MCP servers, plugins, or extensions that initiated the connection.
48
+ - Investigate any data that may have been sent to the suspicious domain and assess the potential for data exfiltration.
49
+ - Review and rotate any API keys, tokens, or credentials used by the GenAI tool.
50
+ - Update detection rules to monitor the identified domain across all hosts in the environment.
51
+ """
52
+ references = [
53
+ "https://atlas.mitre.org/techniques/AML.T0086",
54
+ "https://glama.ai/blog/2025-11-11-the-lethal-trifecta-securing-model-context-protocol-against-data-flow-attacks",
55
+ "https://www.elastic.co/security-labs/elastic-advances-llm-security",
56
+ "https://specterops.io/blog/2025/11/21/an-evening-with-claude-code",
57
+ ]
58
+ risk_score = 47
59
+ rule_id = "9050506c-df6d-4bdf-bc82-fcad0ef1e8c1"
60
+ severity = "medium"
61
+ tags = [
62
+ "Domain: Endpoint",
63
+ "OS: macOS",
64
+ "Use Case: Threat Detection",
65
+ "Tactic: Command and Control",
66
+ "Data Source: Elastic Defend",
67
+ "Resources: Investigation Guide",
68
+ "Domain: LLM",
69
+ "Mitre Atlas: T0086",
70
+ ]
71
+ timestamp_override = "event.ingested"
72
+ type = "new_terms"
73
+
74
+ query = '''
75
+ event.category:network and host.os.type:macos and
76
+ process.name:(
77
+ Claude or "Claude Helper" or "Claude Helper (Plugin)" or Copilot or Cursor or
78
+ "Cursor Helper" or "Cursor Helper (Plugin)" or GPT4All or Jan or "Jan Helper" or
79
+ KoboldCpp or "LM Studio" or Ollama or Windsurf or "Windsurf Helper" or
80
+ "Windsurf Helper (Plugin)" or bunx or claude or codex or copilot or cursor or deno or
81
+ gemini-cli or genaiscript or gpt4all or grok or jan or koboldcpp or llama-cli or
82
+ llama-server or lmstudio or npx or ollama or pnpm or qwen or textgen or windsurf or yarn
83
+ ) and destination.domain:(* and not (
84
+ aka.ms or anthropic.com or atlassian.com or cursor.com or cursor.sh or github.com or
85
+ gpt4all.io or hf.co or huggingface.co or lmstudio.ai or localhost or ollama.ai or
86
+ ollama.com or openai.com or *.aka.ms or *.akamaized.net or *.amazonaws.com or
87
+ *.amplitude.com or *.anthropic.com or *.atlassian.com or *.aws.amazon.com or
88
+ *.azure.com or *.cdn.cloudflare.net or *.cloudflare-dns.com or *.cloudflare.com or
89
+ *.cloudflarestorage.com or *.codeium.com or *.cursor.com or *.cursor.sh or
90
+ *.datadoghq.com or *.elastic-cloud.com or *.elastic.co or *.exp-tas.com or
91
+ *.gemini.google.com or *.generativelanguage.googleapis.com or *.github.com or
92
+ *.githubcopilot.com or *.githubusercontent.com or *.gitkraken.com or *.gitkraken.dev or
93
+ *.google.com or *.googleapis.com or *.gpt4all.io or *.grok.x.ai or *.hf.co or
94
+ *.honeycomb.io or *.huggingface.co or *.intercom.io or *.jan.ai or *.launchdarkly.com or
95
+ *.lmstudio.ai or *.microsoft.com or *.mixpanel.com or *.msedge.net or *.npmjs.com or
96
+ *.npmjs.org or *.ollama.ai or *.ollama.com or *.openai.com or *.pypi.org or
97
+ *.r2.cloudflarestorage.com or *.segment.io or *.sentry.io or *.visualstudio.com or
98
+ *.vsassets.io or *.vscode-cdn.net or *.windsurf.ai or *.x.ai or *.yarnpkg.com
99
+ ))
100
+ '''
101
+
102
+
103
+ [[rule.threat]]
104
+ framework = "MITRE ATT&CK"
105
+ [[rule.threat.technique]]
106
+ id = "T1071"
107
+ name = "Application Layer Protocol"
108
+ reference = "https://attack.mitre.org/techniques/T1071/"
109
+ [[rule.threat.technique.subtechnique]]
110
+ id = "T1071.001"
111
+ name = "Web Protocols"
112
+ reference = "https://attack.mitre.org/techniques/T1071/001/"
113
+
114
+
115
+
116
+ [rule.threat.tactic]
117
+ id = "TA0011"
118
+ name = "Command and Control"
119
+ reference = "https://attack.mitre.org/tactics/TA0011/"
120
+
121
+ [rule.new_terms]
122
+ field = "new_terms_fields"
123
+ value = ["destination.domain"]
124
+ [[rule.new_terms.history_window_start]]
125
+ field = "history_window_start"
126
+ value = "now-7d"
127
+
128
+
@@ -0,0 +1,154 @@
1
+ [metadata]
2
+ creation_date = "2025/12/04"
3
+ integration = ["endpoint"]
4
+ maturity = "production"
5
+ updated_date = "2025/12/04"
6
+
7
+ [rule]
8
+ author = ["Elastic"]
9
+ description = """
10
+ Detects when GenAI tools access sensitive files such as cloud credentials, SSH keys, browser password databases, or
11
+ shell configurations. Attackers leverage GenAI agents to systematically locate and exfiltrate credentials, API keys, and
12
+ tokens. Access to credential stores (.aws/credentials, .ssh/id_*) suggests harvesting, while writes to shell configs
13
+ (.bashrc, .zshrc) indicate persistence attempts. Note: On linux only creation events are available. Access events are not yet implemented.
14
+ """
15
+ from = "now-9m"
16
+ index = ["logs-endpoint.events.file*"]
17
+ language = "eql"
18
+ license = "Elastic License v2"
19
+ name = "GenAI Process Accessing Sensitive Files"
20
+ note = """## Triage and analysis
21
+
22
+ ### Investigating GenAI Process Accessing Sensitive Files
23
+
24
+ This rule detects GenAI tools accessing credential files, SSH keys, browser data, or shell configurations. While GenAI tools legitimately access project files, access to sensitive credential stores is unusual and warrants investigation.
25
+
26
+ ### Possible investigation steps
27
+
28
+ - Review the GenAI process that triggered the alert to identify which tool is being used and verify if it's an expected/authorized tool.
29
+ - Investigate the user account associated with the GenAI process to determine if this activity is expected for that user.
30
+ - Review the types of sensitive files being accessed (credentials, keys, browser data, etc.) to assess the potential impact of credential harvesting or data exfiltration.
31
+ - Check for other alerts or suspicious activity on the same host around the same time, particularly network exfiltration events.
32
+ - Verify if the GenAI tool or extension is from a trusted source and if it's authorized for use in your environment.
33
+ - Determine if the GenAI process accessed multiple sensitive directories in sequence, an indication of credential harvesting.
34
+ - Check if the GenAI tool recently created or accessed AI agent config files, which may contain instructions enabling autonomous file scanning.
35
+ - Review whether the access was preceded by an MCP server, LangChain agent, or background automation.
36
+
37
+ ### False positive analysis
38
+
39
+ - Automated security scanning or auditing tools that leverage GenAI may access sensitive files as part of their normal operation.
40
+ - Development workflows that use GenAI tools for code analysis may occasionally access credential files.
41
+
42
+ ### Response and remediation
43
+
44
+ - Immediately review the GenAI process that accessed the documents to determine if it's compromised or malicious.
45
+ - Review, rotate, and revoke any API keys, tokens, or credentials that may have been exposed or used by the GenAI tool.
46
+ - Investigate the document access patterns to determine the scope of potential data exfiltration.
47
+ - Update security policies to restrict or monitor GenAI tool usage in the environment, especially for access to sensitive files.
48
+ """
49
+ references = [
50
+ "https://atlas.mitre.org/techniques/AML.T0085",
51
+ "https://atlas.mitre.org/techniques/AML.T0085.001",
52
+ "https://atlas.mitre.org/techniques/AML.T0055",
53
+ "https://glama.ai/blog/2025-11-11-the-lethal-trifecta-securing-model-context-protocol-against-data-flow-attacks",
54
+ "https://www.elastic.co/security-labs/elastic-advances-llm-security",
55
+ "https://specterops.io/blog/2025/11/21/an-evening-with-claude-code",
56
+ ]
57
+ risk_score = 73
58
+ rule_id = "c0136397-f82a-45e5-9b9f-a3651d77e21a"
59
+ severity = "high"
60
+ tags = [
61
+ "Domain: Endpoint",
62
+ "OS: Linux",
63
+ "OS: macOS",
64
+ "OS: Windows",
65
+ "Use Case: Threat Detection",
66
+ "Tactic: Collection",
67
+ "Tactic: Credential Access",
68
+ "Data Source: Elastic Defend",
69
+ "Resources: Investigation Guide",
70
+ "Domain: LLM",
71
+ "Mitre Atlas: T0085",
72
+ "Mitre Atlas: T0085.001",
73
+ "Mitre Atlas: T0055",
74
+ ]
75
+ timestamp_override = "event.ingested"
76
+ type = "eql"
77
+
78
+ query = '''
79
+ file where event.action in ("open", "creation", "modification") and event.outcome == "success" and
80
+
81
+ // GenAI process
82
+ process.name in (
83
+ "ollama.exe", "ollama", "Ollama",
84
+ "textgen.exe", "textgen", "text-generation-webui.exe", "oobabooga.exe",
85
+ "lmstudio.exe", "lmstudio", "LM Studio",
86
+ "claude.exe", "claude", "Claude",
87
+ "cursor.exe", "cursor", "Cursor",
88
+ "copilot.exe", "copilot", "Copilot",
89
+ "codex.exe", "codex",
90
+ "Jan", "jan.exe", "jan",
91
+ "gpt4all.exe", "gpt4all", "GPT4All",
92
+ "gemini-cli.exe", "gemini-cli",
93
+ "genaiscript.exe", "genaiscript",
94
+ "grok.exe", "grok",
95
+ "qwen.exe", "qwen",
96
+ "koboldcpp.exe", "koboldcpp", "KoboldCpp",
97
+ "llama-server", "llama-cli"
98
+ ) and
99
+
100
+ // Sensitive file paths
101
+ (
102
+ // Persistence via Shell configs
103
+ file.name in (".bashrc", ".bash_profile", ".zshrc", ".zshenv", ".zprofile", ".profile", ".bash_logout") or
104
+
105
+ // Credentials In Files
106
+ file.name like~
107
+ ("key?.db",
108
+ "logins.json",
109
+ "Login Data",
110
+ "Local State",
111
+ "signons.sqlite",
112
+ "Cookies",
113
+ "cookies.sqlite",
114
+ "Cookies.binarycookies",
115
+ "login.keychain-db",
116
+ "System.keychain",
117
+ "credentials.db",
118
+ "credentials",
119
+ "access_tokens.db",
120
+ "accessTokens.json",
121
+ "azureProfile.json",
122
+ "RDCMan.settings",
123
+ "known_hosts",
124
+ "KeePass.config.xml",
125
+ "Unattended.xml")
126
+ )
127
+ '''
128
+
129
+
130
+ [[rule.threat]]
131
+ framework = "MITRE ATT&CK"
132
+ [[rule.threat.technique]]
133
+ id = "T1555"
134
+ name = "Credentials from Password Stores"
135
+ reference = "https://attack.mitre.org/techniques/T1555/"
136
+
137
+
138
+ [rule.threat.tactic]
139
+ id = "TA0006"
140
+ name = "Credential Access"
141
+ reference = "https://attack.mitre.org/tactics/TA0006/"
142
+ [[rule.threat]]
143
+ framework = "MITRE ATT&CK"
144
+ [[rule.threat.technique]]
145
+ id = "T1005"
146
+ name = "Data from Local System"
147
+ reference = "https://attack.mitre.org/techniques/T1005/"
148
+
149
+
150
+ [rule.threat.tactic]
151
+ id = "TA0009"
152
+ name = "Collection"
153
+ reference = "https://attack.mitre.org/tactics/TA0009/"
154
+
@@ -0,0 +1,114 @@
1
+ [metadata]
2
+ creation_date = "2025/11/28"
3
+ integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike", "auditd_manager"]
4
+ maturity = "production"
5
+ updated_date = "2025/11/28"
6
+
7
+ [rule]
8
+ author = ["Elastic"]
9
+ description = """
10
+ This rule detects the execution of Gitleaks, a tool used to search for high-entropy strings and secrets in code
11
+ repositories, which may indicate an attempt to access credentials.
12
+ """
13
+ false_positives = [
14
+ """
15
+ Gitleaks is a legitimate open-source tool used by security professionals and developers to search for sensitive
16
+ information, such as passwords, API keys, and other secrets, within code repositories. It is commonly employed
17
+ during security assessments and code reviews to identify potential vulnerabilities.
18
+ """,
19
+ ]
20
+ from = "now-9m"
21
+ index = [
22
+ "endgame-*",
23
+ "logs-crowdstrike.fdr*",
24
+ "logs-endpoint.events.process-*",
25
+ "logs-m365_defender.event-*",
26
+ "logs-sentinel_one_cloud_funnel.*",
27
+ "logs-system.security*",
28
+ "logs-windows.forwarded*",
29
+ "logs-windows.sysmon_operational-*",
30
+ "winlogbeat-*",
31
+ "auditbeat-*",
32
+ "logs-auditd_manager.auditd-*"
33
+ ]
34
+ language = "eql"
35
+ license = "Elastic License v2"
36
+ name = "Potential Secret Scanning via Gitleaks"
37
+ note = """## Triage and analysis
38
+
39
+ > **Disclaimer**:
40
+ > This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
41
+
42
+ ### Investigating Potential Secret Scanning via Gitleaks
43
+
44
+ This alert fires when a host launches Gitleaks, a secret-scanning utility that hunts high-entropy strings and credentials in source code and repositories, signaling potential credential harvesting. An attacker may clone internal repos or traverse local workspace directories, drop a portable gitleaks binary in /tmp or %TEMP%, run recursive scans with wide rule sets and JSON output, then archive the results to exfiltrate tokens, API keys, and passwords for lateral movement and service impersonation.
45
+
46
+ ### Possible investigation steps
47
+
48
+ - Review the full command line to identify --path/--repo/--report/--format flags, which reveal scope and whether results are being written for exfiltration.
49
+ - Examine parent and ancestry plus user session to determine if it was launched by CI/dev tooling versus an interactive shell, and note execution from temp or unusual directories suggesting a dropped portable binary.
50
+ - Locate and inspect newly created artifacts (gitleaks.json, .sarif, .csv, zip archives) near the event time, confirm the presence of secrets, and map their sensitivity to affected systems.
51
+ - Correlate with network and data movement around the event for clones to internal repos and outbound transfers to cloud storage, paste sites, or email, and capture repository URLs or destinations if present.
52
+ - Trace how the binary arrived by checking recent downloads and file writes (curl/wget, package managers, GitHub releases), verify the binary’s hash and signer, and compare against known-good sources.
53
+
54
+ ### False positive analysis
55
+
56
+ - A developer or security team member intentionally runs gitleaks to audit internal code for secrets during routine hygiene, producing local report artifacts and showing normal parent processes without exfiltration behavior.
57
+ - A user invokes gitleaks with --version or --help to validate installation or review usage, which generates a process start event but performs no scanning or credential access.
58
+
59
+ ### Response and remediation
60
+
61
+ - If the run was unauthorized or executed from /tmp, %TEMP%, or a user profile, terminate gitleaks.exe/gitleaks, isolate the host from the network, and capture the binary path and hash for forensics.
62
+ - Quarantine report artifacts produced by the run (gitleaks.json, .sarif, .csv, and any zip archives) by securing copies for evidence, removing world-readable permissions, and deleting residual copies from the working directory, Downloads, repo folders, and CI workspaces after collection.
63
+ - Eradicate tooling by removing the dropped gitleaks binary and any wrapper scripts or CI job steps that invoke it, and enforce execution blocking for gitleaks in user-writable paths via application control or EDR policy.
64
+ - Immediately revoke and rotate any secrets confirmed in the reports or repository (cloud API keys, service tokens, SSH keys, credentials), purge them from repo history (git filter-repo/BFG) if present, redeploy updated secrets from the vault, and force password resets for affected accounts.
65
+ - Review git activity and data movement around the event for repo clones and exports, and inspect outbound transfers of report files to cloud storage, paste sites, or email; escalate to Incident Response and Legal if any report left the device or if production/customer credentials are exposed.
66
+ - Harden going forward by enabling approved server-side and CI secret scanning, enforcing pre-commit hooks, prohibiting PATs with broad scopes, restricting egress to paste/file-sharing sites, and blocking execution of portable binaries from temp and user-writable locations."""
67
+ references = [
68
+ "https://www.elastic.co/blog/shai-hulud-worm-npm-supply-chain-compromise",
69
+ "https://socket.dev/blog/shai-hulud-strikes-again-v2",
70
+ ]
71
+ risk_score = 47
72
+ rule_id = "f92171ed-a4d3-4baa-98f9-4df1652cb11b"
73
+ severity = "medium"
74
+ tags = [
75
+ "Domain: Endpoint",
76
+ "OS: Linux",
77
+ "OS: Windows",
78
+ "OS: macOS",
79
+ "Use Case: Threat Detection",
80
+ "Tactic: Credential Access",
81
+ "Data Source: Elastic Endgame",
82
+ "Data Source: Elastic Defend",
83
+ "Data Source: Windows Security Event Logs",
84
+ "Data Source: Microsoft Defender for Endpoint",
85
+ "Data Source: Sysmon",
86
+ "Data Source: SentinelOne",
87
+ "Data Source: Crowdstrike",
88
+ "Data Source: Auditd Manager",
89
+ "Resources: Investigation Guide",
90
+ ]
91
+ timestamp_override = "event.ingested"
92
+ type = "eql"
93
+ query = '''
94
+ process where event.type == "start" and event.action like ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started", "Process Create*") and
95
+ process.name : ("gitleaks.exe", "gitleaks")
96
+ '''
97
+
98
+ [[rule.threat]]
99
+ framework = "MITRE ATT&CK"
100
+
101
+ [[rule.threat.technique]]
102
+ id = "T1003"
103
+ name = "OS Credential Dumping"
104
+ reference = "https://attack.mitre.org/techniques/T1003/"
105
+
106
+ [[rule.threat.technique]]
107
+ id = "T1555"
108
+ name = "Credentials from Password Stores"
109
+ reference = "https://attack.mitre.org/techniques/T1555/"
110
+
111
+ [rule.threat.tactic]
112
+ id = "TA0006"
113
+ name = "Credential Access"
114
+ reference = "https://attack.mitre.org/tactics/TA0006/"