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
@@ -0,0 +1,198 @@
1
+ [metadata]
2
+ creation_date = "2025/12/01"
3
+ integration = ["aws", "gcp", "azure"]
4
+ maturity = "production"
5
+ updated_date = "2025/12/01"
6
+
7
+ [rule]
8
+ author = ["Elastic"]
9
+ description = """
10
+ This rule detects authenticated sessions accessing secret stores across multiple cloud providers from the same source
11
+ address within a short period of time. Adversaries with access to compromised credentials or session tokens may attempt
12
+ to retrieve secrets from services such as AWS Secrets Manager, Google Secret Manager, or Azure Key Vault in rapid
13
+ succession to expand their access or exfiltrate sensitive information.
14
+ """
15
+ from = "now-9m"
16
+ interval = "5m"
17
+ language = "esql"
18
+ license = "Elastic License v2"
19
+ name = "Multiple Cloud Secrets Accessed by Source Address"
20
+ note = """## Triage and analysis
21
+
22
+ ### Multiple Cloud Secrets Accessed by Source Address
23
+
24
+ This alert identifies a single source IP address accessing secret-management APIs across **multiple cloud providers**
25
+ (e.g., AWS Secrets Manager, Google Secret Manager, Azure Key Vault) within a short timeframe.
26
+ This behavior is strongly associated with **credential theft, session hijacking, or token replay**, where an adversary
27
+ uses stolen authenticated sessions to harvest secrets across cloud environments.
28
+
29
+ Unexpected cross-cloud secret retrieval is uncommon and typically indicates automation misuse or malicious activity.
30
+
31
+ ### Possible investigation steps
32
+
33
+ - Validate the principal
34
+ - Identify the user, service account, workload identity, or application making the requests.
35
+ - Confirm whether this identity is expected to operate across more than one cloud provider.
36
+ - Review related activity
37
+ - Look for additional alerts involving the same identity, source IP, or token over the last 24–48 hours.
38
+ - Identify whether the source IP has been observed performing unusual authentication, privilege escalation,
39
+ or reconnaissance.
40
+ - Check application or service context
41
+ - Determine whether any workload legitimately pulls secrets from multiple cloud providers.
42
+ - Review deployment pipelines or integration layers that might legitimately bridge AWS, Azure, and GCP.
43
+ - Analyze user agent and invocation patterns
44
+ - Compare `user_agent.original` or equivalent fields against expected SDKs or automation tools.
45
+ - Suspicious indicators include CLI tools, unknown libraries, browser user agents, or custom scripts.
46
+ - Inspect IP reputation and origin
47
+ - Determine whether the source IP corresponds to a managed workload (EC2, GCE, Azure VM) or an unexpected host.
48
+ - Validate that the associated instance or host is under your control and behaving normally.
49
+ - Review IAM permissions and accessed secrets
50
+ - Check the policies attached to the identity.
51
+ - Verify whether the accessed secrets are sensitive, unused, or unrelated to the identity’s purpose.
52
+ - Assess potential compromise scope
53
+ - If compromise is suspected, enumerate other assets accessed by the same identity in the last 24 hours.
54
+ - Look for lateral movement, privilege escalation, or abnormal API usage.
55
+
56
+ ### False positive analysis
57
+
58
+ - Validate whether the source IP is associated with a legitimate multi-cloud orchestration tool, automation pipeline,
59
+ or shared CI/CD system.
60
+ - Confirm that the identity is authorized to access secrets across multiple cloud services.
61
+ - If activity is expected, consider adding exceptions that pair account identity, source IP, and expected user agent
62
+ to reduce noise.
63
+
64
+ ### Response and remediation
65
+
66
+ - Initiate incident response** if the activity is unauthorized or suspicious.
67
+ - Restrict or disable** the affected credentials or service accounts.
68
+ - Rotate all accessed secrets** and review other secrets the identity can access.
69
+ - Analyze systems** that may have leaked credentials, such as compromised hosts or exposed tokens.
70
+ - Harden identity security:
71
+ - Enforce MFA for users where applicable.
72
+ - Reduce permissions to least privilege.
73
+ - Review trust relationships, workload identities, and cross-cloud integrations.
74
+ - Search for persistence mechanisms** such as newly created keys, roles, or service accounts.
75
+ - Improve monitoring and audit visibility** by ensuring logging is enabled across all cloud environments.
76
+ - Determine root cause** (phishing, malware, token replay, exposed credential, etc.) and close the vector to prevent recurrence.
77
+ """
78
+ references = [
79
+ "https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html",
80
+ "https://docs.cloud.google.com/secret-manager/docs/samples/secretmanager-access-secret-version",
81
+ "https://learn.microsoft.com/en-us/azure/key-vault/secrets/about-secrets",
82
+ "https://www.wiz.io/blog/shai-hulud-2-0-ongoing-supply-chain-attack",
83
+ ]
84
+ risk_score = 73
85
+ rule_id = "472b4944-d810-43cf-83dc-7d080ae1b8dd"
86
+ setup = """
87
+ This multi-datasource rule relies on additional configurations from each hyperscaler.
88
+
89
+ - GCP Audit: [Enable DATA_READ for the Secret Manager API service](https://docs.cloud.google.com/logging/docs/audit/configure-data-access)
90
+ - Azure: [Enable Diagnostic Logging for the Key Vault Service](https://learn.microsoft.com/en-us/azure/key-vault/general/howto-logging?tabs=azure-cli)
91
+ - AWS: Secrets Manager read access is automatically logged by CloudTrail.
92
+ """
93
+ severity = "high"
94
+ tags = [
95
+ "Domain: Cloud",
96
+ "Domain: IAM",
97
+ "Domain: Storage",
98
+ "Data Source: AWS",
99
+ "Data Source: Amazon Web Services",
100
+ "Data Source: AWS Secrets Manager",
101
+ "Data Source: Azure",
102
+ "Data Source: Azure Activity Logs",
103
+ "Data Source: GCP",
104
+ "Data Source: Google Cloud Platform",
105
+ "Tactic: Credential Access",
106
+ "Resources: Investigation Guide",
107
+ ]
108
+ timestamp_override = "event.ingested"
109
+ type = "esql"
110
+
111
+ query = '''
112
+ FROM logs-azure.platformlogs-*, logs-azure.activitylogs-*, logs-aws.cloudtrail-*, logs-gcp.audit-* METADATA _id, _version, _index
113
+ | WHERE
114
+ (
115
+ /* AWS Secrets Manager */
116
+ (event.dataset == "aws.cloudtrail" AND event.provider == "secretsmanager.amazonaws.com" AND event.action == "GetSecretValue") OR
117
+ // Azure Key Vault (platform logs)
118
+ (event.dataset == "azure.platformlogs" AND event.action IN ("SecretGet", "KeyGet")) or
119
+ /* Azure Key Vault (activity logs) */
120
+ (event.dataset == "azure.activitylogs" AND azure.activitylogs.operation_name IN ("MICROSOFT.KEYVAULT/VAULTS/SECRETS/LIST", "MICROSOFT.KEYVAULT/VAULTS/SECRETS/GET")) OR
121
+ /* Azure Managed HSM secret */
122
+ (event.dataset == "azure.activitylogs" AND azure.activitylogs.operation_name LIKE "MICROSOFT.KEYVAULT/managedHSM/keys/*") OR
123
+ /* Google Secret Manager */
124
+ (event.dataset IN ("googlecloud.audit", "gcp.audit") AND
125
+ event.action IN ("google.cloud.secretmanager.v1.SecretManagerService.AccessSecretVersion", "google.cloud.secretmanager.v1.SecretManagerService.GetSecretRequest"))
126
+ ) AND source.ip IS NOT NULL
127
+ // Unified user identity (raw)
128
+ | EVAL Esql_priv.user_id =
129
+ COALESCE(
130
+ client.user.id,
131
+ aws.cloudtrail.user_identity.arn,
132
+ azure.platformlogs.identity.claim.upn,
133
+ NULL
134
+ )
135
+ // Cloud vendor label based on dataset
136
+ | EVAL Esql.cloud_vendor = CASE(
137
+ event.dataset == "aws.cloudtrail", "aws",
138
+ event.dataset IN ("azure.platformlogs","azure.activitylogs"), "azure",
139
+ event.dataset IN ("googlecloud.audit","gcp.audit"), "gcp",
140
+ "unknown"
141
+ )
142
+ // Vendor+tenant label, e.g. aws:123456789012, azure:tenant, gcp:project
143
+ | EVAL Esql.tenant_label = CASE(
144
+ Esql.cloud_vendor == "aws", CONCAT("aws:", cloud.account.id),
145
+ Esql.cloud_vendor == "azure", CONCAT("azure:", cloud.account.id),
146
+ Esql.cloud_vendor == "gcp", CONCAT("gcp:", cloud.account.id),
147
+ NULL
148
+ )
149
+ | STATS
150
+ // Core counts
151
+ Esql.events_count = COUNT(*),
152
+ Esql.vendor_count_distinct = COUNT_DISTINCT(Esql.cloud_vendor),
153
+ // Action & data source context
154
+ Esql.event_action_values = VALUES(event.action),
155
+ Esql.data_source_values = VALUES(event.dataset),
156
+ // Cloud vendor + tenant context
157
+ Esql.cloud_vendor_values = VALUES(Esql.cloud_vendor),
158
+ Esql.tenant_label_values = VALUES(Esql.tenant_label),
159
+ // Hyperscaler-specific IDs
160
+ Esql.aws_account_id_values = VALUES(CASE(Esql.cloud_vendor == "aws", cloud.account.id, NULL)),
161
+ Esql.azure_tenant_id_values = VALUES(CASE(Esql.cloud_vendor == "azure", cloud.account.id, NULL)),
162
+ Esql.gcp_project_id_values = VALUES(CASE(Esql.cloud_vendor == "gcp", cloud.account.id, NULL)),
163
+ // Generic cloud metadata
164
+ Esql.cloud_region_values = VALUES(cloud.region),
165
+ Esql.cloud_service_name_values = VALUES(cloud.service.name),
166
+ // Identity (privileged)
167
+ Esql_priv.user_values = VALUES(Esql_priv.user_id),
168
+ Esql_priv.client_user_id_values = VALUES(client.user.id),
169
+ Esql_priv.aws_user_identity_arn_values = VALUES(aws.cloudtrail.user_identity.arn),
170
+ Esql_priv.azure_upn_values = VALUES(azure.platformlogs.identity.claim.upn),
171
+ // Namespace values
172
+ Esql.data_stream_namespace_values = VALUES(data_stream.namespace)
173
+ BY source.ip
174
+ // Require multi-vendor cred-access from same source IP
175
+ | WHERE Esql.vendor_count_distinct >= 2
176
+ | SORT Esql.events_count DESC
177
+ | KEEP Esql.*, Esql_priv.*, source.ip
178
+ '''
179
+
180
+
181
+
182
+ [[rule.threat]]
183
+ framework = "MITRE ATT&CK"
184
+ [[rule.threat.technique]]
185
+ id = "T1555"
186
+ name = "Credentials from Password Stores"
187
+ reference = "https://attack.mitre.org/techniques/T1555/"
188
+ [[rule.threat.technique.subtechnique]]
189
+ id = "T1555.006"
190
+ name = "Cloud Secrets Management Stores"
191
+ reference = "https://attack.mitre.org/techniques/T1555/006/"
192
+
193
+
194
+
195
+ [rule.threat.tactic]
196
+ id = "TA0006"
197
+ name = "Credential Access"
198
+ reference = "https://attack.mitre.org/tactics/TA0006/"
@@ -1,8 +1,8 @@
1
1
  [metadata]
2
2
  creation_date = "2025/09/18"
3
- integration = ["endpoint"]
3
+ integration = ["endpoint", "windows", "system", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike", "auditd_manager"]
4
4
  maturity = "production"
5
- updated_date = "2025/11/25"
5
+ updated_date = "2025/11/26"
6
6
 
7
7
  [rule]
8
8
  author = ["Elastic"]
@@ -19,7 +19,19 @@ false_positives = [
19
19
  """,
20
20
  ]
21
21
  from = "now-9m"
22
- index = ["logs-endpoint.events.process-*"]
22
+ index = [
23
+ "endgame-*",
24
+ "logs-crowdstrike.fdr*",
25
+ "logs-endpoint.events.process-*",
26
+ "logs-m365_defender.event-*",
27
+ "logs-sentinel_one_cloud_funnel.*",
28
+ "logs-system.security*",
29
+ "logs-windows.forwarded*",
30
+ "logs-windows.sysmon_operational-*",
31
+ "winlogbeat-*",
32
+ "auditbeat-*",
33
+ "logs-auditd_manager.auditd-*"
34
+ ]
23
35
  language = "eql"
24
36
  license = "Elastic License v2"
25
37
  name = "Credential Access via TruffleHog Execution"
@@ -58,9 +70,9 @@ references = [
58
70
  "https://www.elastic.co/blog/shai-hulud-worm-npm-supply-chain-compromise",
59
71
  "https://socket.dev/blog/shai-hulud-strikes-again-v2",
60
72
  ]
61
- risk_score = 21
73
+ risk_score = 47
62
74
  rule_id = "47595dea-452b-4d37-b82d-6dd691325139"
63
- severity = "low"
75
+ severity = "medium"
64
76
  tags = [
65
77
  "Domain: Endpoint",
66
78
  "OS: Linux",
@@ -68,7 +80,14 @@ tags = [
68
80
  "OS: macOS",
69
81
  "Use Case: Threat Detection",
70
82
  "Tactic: Credential Access",
83
+ "Data Source: Elastic Endgame",
71
84
  "Data Source: Elastic Defend",
85
+ "Data Source: Windows Security Event Logs",
86
+ "Data Source: Microsoft Defender for Endpoint",
87
+ "Data Source: Sysmon",
88
+ "Data Source: SentinelOne",
89
+ "Data Source: Crowdstrike",
90
+ "Data Source: Auditd Manager",
72
91
  "Resources: Investigation Guide",
73
92
  ]
74
93
  timestamp_override = "event.ingested"
@@ -0,0 +1,120 @@
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 unusual modification of GenAI tool configuration files. Adversaries may inject malicious MCP server
11
+ configurations to hijack AI agents for persistence, C2, or data exfiltration. Attack vectors include malware or scripts
12
+ directly poisoning config files, supply chain attacks via compromised dependencies, and prompt injection attacks that
13
+ abuse the GenAI tool itself to modify its own configuration. Unauthorized MCP servers added to these configs execute
14
+ arbitrary commands when the AI tool is next invoked.
15
+ """
16
+ from = "now-9m"
17
+ index = ["logs-endpoint.events.file*"]
18
+ language = "kuery"
19
+ license = "Elastic License v2"
20
+ name = "Unusual Process Modifying GenAI Configuration File"
21
+ note = """## Triage and analysis
22
+
23
+ ### Investigating Unusual Process Modifying GenAI Configuration File
24
+
25
+ Configuration files for GenAI tools like Cursor, Claude, Copilot, and Ollama control which MCP servers, plugins, and extensions are loaded. Attackers target these files to inject malicious MCP servers that execute arbitrary commands, exfiltrate data, or establish persistence. Threats include external processes (malware, compromised scripts, supply chain attacks) directly modifying configs, as well as prompt injection attacks that abuse the AI tool's own file access capabilities.
26
+
27
+ ### Possible investigation steps
28
+
29
+ - Identify the process that modified the configuration file and determine if it's expected (GenAI tool, installer, user action) or suspicious (unknown script, malware).
30
+ - If the modifying process is NOT a GenAI tool, investigate its origin, parent process tree, and whether it was downloaded or executed from a suspicious location.
31
+ - If a GenAI tool made the modification, check recent user prompts or agent activity that may have triggered the config change via prompt injection.
32
+ - Review the contents of the modified configuration file for suspicious MCP server URLs, unauthorized plugins, or unusual agent permissions.
33
+ - Examine the process command line and parent process tree to identify how the modifying process was invoked.
34
+ - Check for other file modifications by the same process around the same time, particularly to other GenAI configs or startup scripts.
35
+ - Investigate whether the GenAI tool subsequently connected to unknown domains or spawned unusual child processes after the config change.
36
+
37
+ ### False positive analysis
38
+
39
+ - Novel but legitimate configuration changes will trigger this rule when the process/file combination hasn't been seen in 7 days. Review the modified file content to determine legitimacy.
40
+ - GenAI tool updates may modify config files in new ways; correlate with recent software updates.
41
+ - IDE extensions integrating with GenAI tools may modify configs as part of initial setup.
42
+
43
+ ### Response and remediation
44
+
45
+ - Review the modified configuration file and revert any unauthorized changes to MCP servers, plugins, or agent settings.
46
+ - If malicious MCP servers were added, block the associated domains at the network level.
47
+ - Review and rotate any API keys or credentials that may have been exposed through the compromised GenAI configuration.
48
+ """
49
+ references = [
50
+ "https://modelcontextprotocol.io/",
51
+ "https://www.cybereason.com/blog/security-research/weaponized-ai-how-cybercriminals-exploit-mcp-for-account-takeover",
52
+ "https://glama.ai/blog/2025-11-11-the-lethal-trifecta-securing-model-context-protocol-against-data-flow-attacks",
53
+ "https://www.elastic.co/security-labs/elastic-advances-llm-security",
54
+ ]
55
+ risk_score = 47
56
+ rule_id = "590fc62d-7386-4c75-92b0-af4517018da1"
57
+ severity = "medium"
58
+ tags = [
59
+ "Domain: Endpoint",
60
+ "OS: macOS",
61
+ "OS: Windows",
62
+ "Use Case: Threat Detection",
63
+ "Tactic: Defense Evasion",
64
+ "Tactic: Persistence",
65
+ "Data Source: Elastic Defend",
66
+ "Resources: Investigation Guide",
67
+ "Domain: LLM",
68
+ ]
69
+ timestamp_override = "event.ingested"
70
+ type = "new_terms"
71
+
72
+ query = '''
73
+ event.category : "file" and event.action : ("modification" or "overwrite") and
74
+ file.path : (
75
+ */.cursor/mcp.json or */.cursor/settings.json or */AppData/Roaming/Cursor/*mcp* or
76
+ */.claude/* or */claude_desktop_config.json or */AppData/Roaming/Claude/* or
77
+ */.config/github-copilot/* or */AppData/Local/GitHub?Copilot/* or
78
+ */.ollama/config* or */AppData/Local/Ollama/* or
79
+ */.codex/* or */AppData/Roaming/Codex/* or
80
+ */.gemini/* or */AppData/Roaming/gemini-cli/* or
81
+ */.grok/* or */AppData/Roaming/Grok/* or
82
+ */.windsurf/* or */AppData/Roaming/Windsurf/* or
83
+ */.vscode/extensions/*mcp*
84
+ )
85
+ '''
86
+
87
+
88
+ [[rule.threat]]
89
+ framework = "MITRE ATT&CK"
90
+ [[rule.threat.technique]]
91
+ id = "T1556"
92
+ name = "Modify Authentication Process"
93
+ reference = "https://attack.mitre.org/techniques/T1556/"
94
+
95
+
96
+ [rule.threat.tactic]
97
+ id = "TA0005"
98
+ name = "Defense Evasion"
99
+ reference = "https://attack.mitre.org/tactics/TA0005/"
100
+ [[rule.threat]]
101
+ framework = "MITRE ATT&CK"
102
+ [[rule.threat.technique]]
103
+ id = "T1554"
104
+ name = "Compromise Host Software Binary"
105
+ reference = "https://attack.mitre.org/techniques/T1554/"
106
+
107
+
108
+ [rule.threat.tactic]
109
+ id = "TA0003"
110
+ name = "Persistence"
111
+ reference = "https://attack.mitre.org/tactics/TA0003/"
112
+
113
+ [rule.new_terms]
114
+ field = "new_terms_fields"
115
+ value = ["process.executable"]
116
+ [[rule.new_terms.history_window_start]]
117
+ field = "history_window_start"
118
+ value = "now-7d"
119
+
120
+
@@ -0,0 +1,158 @@
1
+ [metadata]
2
+ creation_date = "2025/12/04"
3
+ integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "m365_defender", "auditd_manager"]
4
+ maturity = "production"
5
+ updated_date = "2025/12/04"
6
+
7
+ [rule]
8
+ author = ["Elastic"]
9
+ description = """
10
+ Detects when GenAI tools spawn compilers or packaging tools to generate executables. Attackers leverage local LLMs to
11
+ autonomously generate and compile malware, droppers, or implants. Python packaging tools (pyinstaller, nuitka, pyarmor)
12
+ are particularly high-risk as they create standalone executables that can be deployed without dependencies. This rule
13
+ focuses on compilation activity that produces output binaries, filtering out inspection-only operations.
14
+ """
15
+ from = "now-9m"
16
+ index = [
17
+ "logs-endpoint.events.process-*",
18
+ "logs-windows.sysmon_operational-*",
19
+ "logs-m365_defender.event-*",
20
+ "logs-sentinel_one_cloud_funnel.*",
21
+ "logs-auditd_manager.auditd-*",
22
+ ]
23
+ language = "eql"
24
+ license = "Elastic License v2"
25
+ name = "GenAI Process Compiling or Generating Executables"
26
+ note = """## Triage and analysis
27
+
28
+ ### Investigating GenAI Process Compiling or Generating Executables
29
+
30
+ This rule detects GenAI tools spawning compilers or packaging tools. While developers may use GenAI to write code that they then compile, autonomous compilation by GenAI processes is unusual.
31
+
32
+ ### Possible investigation steps
33
+
34
+ - Review the GenAI process that spawned the compiler to identify which tool is running and verify if it's an expected/authorized tool.
35
+ - Investigate the user account associated with the GenAI process to determine if this activity is expected for that user.
36
+ - Review the output files created by the compilation process to identify any malicious executables.
37
+ - Check for other alerts or suspicious activity on the same host around the same time.
38
+ - Verify if the GenAI tool is from a trusted source and if it's authorized for use in your environment.
39
+ - Identify whether the generated executables appear in temporary directories often used for malware staging (`%TEMP%`, `/tmp`, `.cache`).
40
+ - Inspect the compiled artifacts for networking imports, credential harvesting functionality, or persistence mechanisms.
41
+
42
+ ### False positive analysis
43
+
44
+ - Legitimate development workflows that use GenAI tools for code generation may trigger this rule if they compile the generated code.
45
+ - Some GenAI-assisted coding IDEs (Cursor, Copilot Workspace) may run compilation tasks when testing code; confirm whether the behavior is tied to developer workflow.
46
+
47
+ ### Response and remediation
48
+
49
+ - Terminate the GenAI process and any spawned compiler processes to stop the malicious activity.
50
+ - Investigate the compiled executables to determine if they are malicious.
51
+ - Review audit logs to determine the scope of compilation activity and identify any executables that may have been created.
52
+ - Quarantine any compiled binaries; submit suspicious artifacts to sandbox or malware analysis.
53
+ """
54
+ references = [
55
+ "https://atlas.mitre.org/techniques/AML.T0053",
56
+ "https://www.elastic.co/security-labs/elastic-advances-llm-security",
57
+ ]
58
+ risk_score = 47
59
+ rule_id = "b2c3d4e5-f6a7-8901-bcde-f123456789ab"
60
+ severity = "medium"
61
+ tags = [
62
+ "Domain: Endpoint",
63
+ "OS: Linux",
64
+ "OS: macOS",
65
+ "OS: Windows",
66
+ "Use Case: Threat Detection",
67
+ "Tactic: Execution",
68
+ "Tactic: Defense Evasion",
69
+ "Data Source: Elastic Defend",
70
+ "Data Source: Sysmon",
71
+ "Data Source: Auditd Manager",
72
+ "Data Source: Microsoft Defender for Endpoint",
73
+ "Data Source: SentinelOne",
74
+ "Resources: Investigation Guide",
75
+ "Domain: LLM",
76
+ "Mitre Atlas: T0053",
77
+ ]
78
+ timestamp_override = "event.ingested"
79
+ type = "eql"
80
+
81
+ query = '''
82
+ process where event.type == "start" and
83
+
84
+ // GenAI parent process
85
+ (
86
+ process.parent.name in (
87
+ "ollama.exe", "ollama", "Ollama",
88
+ "textgen.exe", "textgen", "text-generation-webui.exe", "oobabooga.exe",
89
+ "lmstudio.exe", "lmstudio", "LM Studio",
90
+ "claude.exe", "claude", "Claude",
91
+ "cursor.exe", "cursor", "Cursor", "Cursor Helper", "Cursor Helper (Plugin)",
92
+ "copilot.exe", "copilot", "Copilot",
93
+ "codex.exe", "codex",
94
+ "Jan", "jan.exe", "jan", "Jan Helper",
95
+ "gpt4all.exe", "gpt4all", "GPT4All",
96
+ "gemini-cli.exe", "gemini-cli",
97
+ "genaiscript.exe", "genaiscript",
98
+ "grok.exe", "grok",
99
+ "qwen.exe", "qwen",
100
+ "koboldcpp.exe", "koboldcpp", "KoboldCpp",
101
+ "llama-server", "llama-cli"
102
+ ) or
103
+
104
+ // Node/Deno with GenAI frameworks
105
+ (process.parent.name in ("node.exe", "node", "deno.exe", "deno") and
106
+ process.parent.command_line like~ ("*mcp-server*", "*@modelcontextprotocol*", "*langchain*", "*autogpt*", "*babyagi*", "*agentgpt*", "*crewai*", "*semantic-kernel*", "*llama-index*", "*haystack*")) or
107
+
108
+ // Python with GenAI frameworks
109
+ (process.parent.name like~ "python*" and
110
+ process.parent.command_line like~ ("*langchain*", "*autogpt*", "*babyagi*", "*agentgpt*", "*crewai*", "*semantic-kernel*", "*llama-index*", "*haystack*"))
111
+ ) and
112
+
113
+ // Compilation tools
114
+ (
115
+ // Python packaging
116
+ process.name in ("pyinstaller", "py2exe", "cx_Freeze", "nuitka", "pyarmor", "pkg") or
117
+
118
+ // C/C++ compilation with output
119
+ (process.name in ("gcc", "g++", "clang", "clang++", "cl.exe") and
120
+ process.command_line like~ "*-o *" and
121
+ process.command_line like~ ("*.c *", "*.c", "*.cpp *", "*.cpp", "*.cc *", "*.cc", "*.m *", "*.m") and
122
+ not process.command_line like~ "*git*") or
123
+
124
+ // Go compilation
125
+ (process.name == "go" and process.args == "build") or
126
+
127
+ // Rust compilation
128
+ (process.name == "cargo" and process.args == "build") or
129
+ (process.name == "rustc" and process.command_line like~ "*-o *") or
130
+
131
+ // .NET compilation
132
+ process.name in ("csc.exe", "vbc.exe", "msbuild.exe") or
133
+ (process.name == "dotnet" and process.args == "build") or
134
+
135
+ // Java compilation
136
+ process.name == "javac"
137
+ )
138
+ '''
139
+
140
+
141
+ [[rule.threat]]
142
+ framework = "MITRE ATT&CK"
143
+ [[rule.threat.technique]]
144
+ id = "T1027"
145
+ name = "Obfuscated Files or Information"
146
+ reference = "https://attack.mitre.org/techniques/T1027/"
147
+ [[rule.threat.technique.subtechnique]]
148
+ id = "T1027.004"
149
+ name = "Compile After Delivery"
150
+ reference = "https://attack.mitre.org/techniques/T1027/004/"
151
+
152
+
153
+
154
+ [rule.threat.tactic]
155
+ id = "TA0005"
156
+ name = "Defense Evasion"
157
+ reference = "https://attack.mitre.org/tactics/TA0005/"
158
+