Detection rules › Elastic

Elastic rules: 1y

Application Removed from Blocklist in Google Workspace

#
Status
production
Severity
medium
Time window
130m
Author
Elastic
Source
github.com/elastic/detection-rules

Google Workspace administrators may be aware of malicious applications within the Google marketplace and block these applications for user security purposes. An adversary, with administrative privileges, may remove this application from the explicit block list to allow distribution of the application amongst users. This may also indicate the unauthorized use of an application that had been previously blocked before by a user with admin privileges.

Known False Positives

  • Applications can be added and removed from blocklists by Google Workspace administrators. Verify that the configuration change was expected. Exceptions can be added to this rule to filter expected behavior.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2022/08/25"
integration = ["google_workspace"]
maturity = "production"
updated_date = "2026/05/28"

[rule]
author = ["Elastic"]
description = """
Google Workspace administrators may be aware of malicious applications within the Google marketplace and block these
applications for user security purposes. An adversary, with administrative privileges, may remove this application from
the explicit block list to allow distribution of the application amongst users. This may also indicate the unauthorized
use of an application that had been previously blocked before by a user with admin privileges.
"""
false_positives = [
    """
    Applications can be added and removed from blocklists by Google Workspace administrators. Verify that the
    configuration change was expected. Exceptions can be added to this rule to filter expected behavior.
    """,
]
from = "now-130m"
index = ["filebeat-*", "logs-google_workspace.admin-*"]
interval = "10m"
language = "kuery"
license = "Elastic License v2"
name = "Application Removed from Blocklist in Google Workspace"
note = """## Triage and analysis

### Investigating Application Removed from Blocklist in Google Workspace

Google Workspace Marketplace is an online store for free and paid web applications that work with Google Workspace services and third-party software. Listed applications are based on Google APIs or Google Apps Script and created by both Google and third-party developers.

Marketplace applications require access to specific Google Workspace resources. Individual users with the appropriate permissions can install applications in their Google Workspace domain. Administrators have additional permissions that allow them to install applications for an entire Google Workspace domain. Consent screens typically display permissions and privileges the user needs to install an application. As a result, malicious Marketplace applications may require more permissions than necessary or have malicious intent.

Google clearly states that they are not responsible for any Marketplace product that originates from a source that isn't Google.

This rule identifies a Marketplace blocklist update that consists of a Google Workspace account with administrative privileges manually removing a previously blocked application.

### Possible investigation steps

- Identify the associated user accounts by reviewing `user.name` or `user.email` fields in the alert.
- Review `google_workspace.admin.old_value` and `google_workspace.admin.new_value` to confirm the app moved from blocked to allowed and note the affected organizational unit (`google_workspace.admin.org_unit.name`).
- This rule relies on data from `google_workspace.admin`, thus indicating the associated user has administrative privileges to the Marketplace.
- With access to the Google Workspace admin console, visit the `Security > Investigation` tool with filters for the user email and event is `Assign Role` or `Update Role` to determine if new cloud roles were recently updated.
- After identifying the involved user account, review other potentially related events within the last 48 hours.
- Re-assess the permissions and reviews of the Marketplace applications to determine if they violate organizational policies or introduce unexpected risks.
- With access to the Google Workspace admin console, determine if the application was installed domain-wide or individually by visiting `Apps > Google Workspace Marketplace apps > Apps list`.

### False positive analysis

- Google Workspace administrators might intentionally remove an application from the blocklist due to a re-assessment or a domain-wide required need for the application.
- Identify the user account associated with this action and assess their administrative privileges with Google Workspace Marketplace.
- Contact the user to verify that they intentionally removed the application from the blocklist and their reasoning.

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Disable or limit the account during the investigation and response.
- Identify the possible impact of the incident and prioritize accordingly; the following actions can help you gain context:
    - Identify the account role in the cloud environment.
    - Assess the criticality of affected services and servers.
    - Work with your IT team to identify and minimize the impact on users.
    - Identify if the attacker is moving laterally and compromising other accounts, servers, or services.
    - Identify any regulatory or legal ramifications related to this activity.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords or delete API keys as needed to revoke the attacker's access to the environment. Work with your IT teams to minimize the impact on business operations during these actions.
- Review the permissions assigned to the implicated user to ensure that the least privilege principle is being followed.
- Implement security best practices [outlined](https://support.google.com/a/answer/7587183) by Google.
- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).

## Setup

The Google Workspace Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule.

### Important Information Regarding Google Workspace Event Lag Times
- As per Google's documentation, Google Workspace administrators may observe lag times ranging from minutes up to 3 days between the time of an event's occurrence and the event being visible in the Google Workspace admin/audit logs.
- This rule is configured to run every 10 minutes with a lookback time of 130 minutes.
- To reduce the risk of false negatives, consider reducing the interval that the Google Workspace (formerly G Suite) Filebeat module polls Google's reporting API for new events.
- By default, `var.interval` is set to 2 hours (2h). Consider changing this interval to a lower value, such as 10 minutes (10m).
- See the following references for further information:
  - https://support.google.com/a/answer/7061566
  - https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-module-google_workspace.html"""
references = [
    "https://support.google.com/a/answer/6328701?hl=en#",
    "https://www.elastic.co/security-labs/google-workspace-attack-surface-part-one",
    "https://www.elastic.co/security-labs/google-workspace-attack-surface-part-two"
]
risk_score = 47
rule_id = "495e5f2e-2480-11ed-bea8-f661ea17fbce"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Data Source: Google Workspace",
    "Use Case: Configuration Audit",
    "Resources: Investigation Guide",
    "Tactic: Defense Evasion",
]
timestamp_override = "event.ingested"
type = "query"

query = '''
data_stream.dataset:"google_workspace.admin" and
  event.action:"CHANGE_APPLICATION_SETTING" and
  google_workspace.admin.application.name:"Google Workspace Marketplace" and
  google_workspace.admin.old_value: *allowed*false* and google_workspace.admin.new_value: *allowed*true*
'''

[rule.investigation_fields]
field_names = [
    "source.ip",
    "user.name",
    "user.email",
    "event.action",
    "google_workspace.admin.org_unit.name",
    "google_workspace.admin.setting.name",
    "google_workspace.admin.old_value",
    "google_workspace.admin.new_value",
]


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1484"
name = "Domain or Tenant Policy Modification"
reference = "https://attack.mitre.org/techniques/T1484/"

[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"

[[rule.threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

Stages and Predicates

Stage 1: query

data_stream.dataset:"google_workspace.admin" and
  event.action:"CHANGE_APPLICATION_SETTING" and
  google_workspace.admin.application.name:"Google Workspace Marketplace" and
  google_workspace.admin.old_value: *allowed*false* and google_workspace.admin.new_value: *allowed*true*

Indicators

These rows show field, operator, and value matches.

AWS GetFederationToken Followed by Console Login via Federation Exchange

#
Status
production
Severity
high
Time window
2m
Sequence by
source.ip
Author
Elastic
Source
github.com/elastic/detection-rules

Detects the three-event chain produced by tools like aws_consoler that convert exfiltrated long-term IAM access keys into browser-accessible AWS console sessions: GetFederationToken obtains temporary credentials, GetSigninToken exchanges them for a federation sign-in token via the AWS federation endpoint, and ConsoleLogin confirms the resulting console session was opened — all from the same source IP within two minutes. This sequence is a high-confidence indicator of credential abuse using stolen IAM access keys.

Known False Positives

  • Legacy federation broker applications that call GetFederationToken and immediately redirect users to a console session from the same host may trigger this rule. Validate the source IP against known application server infrastructure and confirm the federation architecture is documented.

MITRE ATT&CK Coverage

TacticTechniques
Credential Access

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2026/08/14"
integration = ["aws"]
maturity = "production"
updated_date = "2026/08/14"

[rule]
author = ["Elastic"]
description = """
Detects the three-event chain produced by tools like aws_consoler that convert exfiltrated
long-term IAM access keys into browser-accessible AWS console sessions: GetFederationToken
obtains temporary credentials, GetSigninToken exchanges them for a federation sign-in token
via the AWS federation endpoint, and ConsoleLogin confirms the resulting console session was
opened — all from the same source IP within two minutes. This sequence is a high-confidence
indicator of credential abuse using stolen IAM access keys.
"""
false_positives = [
    """
    Legacy federation broker applications that call GetFederationToken and immediately redirect
    users to a console session from the same host may trigger this rule. Validate the source IP
    against known application server infrastructure and confirm the federation architecture is
    documented.
    """,
]
from = "now-6m"
index = ["logs-aws.cloudtrail-*"]
language = "eql"
license = "Elastic License v2"
name = "AWS GetFederationToken Followed by Console Login via Federation Exchange"
note = """## Triage and analysis

### Investigating AWS GetFederationToken Followed by Console Login via Federation Exchange

This rule detects the aws_consoler attack chain: an adversary exfiltrates a long-term IAM access key (AKIA* prefix), runs aws_consoler or equivalent tooling, which calls `GetFederationToken` to obtain temporary credentials and then exchanges them at the AWS federation endpoint (`https://signin.amazonaws.com/federation`) for a signed console URL. Opening that URL triggers a `ConsoleLogin` event from the same source IP, completing the sequence.

The source IP correlation distinguishes this pattern from coincidental federation activity: both the API call and the browser-based console login originate from the same attacker machine in automated tooling scenarios.

### Possible investigation steps

- Identify the IAM user from `aws.cloudtrail.user_identity.arn` in the first event and confirm whether this user and access key are expected to call `GetFederationToken`.
- Review `source.ip` against known infrastructure. A call from an unexpected geography or cloud provider IP range is a strong indicator of exfiltrated key abuse.
- Query CloudTrail for all API calls made during the resulting console session (user identity type `FederatedUser`) in the window following the `ConsoleLogin`.
- Check GitHub, GitLab, CI/CD pipelines, and `.env` files for exposure of the access key.
- Determine whether any sensitive resources were accessed or modified during the console session.

### Response and remediation

- Immediately deactivate the long-term access key used in the `GetFederationToken` call.
- Revoke all active sessions for the IAM user.
- Review all actions taken during the federated console session and assess blast radius.
- Rotate all credentials associated with the IAM user.
- Migrate any legitimate federation use cases to IAM Identity Center or AssumeRoleWithWebIdentity.
"""
references = [
    "https://docs.aws.amazon.com/STS/latest/APIReference/API_GetFederationToken.html",
    "https://github.com/NetSPI/aws_consoler",
    "https://www.netspi.com/blog/technical-blog/cloud-pentesting/gaining-aws-console-access-via-api-keys/",
    "https://securitylabs.datadoghq.com/cloud-security-atlas/attacks/accessing-the-aws-console-with-getfederationtoken/"
]
risk_score = 73
rule_id = "065a9a1b-9e48-45a1-8fa5-72373245847c"
setup = "The AWS integration must be ingesting management events into `logs-aws.cloudtrail-*`. STS and sign-in management events are logged by default."
severity = "high"
tags = [
    "Domain: Cloud",
    "Platform: AWS",
    "Data Source: AWS",
    "Data Source: Amazon Web Services",
    "Data Source: AWS CloudTrail",
    "Service: AWS STS",
    "Service: AWS Sign-In",
    "Rule Type: Event Correlation (EQL)",
    "Tactic: Credential Access",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
sequence by source.ip with maxspan=2m
  [any where event.provider == "sts.amazonaws.com"
   and event.action == "GetFederationToken"
   and event.outcome == "success"]
  [any where event.provider == "signin.amazonaws.com"
   and event.action == "GetSigninToken"
   and event.outcome == "success"]
  [any where event.provider == "signin.amazonaws.com"
   and event.action == "ConsoleLogin"
   and event.outcome == "success"]
'''

[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1606"
name = "Forge Web Credentials"
reference = "https://attack.mitre.org/techniques/T1606/"

[rule.threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "aws.cloudtrail.user_identity.arn",
    "aws.cloudtrail.user_identity.type",
    "aws.cloudtrail.user_identity.access_key_id",
    "user.name",
    "event.provider",
    "event.action",
    "event.outcome",
    "source.ip",
    "source.as.organization.name",
    "cloud.region",
    "cloud.account.id",
]

Stages and Predicates

Ordered sequence: each step below must occur in order within 2m, correlated by source.ip.

Stage 1: any

[any where event.provider == "sts.amazonaws.com"
   and event.action == "GetFederationToken"
   and event.outcome == "success"]

Stage 2: any

[any where event.provider == "signin.amazonaws.com"
   and event.action == "GetSigninToken"
   and event.outcome == "success"]

Stage 3: any

[any where event.provider == "signin.amazonaws.com"
   and event.action == "ConsoleLogin"
   and event.outcome == "success"]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • ConsoleLogin corpus 2 (elastic 2)
  • GetFederationToken
  • GetSigninToken
field:"EventType" kind:eq
event.outcomeeq
  • success corpus 82 (elastic 82)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • signin.amazonaws.com corpus 3 (elastic 3)
  • sts.amazonaws.com
field:"Provider_Name" kind:eq

AWS RDS DB Instance or Cluster Deletion Protection Disabled

#
Status
production
Severity
medium
Time window
6m
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies the modification of an AWS RDS DB instance or cluster to disable the deletionProtection feature. Deletion protection prevents accidental or unauthorized deletion of RDS resources. Adversaries with sufficient permissions may disable this protection as a precursor to destructive actions, including the deletion of databases containing sensitive or business-critical data. This rule alerts when deletionProtection is explicitly set to false on an RDS DB instance or cluster.

Known False Positives

  • The deletionProtection feature must be disabled as a prerequisite for deletion of a DB instance or cluster. Ensure that the instance should not be modified in this way before taking action.

MITRE ATT&CK Coverage

Telemetry Coverage

Rules Detecting the Same Action

These rules filter on the same operation.

Rule Body

[metadata]
creation_date = "2024/06/28"
integration = ["aws"]
maturity = "production"
updated_date = "2026/08/05"

[rule]
author = ["Elastic"]
description = """
Identifies the modification of an AWS RDS DB instance or cluster to disable the deletionProtection feature. Deletion
protection prevents accidental or unauthorized deletion of RDS resources. Adversaries with sufficient permissions may
disable this protection as a precursor to destructive actions, including the deletion of databases containing sensitive
or business-critical data. This rule alerts when deletionProtection is explicitly set to false on an RDS DB instance or
cluster.
"""
false_positives = [
    """
    The deletionProtection feature must be disabled as a prerequisite for deletion of a DB instance or cluster. Ensure
    that the instance should not be modified in this way before taking action.
    """,
]
from = "now-6m"
index = ["filebeat-*", "logs-aws.cloudtrail-*"]
language = "eql"
license = "Elastic License v2"
name = "AWS RDS DB Instance or Cluster Deletion Protection Disabled"
note = """## Triage and analysis

### Investigating AWS RDS DB Instance or Cluster Deletion Protection Disabled
 
Deletion protection is designed to safeguard RDS DB instances and clusters from accidental or unauthorized deletion. An adversary with privileged access in a compromised environment, can disable this safeguard before issuing a `DeleteDBInstance` or `DeleteDBCluster` action. This rule detects successful attempts to modify deletionProtection and set it to false on any RDS instance or cluster.

#### Possible investigation steps

- **Identify the Actor**
  - Review `aws.cloudtrail.user_identity.arn`, `aws.cloudtrail.user_identity.type`, and `access_key_id` to determine which IAM principal made the change.
  - Validate whether this principal normally performs RDS lifecycle operations.

- **Review Event Details**
  - Inspect `aws.cloudtrail.request_parameters` to confirm the targeted DB instance or cluster identifier.
  - Confirm that the request explicitly contains `deletionProtection=false`.

- **Contextualize the Change**
  - Determine if recent activities justify the removal of deletion protection (migration, decommissioning, or maintenance).
  - Compare the timestamp to normal operational hours or deployment windows.

- **Correlate with Additional Activity**
  - Look for subsequent or preceding RDS actions such as:
    - `DeleteDBInstance`
    - `DeleteDBCluster`
    - Security group modifications
    - Changes to parameter groups or backup retention policies.
  - Sudden removal of backups or snapshots may indicate imminent destructive activity.

- **Verify Environmental Risk**
  - Assess the sensitivity of data stored in the affected DB instance or cluster.
  - Determine if the instance is production, customer-facing, or mission-critical.

- **Interview Relevant Personnel**
  - Confirm with service owners or DB administrators whether the modification was intended and approved.

### False positive analysis

- **Expected Decommissioning**
  - Instances undergoing teardown or migration legitimately require deletion protection to be disabled first.

- **Inconsistent Historical Behavior**
  - Compare the action to historical modification patterns for the user or role. If the action aligns with past legitimate changes, it may not be suspicious.

### Response and remediation

- **Immediate Remediation**
  - If unauthorized, re-enable deletion protection (`deletionProtection=true`) on the affected DB instance or cluster.
  - Review security groups, backup retention, and snapshot policies for additional unauthorized changes.

- **Access Review**
  - Investigate credential exposure for the IAM principal that performed the action.
  - Rotate access keys or temporarily revoke permissions if compromise is suspected.

- **Containment**
  - If destructive intent is suspected, apply guardrails (e.g., IAM condition keys, SCPs) to prevent DB deletion.

- **Audit and Harden**
  - Ensure RDS instances adhere to least-privilege principles.
  - Restrict who can modify `ModifyDBInstance` or `ModifyDBCluster` destructive settings, such as deletion protection, backup retention, and public accessibility.

- **Incident Response Activation**
  - Treat unauthorized removal of deletion protection as a high-risk precursor to data destruction.
  - Trigger IR processes for containment, root cause analysis, and post-incident hardening.

### Additional information

- **[AWS IR Playbooks](https://github.com/aws-samples/aws-incident-response-playbooks/blob/c151b0dc091755fffd4d662a8f29e2f6794da52c/playbooks/)** 
- **[AWS Customer Playbook Framework](https://github.com/aws-samples/aws-customer-playbook-framework/tree/a8c7b313636b406a375952ac00b2d68e89a991f2/docs)** 
- **Security Best Practices:** [AWS Knowledge Center – Security Best Practices](https://aws.amazon.com/premiumsupport/knowledge-center/security-best-practices/).
"""
references = [
    "https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_ModifyDBInstance.html",
    "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html",
]
risk_score = 47
rule_id = "f6652fb5-cd8e-499c-8311-2ce2bb6cac62"
severity = "medium"
tags = [
    "Domain: Cloud",
    "Platform: AWS",
    "Data Source: AWS CloudTrail",
    "Service: AWS RDS",
    "Tactic: Impact",
    "Rule Type: Event Correlation (EQL)",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
any where data_stream.dataset == "aws.cloudtrail"
    and event.provider == "rds.amazonaws.com"
    and event.action in ("ModifyDBInstance", "ModifyDBCluster")
    and event.outcome == "success"
    and stringContains(aws.cloudtrail.request_parameters, "deletionProtection=false")
    and not user_agent.original like~ ("*Terraform*", "*Pulumi*")
'''


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1485"
name = "Data Destruction"
reference = "https://attack.mitre.org/techniques/T1485/"

[rule.threat.tactic]
id = "TA0040"
name = "Impact"
reference = "https://attack.mitre.org/tactics/TA0040/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1578"
name = "Modify Cloud Compute Infrastructure"
reference = "https://attack.mitre.org/techniques/T1578/"

[[rule.threat.technique.subtechnique]]
id = "T1578.005"
name = "Modify Cloud Compute Configurations"
reference = "https://attack.mitre.org/techniques/T1578/005/"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[rule.investigation_fields]
field_names = [
    "@timestamp",
    "user.name",
    "user_agent.original",
    "source.ip",
    "aws.cloudtrail.user_identity.arn",
    "aws.cloudtrail.user_identity.type",
    "aws.cloudtrail.user_identity.access_key_id",
    "event.action",
    "event.outcome",
    "cloud.account.id",
    "cloud.region",
    "aws.cloudtrail.request_parameters",
    "aws.cloudtrail.response_elements",
]

Stages and Predicates

Stage 1: any

any where data_stream.dataset == "aws.cloudtrail"
    and event.provider == "rds.amazonaws.com"
    and event.action in ("ModifyDBInstance", "ModifyDBCluster")
    and event.outcome == "success"
    and stringContains(aws.cloudtrail.request_parameters, "deletionProtection=false")
    and not user_agent.original like~ ("*Terraform*", "*Pulumi*")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
aws.cloudtrail.request_parameterscontains
  • deletionProtection=false
field:"aws::requestParameters" kind:contains value:"deletionProtection=false"
data_stream.dataseteq
  • aws.cloudtrail corpus 40 (elastic 40)
field:"data_stream.dataset" kind:eq value:"aws.cloudtrail"
event.actionin
  • ModifyDBCluster corpus 2 (elastic 2)
  • ModifyDBInstance corpus 2 (elastic 2)
field:"EventType" kind:in
event.outcomeeq
  • success corpus 82 (elastic 82)
field:"event.outcome" kind:eq value:"success"
event.providereq
  • rds.amazonaws.com corpus 5 (elastic 5)
field:"Provider_Name" kind:eq value:"rds.amazonaws.com"

Exclusions

The rule actively suppresses these predicates.

Connection to External Network via Telnet

#
Status
production
Severity
medium
Sequence by
process.entity_id
Author
Elastic
Source
github.com/elastic/detection-rules

Telnet provides a command line interface for communication with a remote device or server. This rule identifies Telnet network connections to publicly routable IP addresses.

Known False Positives

  • Telnet can be used for both benign or malicious purposes. Telnet is included by default in some Linux distributions, so its presence is not inherently suspicious. The use of Telnet to manage devices remotely has declined in recent years in favor of more secure protocols such as SSH. Telnet usage by non-automated tools or frameworks may be suspicious.

MITRE ATT&CK Coverage

TacticTechniques
Lateral Movement
Command & Control

Rule Body

[metadata]
creation_date = "2020/04/23"
integration = ["endpoint", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
Telnet provides a command line interface for communication with a remote device or server. This rule identifies Telnet
network connections to publicly routable IP addresses.
"""
false_positives = [
    """
    Telnet can be used for both benign or malicious purposes. Telnet is included by default in some Linux distributions,
    so its presence is not inherently suspicious. The use of Telnet to manage devices remotely has declined in recent
    years in favor of more secure protocols such as SSH. Telnet usage by non-automated tools or frameworks may be
    suspicious.
    """,
]
from = "now-9m"
index = ["logs-endpoint.events.network*", "logs-endpoint.events.process*", "logs-sentinel_one_cloud_funnel.*"]
language = "eql"
license = "Elastic License v2"
name = "Connection to External Network via Telnet"
note = """## Triage and analysis

> **Disclaimer**:
> 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.

### Investigating Connection to External Network via Telnet

Telnet is a protocol offering a command-line interface for remote communication, often used for device management. However, its lack of encryption makes it vulnerable to interception, allowing adversaries to exploit it for unauthorized access or data exfiltration. The detection rule identifies Telnet connections to external IPs, flagging potential lateral movement by excluding known internal and reserved IP ranges.

### Possible investigation steps

- Review the alert details to identify the specific process.entity_id and destination IP address involved in the Telnet connection.
- Verify the legitimacy of the destination IP address by checking if it belongs to a known or trusted external entity, using threat intelligence sources or IP reputation services.
- Investigate the process details associated with the process.entity_id to determine the user account and command line arguments used during the Telnet session.
- Check the system logs and user activity on the host to identify any unusual behavior or unauthorized access attempts around the time of the Telnet connection.
- Assess whether the Telnet connection aligns with expected business operations or if it indicates potential lateral movement or data exfiltration attempts.

### False positive analysis

- Internal device management using Telnet may trigger false positives if the destination IPs are not included in the known internal ranges. Users should verify and update the list of internal IP ranges to include any additional internal networks used for legitimate Telnet connections.
- Automated scripts or monitoring tools that use Telnet for legitimate purposes can cause false positives. Identify these scripts and consider creating exceptions for their specific IP addresses or process names to prevent unnecessary alerts.
- Testing environments that simulate external connections for development purposes might be flagged. Ensure that IP addresses used in these environments are documented and excluded from the detection rule to avoid false positives.
- Legacy systems that rely on Telnet for communication with external partners or services may be mistakenly flagged. Review these systems and, if deemed secure, add their IP addresses to an exception list to reduce false alerts.
- Misconfigured network devices that inadvertently use Telnet for external communication can trigger alerts. Regularly audit network configurations and update the detection rule to exclude known benign IPs associated with these devices.

### Response and remediation

- Immediately isolate the affected Linux host from the network to prevent further unauthorized access or data exfiltration.
- Terminate any active Telnet sessions on the affected host to stop ongoing malicious activity.
- Conduct a thorough review of the affected system's logs and processes to identify any unauthorized changes or additional compromised accounts.
- Change all passwords associated with the affected system and any other systems that may have been accessed using Telnet.
- Apply security patches and updates to the affected system to address any vulnerabilities that may have been exploited.
- Implement network segmentation to limit Telnet access to only necessary internal systems and block Telnet traffic to external networks.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected."""
references = ["https://www.iana.org/assignments/iana-ipv4-special-registry/iana-ipv4-special-registry.xhtml"]
risk_score = 47
rule_id = "e19e64ee-130e-4c07-961f-8a339f0b8362"
setup = """## Setup

This rule requires data coming in from one of the following integrations:
- Elastic Defend
- Auditbeat

### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.

#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).

#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- 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.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).

### Auditbeat Setup
Auditbeat is a lightweight shipper that you can install on your servers to audit the activities of users and processes on your systems. For example, you can use Auditbeat to collect and centralize audit events from the Linux Audit Framework. You can also use Auditbeat to detect changes to critical files, like binaries and configuration files, and identify potential security policy violations.

#### The following steps should be executed in order to add the Auditbeat on a Linux System:
- Elastic provides repositories available for APT and YUM-based distributions. Note that we provide binary packages, but no source packages.
- To install the APT and YUM repositories follow the setup instructions in this [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setup-repositories.html).
- To run Auditbeat on Docker follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-docker.html).
- To run Auditbeat on Kubernetes follow the setup instructions in the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/running-on-kubernetes.html).
- For complete “Setup and Run Auditbeat” information refer to the [helper guide](https://www.elastic.co/guide/en/beats/auditbeat/current/setting-up-and-running.html).
"""
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Lateral Movement",
    "Data Source: Elastic Defend",
    "Data Source: SentinelOne",
    "Resources: Investigation Guide",
]
type = "eql"
query = '''
sequence by process.entity_id
  [process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "start") and process.name == "telnet"]
  [network where host.os.type == "linux" and process.name == "telnet" and not cidrmatch(
     destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
     "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
     "192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
     "192.175.48.0/24", "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
     "FF00::/8"
    )
  ]
'''

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1021"
name = "Remote Services"
reference = "https://attack.mitre.org/techniques/T1021/"

[rule.threat.tactic]
id = "TA0008"
name = "Lateral Movement"
reference = "https://attack.mitre.org/tactics/TA0008/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"

[rule.threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

Stages and Predicates

Ordered sequence: each step below must occur in order, correlated by process.entity_id.

Stage 1: process

[process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "start") and process.name == "telnet"]

Stage 2: network

[network where host.os.type == "linux" and process.name == "telnet" and not cidrmatch(
     destination.ip, "10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
     "192.0.0.8/32", "192.0.0.9/32", "192.0.0.10/32", "192.0.0.170/32", "192.0.0.171/32", "192.0.2.0/24",
     "192.31.196.0/24", "192.52.193.0/24", "192.168.0.0/16", "192.88.99.0/24", "224.0.0.0/4", "100.64.0.0/10",
     "192.175.48.0/24", "198.18.0.0/15", "198.51.100.0/24", "203.0.113.0/24", "240.0.0.0/4", "::1", "FE80::/10",
     "FF00::/8"
    )
  ]

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
destination.ipcidr_match10.0.0.0/8, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.0.0/29, 192.0.0.8/32, 192.0.0.9/32, 192.0.0.10/32, 192.0.0.170/32, 192.0.0.171/32, 192.0.2.0/24, 192.31.196.0/24, 192.52.193.0/24, 192.168.0.0/16, 192.88.99.0/24, 224.0.0.0/4, 100.64.0.0/10, 192.175.48.0/24, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 240.0.0.0/4, ::1, FE80::/10, FF00::/8excludes:destination.ip

Execution of a downloaded executable with low or unknown reputation

#
Time window
5m
Source
github.com/elastic/protections-artifacts

Identifies Windows executable files that have been recently downloaded and have an unknown or malicious reputation. Attackers may rely upon a user downloading and opening a file in order for their malicious code to execute and gain initial access to an endpoint. Users may be subjected to social engineering to get them to open a file that will lead to code execution.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies Windows executable files that have been recently downloaded and have an unknown or malicious reputation.
Attackers may rely upon a user downloading and opening a file in order for their malicious code to execute and gain
initial access to an endpoint. Users may be subjected to social engineering to get them to open a file that will lead to
code execution.
"""
id = "90912b6c-fc36-4e13-83c2-469e6b60e915"
license = "Elastic License v2"
name = "Execution of a downloaded executable with low or unknown reputation"
os_list = ["windows"]
version = "1.0.3"

query = '''
sequence with maxspan=5m
 [file where event.action == "creation" and file.Ext.windows.zone_identifier >= 3 and
  file.origin_url regex~ """https?:[\/\\]{2}[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}[\/\\]{1}.*"""] as event0
 [process where event.action == "start" and
  (process.code_signature.trusted == false or process.code_signature.exists == false) and
  not process.code_signature.status like "errorCode_endpoint*" and startswith~(event0.file.name, process.name)]
'''

min_endpoint_version = "8.15.0"
reputation = true
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"
[[threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[internal]
min_endpoint_version = "8.15.0"

Stages and Predicates

Stage 1: file

[file where event.action == "creation" and file.Ext.windows.zone_identifier >= 3 and
  file.origin_url regex~ """https?:[\/\\]{2}[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}[\/\\]{1}.*"""] as event0

Stage 2: process

[process where event.action == "start" and
  (process.code_signature.trusted == false or process.code_signature.exists == false) and
  not process.code_signature.status like "errorCode_endpoint*" and startswith~(event0.file.name, process.name)]

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.statusstarts_witherrorCode_endpointexcludes:process.code_signature.status field:"process.code_signature.status" value:"errorCode_endpoint"

Execution of an Unsigned Service

#
Status
production
Kind
building block (feeds higher-level correlation rules; not a standalone alert)
Severity
low
Time window
9m
Group by
host.id, process.executable, user.id
Author
Elastic
Source
github.com/elastic/detection-rules

This rule identifies the execution of unsigned executables via service control manager (SCM). Adversaries may abuse SCM to execute malware or escalate privileges.

MITRE ATT&CK Coverage

Rule Body

[metadata]
bypass_bbr_timing = true
creation_date = "2023/07/14"
integration = ["endpoint"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
building_block_type = "default"
description = """
This rule identifies the execution of unsigned executables via service control manager (SCM). Adversaries may abuse SCM
to execute malware or escalate privileges.
"""
from = "now-9m"
index = ["logs-endpoint.events.process-*"]
language = "kuery"
license = "Elastic License v2"
name = "Execution of an Unsigned Service"
risk_score = 21
rule_id = "56fdfcf1-ca7c-4fd9-951d-e215ee26e404"
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Tactic: Defense Evasion",
    "Rule Type: BBR",
    "Data Source: Elastic Defend",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
host.os.type:windows and event.category:process and event.type:start and 
process.parent.executable:"C:\\Windows\\System32\\services.exe" and 
(process.code_signature.exists:false or process.code_signature.trusted:false) and
not process.code_signature.status : (errorCode_endpoint* or "errorChaining")
'''


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1569"
name = "System Services"
reference = "https://attack.mitre.org/techniques/T1569/"

[[rule.threat.technique.subtechnique]]
id = "T1569.002"
name = "Service Execution"
reference = "https://attack.mitre.org/techniques/T1569/002/"

[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1036"
name = "Masquerading"
reference = "https://attack.mitre.org/techniques/T1036/"

[[rule.threat.technique.subtechnique]]
id = "T1036.001"
name = "Invalid Code Signature"
reference = "https://attack.mitre.org/techniques/T1036/001/"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"

[[rule.threat.technique.subtechnique]]
id = "T1543.003"
name = "Windows Service"
reference = "https://attack.mitre.org/techniques/T1543/003/"

[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[rule.new_terms]
field = "new_terms_fields"
value = ["host.id", "process.executable", "user.id"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-5d"


Stages and Predicates

Stage 1: new_terms

host.os.type:windows and event.category:process and event.type:start and 
process.parent.executable:"C:\\Windows\\System32\\services.exe" and 
(process.code_signature.exists:false or process.code_signature.trusted:false) and
not process.code_signature.status : (errorCode_endpoint* or "errorChaining")

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.statuseqerrorChainingexcludes:process.code_signature.status field:"process.code_signature.status" value:"errorChaining"
process.code_signature.statusstarts_witherrorCode_endpointexcludes:process.code_signature.status field:"process.code_signature.status" value:"errorCode_endpoint"

Git Hook Created or Modified

#
Status
production
Severity
low
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

This rule detects the creation or modification of a Git hook file on a Linux system. Git hooks are scripts that Git executes before or after events such as commit, push, and receive. They are used to automate tasks, enforce policies, and customize Git's behavior. Attackers can abuse Git hooks to maintain persistence on a system by executing malicious code whenever a specific Git event occurs.

MITRE ATT&CK Coverage

Rule Body

[metadata]
creation_date = "2024/06/26"
integration = ["endpoint", "sentinel_one_cloud_funnel"]
maturity = "production"
updated_date = "2026/03/24"

[rule]
author = ["Elastic"]
description = """
This rule detects the creation or modification of a Git hook file on a Linux system. Git hooks are scripts that Git
executes before or after events such as commit, push, and receive. They are used to automate tasks, enforce policies,
and customize Git's behavior. Attackers can abuse Git hooks to maintain persistence on a system by executing malicious
code whenever a specific Git event occurs.
"""
from = "now-9m"
index = ["logs-endpoint.events.file*", "logs-sentinel_one_cloud_funnel.*", "endgame-*"]
language = "eql"
license = "Elastic License v2"
name = "Git Hook Created or Modified"
note = """## Triage and analysis

> **Disclaimer**:
> 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.

### Investigating Git Hook Created or Modified

Git hooks are scripts that automate tasks by executing before or after Git events like commits or pushes. While beneficial for developers, adversaries can exploit them to execute malicious code, maintaining persistence on a system. The detection rule identifies suspicious creation or modification of Git hooks on Linux, excluding benign processes, to flag potential abuse.

### Possible investigation steps

- Review the file path to confirm the location of the modified or created Git hook file and determine if it aligns with known repositories or projects on the system.
- Identify the process executable responsible for the creation or modification of the Git hook file and verify if it is a known and legitimate process, excluding those listed in the query.
- Check the timestamp of the event to correlate with any known user activities or scheduled tasks that might explain the modification or creation of the Git hook.
- Investigate the user account associated with the process that triggered the alert to determine if the activity aligns with their typical behavior or if it appears suspicious.
- Examine the contents of the modified or newly created Git hook file to identify any potentially malicious code or unexpected changes.
- Cross-reference the event with other security logs or alerts to identify any related suspicious activities or patterns that might indicate a broader attack or compromise.

### False positive analysis

- System package managers like dpkg, rpm, and yum can trigger false positives when they create or modify Git hooks during package installations or updates. To manage this, ensure these executables are included in the exclusion list within the detection rule.
- Automated deployment tools such as Puppet and Chef may modify Git hooks as part of their configuration management processes. Exclude these tools by adding their executables to the exception list to prevent false alerts.
- Continuous integration and deployment systems like Jenkins or GitLab runners might modify Git hooks as part of their build processes. Identify and exclude these processes by adding their specific executables or paths to the exclusion criteria.
- Custom scripts or internal tools that are known to modify Git hooks for legitimate purposes should be identified and their executables added to the exclusion list to avoid unnecessary alerts.
- Consider excluding specific directories or paths that are known to be used by trusted applications or processes for Git hook modifications, ensuring these are not flagged as suspicious.

### Response and remediation

- Immediately isolate the affected system from the network to prevent potential lateral movement or further execution of malicious code.
- Terminate any suspicious processes associated with the creation or modification of Git hooks that are not part of the known benign processes listed in the detection rule.
- Conduct a thorough review of the modified or newly created Git hook scripts to identify and remove any malicious code or unauthorized changes.
- Restore any affected Git repositories from a known good backup to ensure integrity and remove any persistence mechanisms.
- Implement file integrity monitoring on the .git/hooks directory to detect unauthorized changes in the future.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems are affected.
- Review and update access controls and permissions for Git repositories to limit the ability to modify hook scripts to only trusted users."""
references = [
    "https://git-scm.com/docs/githooks/2.26.0",
    "https://www.elastic.co/security-labs/sequel-on-persistence-mechanisms",
]
risk_score = 21
rule_id = "ac531fcc-1d3b-476d-bbb5-1357728c9a37"
setup = """## Setup

This rule requires data coming in from Elastic Defend.

### Elastic Defend Integration Setup
Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app.

#### Prerequisite Requirements:
- Fleet is required for Elastic Defend.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).

#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System:
- Go to the Kibana home page and click "Add integrations".
- In the query bar, search for "Elastic Defend" and select the integration to see more details about it.
- Click "Add Elastic Defend".
- Configure the integration name and optionally add a description.
- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads".
- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html).
- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions"
- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead.
For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html).
- Click "Save and Continue".
- 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.
For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html).
"""
severity = "low"
tags = [
    "Domain: Endpoint",
    "OS: Linux",
    "Use Case: Threat Detection",
    "Tactic: Persistence",
    "Tactic: Execution",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Defend",
    "Data Source: SentinelOne",
    "Data Source: Elastic Endgame",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"
query = '''
file where host.os.type == "linux" and event.type == "creation" and file.path like "*.git/hooks/*" and
file.extension == null and process.executable != null and not (
  process.executable in (
    "/bin/dpkg", "/usr/bin/dpkg", "/bin/dockerd", "/usr/bin/dockerd", "/usr/sbin/dockerd", "/bin/microdnf",
    "/usr/bin/microdnf", "/bin/rpm", "/usr/bin/rpm", "/bin/snapd", "/usr/bin/snapd", "/bin/yum", "/usr/bin/yum",
    "/bin/dnf", "/usr/bin/dnf", "/bin/podman", "/usr/bin/podman", "/bin/dnf-automatic", "/usr/bin/dnf-automatic",
    "/bin/pacman", "/usr/bin/pacman", "/usr/bin/dpkg-divert", "/bin/dpkg-divert", "/sbin/apk", "/usr/sbin/apk",
    "/usr/local/sbin/apk", "/usr/bin/apt", "/usr/sbin/pacman", "/bin/podman", "/usr/bin/podman", "/usr/bin/puppet",
    "/bin/puppet", "/opt/puppetlabs/puppet/bin/puppet", "/usr/bin/chef-client", "/bin/chef-client",
    "/bin/autossl_check", "/usr/bin/autossl_check", "/proc/self/exe", "/usr/bin/pamac-daemon", "/bin/pamac-daemon",
    "/usr/local/bin/dockerd", "/sbin/dockerd", "/usr/bin/fuse-overlayfs", "/usr/local/bin/gitlab-runner",
    "/usr/bin/coreutils", "/usr/bin/nautilus"
  ) or
  process.executable like (
    "/nix/store/*", "/var/lib/dpkg/*", "/snap/*", "/dev/fd/*", "/run/k3s/containerd/io.containerd.runtime.v2.task/k8s.io/*/r10k"
  ) or
  process.name in ("git", "dirname", "tar", "gitea", "git-lfs") or
  (process.name == "sed" and file.name : "sed*") or
  (process.name == "perl" and file.name : "e2scrub_all.tmp*")
)
'''

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1543"
name = "Create or Modify System Process"
reference = "https://attack.mitre.org/techniques/T1543/"

[[rule.threat.technique]]
id = "T1546"
name = "Event Triggered Execution"
reference = "https://attack.mitre.org/techniques/T1546/"

[[rule.threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"

[rule.threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"

[[rule.threat.technique.subtechnique]]
id = "T1059.004"
name = "Unix Shell"
reference = "https://attack.mitre.org/techniques/T1059/004/"

[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

Stages and Predicates

Stage 1: file

file where host.os.type == "linux" and event.type == "creation" and file.path like "*.git/hooks/*" and
file.extension == null and process.executable != null and not (
  process.executable in (
    "/bin/dpkg", "/usr/bin/dpkg", "/bin/dockerd", "/usr/bin/dockerd", "/usr/sbin/dockerd", "/bin/microdnf",
    "/usr/bin/microdnf", "/bin/rpm", "/usr/bin/rpm", "/bin/snapd", "/usr/bin/snapd", "/bin/yum", "/usr/bin/yum",
    "/bin/dnf", "/usr/bin/dnf", "/bin/podman", "/usr/bin/podman", "/bin/dnf-automatic", "/usr/bin/dnf-automatic",
    "/bin/pacman", "/usr/bin/pacman", "/usr/bin/dpkg-divert", "/bin/dpkg-divert", "/sbin/apk", "/usr/sbin/apk",
    "/usr/local/sbin/apk", "/usr/bin/apt", "/usr/sbin/pacman", "/bin/podman", "/usr/bin/podman", "/usr/bin/puppet",
    "/bin/puppet", "/opt/puppetlabs/puppet/bin/puppet", "/usr/bin/chef-client", "/bin/chef-client",
    "/bin/autossl_check", "/usr/bin/autossl_check", "/proc/self/exe", "/usr/bin/pamac-daemon", "/bin/pamac-daemon",
    "/usr/local/bin/dockerd", "/sbin/dockerd", "/usr/bin/fuse-overlayfs", "/usr/local/bin/gitlab-runner",
    "/usr/bin/coreutils", "/usr/bin/nautilus"
  ) or
  process.executable like (
    "/nix/store/*", "/var/lib/dpkg/*", "/snap/*", "/dev/fd/*", "/run/k3s/containerd/io.containerd.runtime.v2.task/k8s.io/*/r10k"
  ) or
  process.name in ("git", "dirname", "tar", "gitea", "git-lfs") or
  (process.name == "sed" and file.name : "sed*") or
  (process.name == "perl" and file.name : "e2scrub_all.tmp*")
)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
file.namestarts_withe2scrub_all.tmpexcludes:file.name field:"file.name" value:"e2scrub_all.tmp"
process.nameeqperlexcludes:process.name field:"process.name" value:"perl"
file.namestarts_withsedexcludes:file.name field:"file.name" value:"sed"
process.nameeqsedexcludes:process.name field:"process.name" value:"sed"
process.executablein/bin/autossl_check, /bin/chef-client, /bin/dnf, /bin/dnf-automatic, /bin/dockerd, /bin/dpkg, /bin/dpkg-divert, /bin/microdnf, /bin/pacman, /bin/pamac-daemon, /bin/podman, /bin/puppet, /bin/rpm, /bin/snapd, /bin/yum, /opt/puppetlabs/puppet/bin/puppet, /proc/self/exe, /sbin/apk, /sbin/dockerd, /usr/bin/apt, /usr/bin/autossl_check, /usr/bin/chef-client, /usr/bin/coreutils, /usr/bin/dnf, /usr/bin/dnf-automatic, /usr/bin/dockerd, /usr/bin/dpkg, /usr/bin/dpkg-divert, /usr/bin/fuse-overlayfs, /usr/bin/microdnf, /usr/bin/nautilus, /usr/bin/pacman, /usr/bin/pamac-daemon, /usr/bin/podman, /usr/bin/puppet, /usr/bin/rpm, /usr/bin/snapd, /usr/bin/yum, /usr/local/bin/dockerd, /usr/local/bin/gitlab-runner, /usr/local/sbin/apk, /usr/sbin/apk, /usr/sbin/dockerd, /usr/sbin/pacmanexcludes:process.executable
process.executablewildcard/nix/store/*, /var/lib/dpkg/*, /snap/*, /dev/fd/*, /run/k3s/containerd/io.containerd.runtime.v2.task/k8s.io/*/r10kexcludes:process.executable
process.nameindirname, git, git-lfs, gitea, tarexcludes:process.name

Kubernetes Anonymous Request Authorized by Unusual User Agent

#
Status
production
Severity
medium
Group by
user_agent.original
Author
Elastic
Source
github.com/elastic/detection-rules

This rule detects when an unauthenticated user request is authorized within the cluster via an unusual user agent. Attackers may attempt to use anonymous accounts to gain initial access to the cluster or to avoid attribution of their activities within the cluster. This rule excludes the /healthz, /livez, /version and /.well-known/oauth-authorization-server endpoints which are commonly accessed anonymously.

Known False Positives

  • Anonymous access to the API server is a dangerous setting enabled by default. Common anonymous connections (e.g., health checks) have been excluded from this rule. All other instances of authorized anonymous requests should be investigated.

MITRE ATT&CK Coverage

TacticTechniques
Initial Access

Rule Body

[metadata]
creation_date = "2022/09/13"
integration = ["kubernetes"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
This rule detects when an unauthenticated user request is authorized within the cluster via an unusual user agent.
Attackers may attempt to use anonymous accounts to gain initial access to the cluster or to avoid attribution of
their activities within the cluster. This rule excludes the /healthz, /livez, /version and /.well-known/oauth-authorization-server
endpoints which are commonly accessed anonymously.
"""
false_positives = [
    """
    Anonymous access to the API server is a dangerous setting enabled by default. Common anonymous connections (e.g.,
    health checks) have been excluded from this rule. All other instances of authorized anonymous requests should be
    investigated.
    """,
]
index = ["logs-kubernetes.audit_logs-*"]
language = "kuery"
license = "Elastic License v2"
name = "Kubernetes Anonymous Request Authorized by Unusual User Agent"
note = """## Triage and analysis

> **Disclaimer**:
> 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.

### Investigating Kubernetes Anonymous Request Authorized by Unusual User Agent

Kubernetes, a container orchestration platform, manages workloads and services. It uses authentication to control access. Adversaries might exploit anonymous access to perform unauthorized actions without leaving traces. The detection rule identifies unauthorized access by monitoring audit logs for anonymous requests that are allowed, excluding common health check endpoints, to flag potential misuse.

### Possible investigation steps

- Review the audit logs for the specific event.dataset:kubernetes.audit_logs to identify the context and details of the anonymous request.
- Examine the kubernetes.audit.user.username field to confirm if the request was made by "system:anonymous" or "system:unauthenticated" and assess the potential risk associated with these accounts.
- Analyze the kubernetes.audit.requestURI to determine the target of the request and verify if it is outside the excluded endpoints (/healthz, /livez, /readyz), which could indicate suspicious activity.
- Investigate the source IP address and other network metadata associated with the request to identify the origin and assess if it aligns with known or expected traffic patterns.
- Check for any subsequent or related activities in the audit logs that might indicate further unauthorized actions or attempts to exploit the cluster.

### False positive analysis

- Health check endpoints like /healthz, /livez, and /readyz are already excluded, but ensure any custom health check endpoints are also excluded to prevent false positives.
- Regularly scheduled maintenance tasks or automated scripts that use anonymous access for legitimate purposes should be identified and excluded from the rule to avoid unnecessary alerts.
- Some monitoring tools might use anonymous requests for gathering metrics; verify these tools and exclude their specific request patterns if they are known to be safe.
- Development environments might have different access patterns compared to production; consider creating separate rules or exceptions for non-production clusters to reduce noise.
- Review the audit logs to identify any recurring anonymous requests that are part of normal operations and adjust the rule to exclude these specific cases.

### Response and remediation

- Immediately isolate the affected Kubernetes cluster to prevent further unauthorized access and potential lateral movement by the adversary.
- Revoke any anonymous access permissions that are not explicitly required for the operation of the cluster, ensuring that all access is authenticated and authorized.
- Conduct a thorough review of the audit logs to identify any unauthorized actions performed by anonymous users and assess the impact on the cluster.
- Reset credentials and access tokens for any accounts that may have been compromised or used in conjunction with the anonymous access.
- Implement network segmentation to limit the exposure of the Kubernetes API server to only trusted networks and users.
- Escalate the incident to the security operations team for further investigation and to determine if additional clusters or systems are affected.
- Enhance monitoring and alerting for unauthorized access attempts, focusing on detecting and responding to similar threats in the future.

## Setup

The Kubernetes Fleet integration with Audit Logs enabled or similarly structured data is required to be compatible with this rule."""
references = [
    "https://media.defense.gov/2022/Aug/29/2003066362/-1/-1/0/CTR_KUBERNETES_HARDENING_GUIDANCE_1.2_20220829.PDF",
]
risk_score = 47
rule_id = "63c057cc-339a-11ed-a261-0242ac120002"
severity = "medium"
tags = [
  "Data Source: Kubernetes",
  "Domain: Kubernetes",
  "Use Case: Threat Detection",
  "Tactic: Initial Access",
  "Tactic: Defense Evasion",
  "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"
query = '''
data_stream.dataset:"kubernetes.audit_logs" and
kubernetes.audit.annotations.authorization_k8s_io/decision:"allow" and
kubernetes.audit.user.username:("system:anonymous" or "system:unauthenticated" or not *) and
user_agent.original:(* and not (*kubernetes/$Format)) and
not kubernetes.audit.requestURI:(/healthz* or /livez* or /readyz* or /version or /.well-known/oauth-authorization-server)
'''

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"

[[rule.threat.technique.subtechnique]]
id = "T1078.001"
name = "Default Accounts"
reference = "https://attack.mitre.org/techniques/T1078/001/"

[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"

[rule.new_terms]
field = "new_terms_fields"
value = ["user_agent.original"]

[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-7d"

Stages and Predicates

Stage 1: new_terms

data_stream.dataset:"kubernetes.audit_logs" and
kubernetes.audit.annotations.authorization_k8s_io/decision:"allow" and
kubernetes.audit.user.username:("system:anonymous" or "system:unauthenticated" or not *) and
user_agent.original:(* and not (*kubernetes/$Format)) and
not kubernetes.audit.requestURI:(/healthz* or /livez* or /readyz* or /version or /.well-known/oauth-authorization-server)

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Loadable Kernel Module Load Followed by Log Clearing

#
Time window
10s
Source
github.com/elastic/protections-artifacts

This rule detects when a loadable kernel module (LKM) is loaded, followed shortly by an attempt to clear system logs using common log-clearing commands like "dmesg" or "journalctl". Rootkits often use LKMs to hide their presence, and clearing logs right after loading is a common tactic to evade detection after such activities.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
This rule detects when a loadable kernel module (LKM) is loaded, followed shortly by an attempt to clear system logs
using common log-clearing commands like "dmesg" or "journalctl". Rootkits often use LKMs to hide their presence, and
clearing logs right after loading is a common tactic to evade detection after such activities.
"""
id = "7ed2911b-839a-45a5-8215-8b17066b7dd8"
license = "Elastic License v2"
name = "Loadable Kernel Module Load Followed by Log Clearing"
os_list = ["linux"]
reference = [
    "https://www.elastic.co/security-labs/continuation-on-persistence-mechanisms",
    "https://github.com/MatheuZSecurity/Singularity",
]
version = "1.0.9"

query = '''
sequence with maxspan=10s
  [process where event.type == "start" and event.action == "load_module" and process.parent.executable != null]
  [process where event.type == "start" and event.action == "exec" and (
    (process.name == "dmesg" and process.args in ("-c", "-C", "--clear", "--read-clear")) or
    (process.name == "journalctl" and process.args like~ ("--vacuum-time=*", "--vacuum-size=*", "--vacuum-files=*"))
  )]
'''

min_endpoint_version = "9.1.4"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
tree = true

[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
tree = true

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0
tree = true

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 1
tree = true

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[threat.technique.subtechnique]]
id = "T1547.006"
name = "Kernel Modules and Extensions"
reference = "https://attack.mitre.org/techniques/T1547/006/"



[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1014"
name = "Rootkit"
reference = "https://attack.mitre.org/techniques/T1014/"

[[threat.technique]]
id = "T1070"
name = "Indicator Removal"
reference = "https://attack.mitre.org/techniques/T1070/"
[[threat.technique.subtechnique]]
id = "T1070.002"
name = "Clear Linux or Mac System Logs"
reference = "https://attack.mitre.org/techniques/T1070/002/"


[[threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"
[[threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "9.1.4"

Stages and Predicates

Stage 1: process

[process where event.type == "start" and event.action == "load_module" and process.parent.executable != null]

Stage 2: process

[process where event.type == "start" and event.action == "exec" and (
    (process.name == "dmesg" and process.args in ("-c", "-C", "--clear", "--read-clear")) or
    (process.name == "journalctl" and process.args like~ ("--vacuum-time=*", "--vacuum-size=*", "--vacuum-files=*"))
  )]

Indicators

These rows show field, operator, and value matches.

Microsoft Windows Defender Tampering

#
Status
production
Severity
medium
Time window
9m
Author
Austin Songer
Source
github.com/elastic/detection-rules

Identifies when one or more features on Microsoft Defender are disabled. Adversaries may disable or tamper with Microsoft Defender features to evade detection and conceal malicious behavior.

Known False Positives

  • Legitimate Windows Defender configuration changes

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2021/10/18"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Austin Songer"]
description = """
Identifies when one or more features on Microsoft Defender are disabled. Adversaries may disable or tamper with
Microsoft Defender features to evade detection and conceal malicious behavior.
"""
false_positives = ["Legitimate Windows Defender configuration changes"]
from = "now-9m"
index = [
    "winlogbeat-*",
    "logs-endpoint.events.registry-*",
    "logs-windows.sysmon_operational-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "endgame-*",
    "logs-crowdstrike.fdr*",
]
language = "eql"
license = "Elastic License v2"
name = "Microsoft Windows Defender Tampering"
note = """## Triage and analysis

### Investigating Microsoft Windows Defender Tampering

Microsoft Windows Defender is an antivirus product built into Microsoft Windows, which makes it popular across multiple environments. Disabling it is a common step in threat actor playbooks.

This rule monitors the registry for modifications that disable Windows Defender features.

#### Possible investigation steps

- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Validate the activity is not related to planned patches, updates, network administrator activity, or legitimate software installations.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Contact the account owner and confirm whether they are aware of this activity.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Examine which features have been disabled, and check if this operation is done under change management and approved according to the organization's policy.

### False positive analysis

- This mechanism can be used legitimately. Analysts can dismiss the alert if the administrator is aware of the activity, the configuration is justified (for example, it is being used to deploy other security solutions or troubleshooting), and no other suspicious activity has been observed.

### Related rules

- Windows Defender Disabled via Registry Modification - 2ffa1f1e-b6db-47fa-994b-1512743847eb
- Disabling Windows Defender Security Settings via PowerShell - c8cccb06-faf2-4cd5-886e-2c9636cfcb87

### Response and remediation

- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved hosts to prevent further post-compromise behavior.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Take actions to restore the appropriate Windows Defender antivirus configurations.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Review the privileges assigned to the user to ensure that the least privilege principle is being followed.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
"""

setup = """## Setup

This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.

Setup instructions: https://ela.st/install-elastic-defend

### Additional data sources

This rule also supports the following third-party data sources. For setup instructions, refer to the links below:

- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Registry Events](https://ela.st/sysmon-event-reg-setup)
"""

references = [
    "https://thedfirreport.com/2021/10/18/icedid-to-xinglocker-ransomware-in-24-hours/",
    "https://www.tenforums.com/tutorials/32236-enable-disable-microsoft-defender-pua-protection-windows-10-a.html",
    "https://www.tenforums.com/tutorials/104025-turn-off-core-isolation-memory-integrity-windows-10-a.html",
    "https://www.tenforums.com/tutorials/105533-enable-disable-windows-defender-exploit-protection-settings.html",
    "https://www.tenforums.com/tutorials/123792-turn-off-tamper-protection-microsoft-defender-antivirus.html",
    "https://www.tenforums.com/tutorials/51514-turn-off-microsoft-defender-periodic-scanning-windows-10-a.html",
    "https://www.tenforums.com/tutorials/3569-turn-off-real-time-protection-microsoft-defender-antivirus.html",
    "https://www.tenforums.com/tutorials/99576-how-schedule-scan-microsoft-defender-antivirus-windows-10-a.html",
    "https://www.elastic.co/security-labs/invisible-miners-unveiling-ghostengine",
]
risk_score = 47
rule_id = "fe794edd-487f-4a90-b285-3ee54f2af2d3"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: Microsoft Defender XDR",
    "Data Source: SentinelOne",
    "Data Source: Elastic Endgame",
    "Data Source: Crowdstrike",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
registry where host.os.type == "windows" and event.type == "change" and process.executable != null and
  (
    (
      registry.value : (
        "PUAProtection", "DisallowExploitProtectionOverride", "TamperProtection", "EnableControlledFolderAccess",
        "SpynetReporting", "SubmitSamplesConsent"
      ) and registry.data.strings : ("0", "0x00000000")
    ) or
    (
      registry.value : (
        "DisableAntiSpyware", "DisableRealtimeMonitoring", "DisableIntrusionPreventionSystem", "DisableScriptScanning",
        "DisableIOAVProtection", "DisableEnhancedNotifications", "DisableBlockAtFirstSeen", "DisableBehaviorMonitoring"
      ) and registry.data.strings : ("1", "0x00000001")
    )
  ) and
  not process.executable : (
    "?:\\Windows\\system32\\svchost.exe", 
    "?:\\Windows\\CCM\\CcmExec.exe", 
    "?:\\Windows\\System32\\DeviceEnroller.exe", 
    "?:\\Program Files (x86)\\Trend Micro\\Security Agent\\tmuninst.exe",
    "\\Device\\HarddiskVolume*\\Windows\\system32\\svchost.exe", 
    "\\Device\\HarddiskVolume*\\Windows\\CCM\\CcmExec.exe", 
    "\\Device\\HarddiskVolume*\\Windows\\System32\\DeviceEnroller.exe", 
    "\\Device\\HarddiskVolume*\\Program Files (x86)\\Trend Micro\\Security Agent\\tmuninst.exe"
  )

/*
    Full registry key paths omitted due to data source variations:
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableRealtimeMonitoring"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableIntrusionPreventionSystem"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableScriptScanning"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableIOAVProtection"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Reporting\\DisableEnhancedNotifications"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\SpyNet\\DisableBlockAtFirstSeen"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableBehaviorMonitoring"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\PUAProtection"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender Security Center\\App and Browser protection\\DisallowExploitProtectionOverride"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Features\\TamperProtection"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Windows Defender Exploit Guard\\Controlled Folder Access\\EnableControlledFolderAccess"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\SpyNet\\SpynetReporting"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\SpyNet\\SubmitSamplesConsent"
*/
'''


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1112"
name = "Modify Registry"
reference = "https://attack.mitre.org/techniques/T1112/"

[[rule.threat.technique]]
id = "T1562"
name = "Impair Defenses"
reference = "https://attack.mitre.org/techniques/T1562/"

[[rule.threat.technique.subtechnique]]
id = "T1562.001"
name = "Disable or Modify Tools"
reference = "https://attack.mitre.org/techniques/T1562/001/"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

Stages and Predicates

Stage 1: registry

registry where host.os.type == "windows" and event.type == "change" and process.executable != null and
  (
    (
      registry.value : (
        "PUAProtection", "DisallowExploitProtectionOverride", "TamperProtection", "EnableControlledFolderAccess",
        "SpynetReporting", "SubmitSamplesConsent"
      ) and registry.data.strings : ("0", "0x00000000")
    ) or
    (
      registry.value : (
        "DisableAntiSpyware", "DisableRealtimeMonitoring", "DisableIntrusionPreventionSystem", "DisableScriptScanning",
        "DisableIOAVProtection", "DisableEnhancedNotifications", "DisableBlockAtFirstSeen", "DisableBehaviorMonitoring"
      ) and registry.data.strings : ("1", "0x00000001")
    )
  ) and
  not process.executable : (
    "?:\\Windows\\system32\\svchost.exe", 
    "?:\\Windows\\CCM\\CcmExec.exe", 
    "?:\\Windows\\System32\\DeviceEnroller.exe", 
    "?:\\Program Files (x86)\\Trend Micro\\Security Agent\\tmuninst.exe",
    "\\Device\\HarddiskVolume*\\Windows\\system32\\svchost.exe", 
    "\\Device\\HarddiskVolume*\\Windows\\CCM\\CcmExec.exe", 
    "\\Device\\HarddiskVolume*\\Windows\\System32\\DeviceEnroller.exe", 
    "\\Device\\HarddiskVolume*\\Program Files (x86)\\Trend Micro\\Security Agent\\tmuninst.exe"
  )

/*
    Full registry key paths omitted due to data source variations:
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\DisableAntiSpyware"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableRealtimeMonitoring"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableIntrusionPreventionSystem"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableScriptScanning"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableIOAVProtection"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Reporting\\DisableEnhancedNotifications"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\SpyNet\\DisableBlockAtFirstSeen"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Real-Time Protection\\DisableBehaviorMonitoring"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\PUAProtection"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender Security Center\\App and Browser protection\\DisallowExploitProtectionOverride"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Features\\TamperProtection"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\Windows Defender Exploit Guard\\Controlled Folder Access\\EnableControlledFolderAccess"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\SpyNet\\SpynetReporting"
    "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows Defender\\SpyNet\\SubmitSamplesConsent"
*/

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • change corpus 89 (elastic 89)
field:"event.type" kind:eq value:"change"
process.executableis_not_null
  • (no value, null check)
field:"Image" kind:is_not_null
registry.data.stringswildcard
  • 0 corpus 17 (elastic 14, sigma 3)
  • 0x00000000 corpus 41 (splunk 33, elastic 8)
  • 0x00000001 corpus 61 (splunk 52, elastic 9)
  • 1 corpus 16 (elastic 14, splunk 2)
field:"Details" kind:wildcard
registry.valuewildcard
  • DisableAntiSpyware corpus 2 (elastic 1, splunk 1)
  • DisableBehaviorMonitoring corpus 2 (elastic 2)
  • DisableBlockAtFirstSeen corpus 2 (elastic 1, splunk 1)
  • DisableEnhancedNotifications corpus 2 (elastic 1, splunk 1)
  • DisableIOAVProtection corpus 2 (elastic 2)
  • DisableIntrusionPreventionSystem
  • DisableRealtimeMonitoring corpus 2 (elastic 2)
  • DisableScriptScanning corpus 2 (elastic 2)
  • DisallowExploitProtectionOverride
  • EnableControlledFolderAccess
  • PUAProtection
  • SpynetReporting corpus 2 (elastic 1, splunk 1)
  • SubmitSamplesConsent corpus 2 (elastic 1, splunk 1)
  • TamperProtection
field:"registry_value_name" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executablewildcard?:\Windows\system32\svchost.exe, ?:\Windows\CCM\CcmExec.exe, ?:\Windows\System32\DeviceEnroller.exe, ?:\Program Files (x86)\Trend Micro\Security Agent\tmuninst.exe, \Device\HarddiskVolume*\Windows\system32\svchost.exe, \Device\HarddiskVolume*\Windows\CCM\CcmExec.exe, \Device\HarddiskVolume*\Windows\System32\DeviceEnroller.exe, \Device\HarddiskVolume*\Program Files (x86)\Trend Micro\Security Agent\tmuninst.exeexcludes:process.executable

Potential Execution via FileFix Phishing Attack

#
Status
production
Severity
high
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies the execution of Windows commands or downloaded files via the browser's dialog box. Adversaries may use phishing to instruct the victim to copy and paste malicious commands for execution via crafted phishing web pages.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2025/08/20"
integration = ["endpoint", "windows", "sentinel_one_cloud_funnel", "m365_defender"]
maturity = "production"
updated_date = "2026/05/03"

[rule]
author = ["Elastic"]
description = """
Identifies the execution of Windows commands or downloaded files via the browser's dialog box. Adversaries may use
phishing to instruct the victim to copy and paste malicious commands for execution via crafted phishing web pages.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.process-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-windows.sysmon_operational-*",
    "winlogbeat-*"
]
language = "eql"
license = "Elastic License v2"
name = "Potential Execution via FileFix Phishing Attack"
references = ["https://mrd0x.com/filefix-clickfix-alternative/"]
risk_score = 73
rule_id = "7dc45430-7407-4790-b89e-c857c3f6bf23"
severity = "high"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Execution",
    "Data Source: Windows Security Event Logs",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: SentinelOne",
    "Data Source: Microsoft Defender XDR",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
 process.parent.args == "--message-loop-type-ui" and process.parent.args == "--service-sandbox-type=none" and
 (
  process.name : ("pwsh.exe", "powershell.exe", "curl.exe", "msiexec.exe", "mshta.exe", "wscript.exe", "cscript.exe", "rundll32.exe", "certutil.exe", "certreq.exe") or
  process.executable : "?:\\Users\\*\\Downloads\\*"
  ) and
not (process.name : "rundll32.exe" and process.args : ("ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile", "shwebsvc.dll,AddNetPlaceRunDll"))
'''

note = """## Triage and analysis

### Investigating Potential Execution via FileFix Phishing Attack

#### Possible investigation steps

- Does the alert show the FileFix browser-to-Explorer execution path?
  - Focus: alert-local `process.parent.executable`, `process.parent.args`, `process.name`, `process.executable`, and `process.command_line`.
  - Implication: escalate when a Chromium-style file-picker parent using "--message-loop-type-ui" and "--service-sandbox-type=none" launches PowerShell, curl, certutil, certreq, msiexec, mshta, rundll32, wscript, cscript, or a "?:\\Users\\*\\Downloads\\*" executable; lower suspicion only when the child is a signed installer or diagnostic tool and the parent/command shape matches a recognized browser-initiated support or install flow.
- Is the launched child the expected binary for that workflow?
  - Focus: `process.executable`, `process.pe.original_file_name`, `process.code_signature.subject_name`, and `process.code_signature.trusted`; recover absent values from same-process events. $investigate_0
  - Implication: escalate when the path is user-writable or signer/original name mismatches the expected tool; lower identity risk when signer, original name, path, and known hash history fit, but continue command-intent checks.
- Does the command line reveal pasted-command social engineering?
  - Focus: `process.command_line` and `process.name`.
  - Implication: escalate when the command hides execution before a fake path or comment, invokes PowerShell or a LOLBin to retrieve/run content, or starts a "%USERPROFILE%\\Downloads" payload directly; lower suspicion only when arguments open the signed installer or diagnostic tool with no hidden command, URL, or shell operator.
- Does a Downloads-path child look newly staged or renamed?
  - Focus: `process.executable`, `process.Ext.relative_file_creation_time`, `process.Ext.relative_file_name_modify_time`, `process.code_signature.thumbprint_sha256`, and same-process file writes/renames; recover absent process values from same-process events. $investigate_2
  - Hint: for the downloaded-EXE variant, process file-age is the recovery signal; absent file provenance does not make a Downloads path benign.
  - Implication: escalate when a Downloads or other user-profile executable runs shortly after creation or rename, especially with weak identity; lower suspicion when file age, stable signer, and path match the same recognized update or support workflow.
- Did the launched child spawn follow-on tools?
  - Focus: child process starts from `process.entity_id`, then descendant `process.executable` and `process.command_line`. $investigate_1
  - Hint: if entity IDs are unavailable, fall back to parent PID plus a tight alert-time window on the same host.
  - Implication: escalate when the chain fans out into shells, script hosts, installers, archive tools, or task/scheduler utilities; no descendants keeps scope local but does not clear suspicious command intent or identity mismatch.
- Did the launched child contact retrieval or staging destinations?
  - Focus: same-process network events for `destination.ip`, `destination.port`, and destination ownership when available. $investigate_3
  - Implication: escalate when PowerShell, curl, certutil, certreq, mshta, or another child reaches external staging, paste, storage, or command-and-control infrastructure; missing network telemetry is unresolved, not benign.
- If local evidence remains suspicious or unresolved, does the pattern recur for this user or host?
  - Focus: related alerts and process starts for the same `user.id` and `host.id`, comparing `process.parent.args` and child `process.command_line`.
  - Hint: review related user alerts with $investigate_4
  - Hint: review related host alerts with $investigate_5
  - Implication: broaden scope when the same browser-parented shell, LOLBin, or Downloads-path launch repeats for this user, host, or other users; keep the case local when it is isolated and the process evidence resolves cleanly.
- Escalate when ancestry, child identity, command intent, file age, descendants, network, or recurrence supports user-assisted command execution or downloaded payload launch; close only when process evidence shows a signed installer or diagnostic identity, non-hidden command shape, expected file age/path, no suspicious descendants, no suspicious network where telemetry exists, and no related spread; preserve evidence and escalate when facts conflict or remain incomplete.

### False positive analysis

- Signed browser-initiated installer/diagnostic workflows or authorized security tests can trigger. Confirm exact alignment across parent flags, child path, signer, hash, command line, user, host, timing, and absence of suspicious descendants; do not close on a ticket or owner statement if process evidence conflicts.
- Before creating an exception, require recurrence with stable `process.parent.executable`, `process.parent.args`, `process.executable`, `process.code_signature.thumbprint_sha256`, command-line shape, `user.id`, and `host.id`. Avoid exceptions on browser parentage, `process.name`, or Downloads-path execution alone.

### Response and remediation

- If suspicious but unconfirmed, first preserve the alert event, same-process event export, descendant process timeline, command-line text, parent context, child binary copy, hash and signature details, and the affected user/host identifiers.
- Apply reversible containment only after preservation, such as restricting the affected browser session or account, blocking the exact child hash, or quarantining the downloaded child binary. Escalate to host isolation only when command intent, identity, or descendants indicate likely payload execution.
- If confirmed malicious, isolate the host when the launched child or descendants executed payloads, then terminate the child and descendants after recording identifiers. Do not reset credentials from this alert alone; use identity response only when separate evidence proves credential exposure or account misuse.
- Eradicate only the downloaded executables, scripts, task utilities, or secondary payloads identified in the process timeline, then remediate the phishing page access or browser session that enabled the user-assisted execution.
- If confirmed benign, reverse temporary containment and document the exact parent flags, child identity, command shape, user, host, and outside confirmation that proved the workflow. Create an exception only after the stable bounded pattern recurs.
- Post-incident hardening: restrict direct execution from user download locations where feasible, warn on browser-file-picker social engineering, retain process telemetry needed for the pivots above, and document the FileFix variant observed in the case record."""

setup = """## Setup

This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.

Setup instructions: https://ela.st/install-elastic-defend

### Additional data sources

This rule also supports the following third-party data sources. For setup instructions, refer to the links below:

- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
"""

[rule.investigation_fields]
field_names = [
    "@timestamp",
    "host.id",
    "user.id",
    "process.entity_id",
    "process.pid",
    "process.executable",
    "process.command_line",
    "process.pe.original_file_name",
    "process.code_signature.subject_name",
    "process.code_signature.trusted",
    "process.code_signature.thumbprint_sha256",
    "process.Ext.relative_file_creation_time",
    "process.Ext.relative_file_name_modify_time",
    "process.parent.executable",
    "process.parent.command_line",
]

[transform]

[[transform.investigate]]
label = "Events for the launched process on this host"
description = ""
providers = [
  [
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Child process starts from the launched process"
description = ""
providers = [
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "event.type", queryType = "phrase", value = "start", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.parent.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
  ],
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "process", valueType = "string" },
    { excluded = false, field = "event.type", queryType = "phrase", value = "start", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.parent.pid", queryType = "phrase", value = "{{process.pid}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "File events for the launched process"
description = ""
providers = [
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
  ],
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "file", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.pid", queryType = "phrase", value = "{{process.pid}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Network events for the launched process"
description = ""
providers = [
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.entity_id", queryType = "phrase", value = "{{process.entity_id}}", valueType = "string" }
  ],
  [
    { excluded = false, field = "event.category", queryType = "phrase", value = "network", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" },
    { excluded = false, field = "process.pid", queryType = "phrase", value = "{{process.pid}}", valueType = "string" }
  ]
]
relativeFrom = "now-1h"
relativeTo = "now"

[[transform.investigate]]
label = "Alerts associated with the user"
description = ""
providers = [
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "user.id", queryType = "phrase", value = "{{user.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

[[transform.investigate]]
label = "Alerts associated with the host"
description = ""
providers = [
  [
    { excluded = false, field = "event.kind", queryType = "phrase", value = "signal", valueType = "string" },
    { excluded = false, field = "host.id", queryType = "phrase", value = "{{host.id}}", valueType = "string" }
  ]
]
relativeFrom = "now-48h/h"
relativeTo = "now"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"

[[rule.threat.technique.subtechnique]]
id = "T1059.001"
name = "PowerShell"
reference = "https://attack.mitre.org/techniques/T1059/001/"

[[rule.threat.technique.subtechnique]]
id = "T1059.003"
name = "Windows Command Shell"
reference = "https://attack.mitre.org/techniques/T1059/003/"

[[rule.threat.technique]]
id = "T1204"
name = "User Execution"
reference = "https://attack.mitre.org/techniques/T1204/"

[[rule.threat.technique.subtechnique]]
id = "T1204.002"
name = "Malicious File"
reference = "https://attack.mitre.org/techniques/T1204/002/"

[[rule.threat.technique.subtechnique]]
id = "T1204.004"
name = "Malicious Copy and Paste"
reference = "https://attack.mitre.org/techniques/T1204/004/"

[rule.threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"

[[rule.threat.technique.subtechnique]]
id = "T1218.005"
name = "Mshta"
reference = "https://attack.mitre.org/techniques/T1218/005/"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1566"
name = "Phishing"
reference = "https://attack.mitre.org/techniques/T1566/"

[[rule.threat.technique.subtechnique]]
id = "T1566.001"
name = "Spearphishing Attachment"
reference = "https://attack.mitre.org/techniques/T1566/001/"

[[rule.threat.technique.subtechnique]]
id = "T1566.002"
name = "Spearphishing Link"
reference = "https://attack.mitre.org/techniques/T1566/002/"

[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
 process.parent.args == "--message-loop-type-ui" and process.parent.args == "--service-sandbox-type=none" and
 (
  process.name : ("pwsh.exe", "powershell.exe", "curl.exe", "msiexec.exe", "mshta.exe", "wscript.exe", "cscript.exe", "rundll32.exe", "certutil.exe", "certreq.exe") or
  process.executable : "?:\\Users\\*\\Downloads\\*"
  ) and
not (process.name : "rundll32.exe" and process.args : ("ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile", "shwebsvc.dll,AddNetPlaceRunDll"))

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.executablewildcard
  • ?:\Users\*\Downloads\* corpus 12 (elastic 12)
field:"Image" kind:wildcard value:"?:\Users\*\Downloads\*"
process.namewildcard
  • certreq.exe corpus 20 (elastic 20)
  • certutil.exe corpus 45 (elastic 39, splunk 6)
  • cscript.exe corpus 68 (elastic 66, splunk 2)
  • curl.exe corpus 34 (elastic 32, splunk 2)
  • mshta.exe corpus 84 (elastic 80, splunk 4)
  • msiexec.exe corpus 45 (elastic 40, splunk 5)
  • powershell.exe corpus 187 (elastic 140, splunk 44, kusto 3)
  • pwsh.exe corpus 78 (elastic 49, splunk 29)
  • rundll32.exe corpus 123 (elastic 100, splunk 23)
  • wscript.exe corpus 84 (elastic 82, splunk 1, kusto 1)
field:"process_basename" kind:wildcard
process.parent.argseq
  • --message-loop-type-ui corpus 2 (elastic 2)
  • --service-sandbox-type=none corpus 2 (elastic 2)
field:"process.parent.args" kind:eq

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseqndfapi.dll,NdfRunDllDiagnoseWithAnswerFile, shwebsvc.dll,AddNetPlaceRunDllexcludes:process.args field:"process.args" value:"ndfapi.dll,NdfRunDllDiagnoseWithAnswerFile" field:"process.args" value:"shwebsvc.dll,AddNetPlaceRunDll"
process.nameeqrundll32.exeexcludes:process.name field:"process.name" value:"rundll32.exe"

Registry Run Key Prefixed with Asterisk

#
Source
github.com/elastic/protections-artifacts

Run and RunOnce registry keys cause programs to run each time that a user logs on. By default, these keys are ignored when the computer is started in Safe Mode. The value name of RunOnce keys can be prefixed with an asterisk (*) to force the program to run even in Safe Mode. Attackers have been observed in the wild using this technique to execute ransomware in Safe Mode.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Run and RunOnce registry keys cause programs to run each time that a user logs on. By default, these keys are ignored
when the computer is started in Safe Mode. The value name of RunOnce keys can be prefixed with an asterisk (*) to force
the program to run even in Safe Mode. Attackers have been observed in the wild using this technique to execute
ransomware in Safe Mode.
"""
id = "94d35931-5c48-49ed-8c18-d601c4f8aeaa"
license = "Elastic License v2"
name = "Registry Run Key Prefixed with Asterisk"
os_list = ["windows"]
reference = [
    "https://docs.microsoft.com/en-us/windows/win32/setupapi/run-and-runonce-registry-keys",
    "https://thedfirreport.com/2021/03/29/sodinokibi-aka-revil-ransomware/",
]
version = "1.0.36"

query = '''
registry where registry.data.strings != null and
    user.id : ("S-1-5-21*", "S-1-12-*") and
    registry.path : (
      "*\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
      "*\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\*",
      "*\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx\\*",
      "*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
      "*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\*",
      "*\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*",
      "*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*"
    ) and
  startswith(registry.value, "*") and
  /* Issue #318 */
  not (process.name : "Lmi_*.exe" and registry.value : "*LogMeInRescue*") and
  not (process.name : "G2AC_LauncherCustomer.exe" and registry.value : "*GoToAssist*") and
  not (process.name : "G2AC_SessionControl.exe" and registry.value : "*GoToAssist") and
  not (process.code_signature.subject_name == "GoTo Technologies USA, LLC" and process.code_signature.trusted == true) and
  not process.executable :
           ("?:\\Windows\\System32\\mmc.exe",
            "?:\\WINDOWS\\system32\\rstrui.exe",
            "?:\\Program Files (x86)\\*.exe",
            "?:\\WINDOWS\\System32\\dllhost.exe",
            "?:\\Windows\\System32\\msiexec.exe",
            "?:\\Program Files\\*.exe")
'''

min_endpoint_version = "8.0.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1547"
name = "Boot or Logon Autostart Execution"
reference = "https://attack.mitre.org/techniques/T1547/"
[[threat.technique.subtechnique]]
id = "T1547.001"
name = "Registry Run Keys / Startup Folder"
reference = "https://attack.mitre.org/techniques/T1547/001/"



[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"

[internal]
min_endpoint_version = "8.0.0"

Stages and Predicates

Stage 1: registry

registry where registry.data.strings != null and
    user.id : ("S-1-5-21*", "S-1-12-*") and
    registry.path : (
      "*\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
      "*\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\*",
      "*\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnceEx\\*",
      "*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Run\\*",
      "*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\RunOnce\\*",
      "*\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*",
      "*\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run\\*"
    ) and
  startswith(registry.value, "*") and
  not (process.name : "Lmi_*.exe" and registry.value : "*LogMeInRescue*") and
  not (process.name : "G2AC_LauncherCustomer.exe" and registry.value : "*GoToAssist*") and
  not (process.name : "G2AC_SessionControl.exe" and registry.value : "*GoToAssist") and
  not (process.code_signature.subject_name == "GoTo Technologies USA, LLC" and process.code_signature.trusted == true) and
  not process.executable :
           ("?:\\Windows\\System32\\mmc.exe",
            "?:\\WINDOWS\\system32\\rstrui.exe",
            "?:\\Program Files (x86)\\*.exe",
            "?:\\WINDOWS\\System32\\dllhost.exe",
            "?:\\Windows\\System32\\msiexec.exe",
            "?:\\Program Files\\*.exe")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
registry.data.stringsis_not_null
  • (no value, null check)
field:"Details" kind:is_not_null
registry.pathwildcard
  • *\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run\* corpus 3 (elastic 3)
  • *\Software\Microsoft\Windows\CurrentVersion\RunOnceEx\* corpus 2 (elastic 2)
  • *\Software\Microsoft\Windows\CurrentVersion\RunOnce\* corpus 2 (elastic 2)
  • *\Software\Microsoft\Windows\CurrentVersion\Run\* corpus 3 (elastic 3)
  • *\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run\* corpus 3 (elastic 3)
  • *\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\RunOnce\* corpus 2 (elastic 2)
  • *\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run\* corpus 3 (elastic 3)
field:"TargetObject" kind:wildcard
registry.valuestarts_with
  • *
field:"registry_value_name" kind:starts_with value:"*"
user.idwildcard
  • S-1-12-* corpus 25 (elastic 25)
  • S-1-5-21* corpus 26 (elastic 26)
field:"user.id" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.code_signature.subject_nameeqGoTo Technologies USA, LLCexcludes:process.code_signature.subject_name field:"process.code_signature.subject_name" value:"GoTo Technologies USA, LLC"
process.code_signature.trustedeqtrueexcludes:process.code_signature.trusted field:"process.code_signature.trusted" value:"true"
process.nameeqG2AC_LauncherCustomer.exeexcludes:process.name field:"process.name" value:"G2AC_LauncherCustomer.exe"
registry.valuematchGoToAssistexcludes:registry.value field:"registry.value" value:"GoToAssist"
process.nameeqG2AC_SessionControl.exeexcludes:process.name field:"process.name" value:"G2AC_SessionControl.exe"
registry.valueends_withGoToAssistexcludes:registry.value field:"registry.value" value:"GoToAssist"
process.namewildcardLmi_*.exeexcludes:process.name field:"process.name" value:"Lmi_*.exe"
registry.valuematchLogMeInRescueexcludes:registry.value field:"registry.value" value:"LogMeInRescue"
process.executablewildcard?:\Windows\System32\mmc.exe, ?:\WINDOWS\system32\rstrui.exe, ?:\Program Files (x86)\*.exe, ?:\WINDOWS\System32\dllhost.exe, ?:\Windows\System32\msiexec.exe, ?:\Program Files\*.exeexcludes:process.executable

Scheduled Task from a Browser or Compression Utility Descendant

#
Time window
5m
Sequence by
Effective_process.entity_id, process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies the creation of a scheduled task by a descendant of a browser or compression utility. This behavior is consistent with an adversary attempting to establish persistence after initial access via malicious user execution.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the creation of a scheduled task by a descendant of a browser or compression utility. This behavior is
consistent with an adversary attempting to establish persistence after initial access via malicious user execution.
"""
id = "21cd57eb-b211-4f06-8e4e-cdafa4fdb8ca"
license = "Elastic License v2"
name = "Scheduled Task from a Browser or Compression Utility Descendant"
os_list = ["windows"]
reference = ["https://docs.microsoft.com/en-us/windows/win32/taskschd/daily-trigger-example--xml-"]
version = "1.0.20"

query = '''
sequence with maxspan=5m
 [process where event.action == "start" and
 (process.Ext.relative_file_creation_time <= 1800 or process.Ext.relative_file_name_modify_time <= 1800) and
 (process.code_signature.trusted == false or process.code_signature.exists==false) and
 not process.code_signature.status : ("errorExpired", "errorCode_endpoint*") and

 /* Direct Child */
 (
  (process.executable : ("?:\\Users\\*\\Downloads\\*", "*\\AppData\\Local\\Temp\\*") and
   process.parent.name: ("explorer.exe", "chrome.exe", "msedge.exe", "firefox.exe", "7zFM.exe", "iexplore.exe", "winrar.exe")) or

 /* Descendant */
  descendant of [
  process where event.action == "start" and
  (process.code_signature.trusted == false or process.code_signature.exists==false)
  and process.parent.name: ("explorer.exe", "chrome.exe", "msedge.exe", "firefox.exe", "7zFM.exe", "iexplore.exe", "winrar.exe") and
  process.executable: ("*\\Downloads\\*", "*\\AppData\\Local\\Temp\\*") and
  process.pe.original_file_name != "Adobe Installer" and
  not process.hash.sha256 :
                  ("aaeaae8a88cab0ff1401e8c8e0fca3d92c758844e17b198355951c8fc842ccaa",
                   "62925978d2c0de2c69801302eb7040cb633068a44cd83415d15f8c25f5bebff6",
                   "be7beb3d9b8c56e1395bfee0d31503e0156eeba0312d385ca77068b95d1d4bea",
                   "c3ab138aa176fda1a43e3a38d376e8ec284b610d9dacb9db0d08e503d071e4fe",
                   "52e1e3053aadaccf78837dffaaa6f9ed41b201e0019f22a4880a5327d7650206",
                   "a6296af76588a81448c2e7dced89daa29a4eba92a0ce7e5da2b868cd6e511bda")
  ]
 ) and
 not (process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and process.code_signature.trusted == true) and
 process.pe.imphash != "28a18f58924d2f4dd2bffbbc85a12952"
 ] by process.entity_id
 [file where event.action : "creation" and process.name : "svchost.exe" and
  file.path : ("?:\\Windows\\Tasks\\*", "?:\\Windows\\System32\\Tasks\\*")] by Effective_process.entity_id
'''

min_endpoint_version = "8.6.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1053"
name = "Scheduled Task/Job"
reference = "https://attack.mitre.org/techniques/T1053/"
[[threat.technique.subtechnique]]
id = "T1053.005"
name = "Scheduled Task"
reference = "https://attack.mitre.org/techniques/T1053/005/"



[threat.tactic]
id = "TA0003"
name = "Persistence"
reference = "https://attack.mitre.org/tactics/TA0003/"

[internal]
min_endpoint_version = "8.6.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5m, correlated by Effective_process.entity_id, process.entity_id.

Stage 1: process

[process where event.action == "start" and
 (process.Ext.relative_file_creation_time <= 1800 or process.Ext.relative_file_name_modify_time <= 1800) and
 (process.code_signature.trusted == false or process.code_signature.exists==false) and
 not process.code_signature.status : ("errorExpired", "errorCode_endpoint*") and
 (
  (process.executable : ("?:\\Users\\*\\Downloads\\*", "*\\AppData\\Local\\Temp\\*") and
   process.parent.name: ("explorer.exe", "chrome.exe", "msedge.exe", "firefox.exe", "7zFM.exe", "iexplore.exe", "winrar.exe")) or
  descendant of [
  process where event.action == "start" and
  (process.code_signature.trusted == false or process.code_signature.exists==false)
  and process.parent.name: ("explorer.exe", "chrome.exe", "msedge.exe", "firefox.exe", "7zFM.exe", "iexplore.exe", "winrar.exe") and
  process.executable: ("*\\Downloads\\*", "*\\AppData\\Local\\Temp\\*") and
  process.pe.original_file_name != "Adobe Installer" and
  not process.hash.sha256 :
                  ("aaeaae8a88cab0ff1401e8c8e0fca3d92c758844e17b198355951c8fc842ccaa",
                   "62925978d2c0de2c69801302eb7040cb633068a44cd83415d15f8c25f5bebff6",
                   "be7beb3d9b8c56e1395bfee0d31503e0156eeba0312d385ca77068b95d1d4bea",
                   "c3ab138aa176fda1a43e3a38d376e8ec284b610d9dacb9db0d08e503d071e4fe",
                   "52e1e3053aadaccf78837dffaaa6f9ed41b201e0019f22a4880a5327d7650206",
                   "a6296af76588a81448c2e7dced89daa29a4eba92a0ce7e5da2b868cd6e511bda")
  ]
 ) and
 not (process.executable : ("?:\\Program Files\\*", "?:\\Program Files (x86)\\*") and process.code_signature.trusted == true) and
 process.pe.imphash != "28a18f58924d2f4dd2bffbbc85a12952"
 ] by process.entity_id

Stage 2: file

[file where event.action : "creation" and process.name : "svchost.exe" and
  file.path : ("?:\\Windows\\Tasks\\*", "?:\\Windows\\System32\\Tasks\\*")] by Effective_process.entity_id

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
event.actionwildcard
  • creation corpus 8 (elastic 8)
field:"EventType" kind:wildcard value:"creation"
file.pathwildcard
  • ?:\Windows\System32\Tasks\* corpus 6 (elastic 6)
  • ?:\Windows\Tasks\* corpus 7 (elastic 7)
field:"TargetFilename" kind:wildcard
process.Ext.relative_file_creation_timele
  • 1800 transforms: number corpus 6 (elastic 6)
field:"process.Ext.relative_file_creation_time" kind:le value:"1800"
process.Ext.relative_file_name_modify_timele
  • 1800 transforms: number corpus 6 (elastic 6)
field:"process.Ext.relative_file_name_modify_time" kind:le value:"1800"
process.code_signature.existseq
  • false transforms: boolean corpus 118 (elastic 118)
field:"process.code_signature.exists" kind:eq value:"false"
process.code_signature.trustedeq
  • false transforms: boolean corpus 114 (elastic 114)
field:"process.code_signature.trusted" kind:eq value:"false"
process.executablewildcard
  • *\AppData\Local\Temp\* corpus 3 (elastic 3)
  • ?:\Users\*\Downloads\* corpus 12 (elastic 12)
field:"Image" kind:wildcard
process.namewildcard
  • svchost.exe corpus 21 (elastic 20, splunk 1)
field:"process_basename" kind:wildcard value:"svchost.exe"
process.parent.namewildcard
  • 7zFM.exe corpus 12 (elastic 12)
  • chrome.exe corpus 9 (elastic 9)
  • explorer.exe corpus 50 (elastic 50)
  • firefox.exe corpus 9 (elastic 9)
  • iexplore.exe corpus 8 (elastic 8)
  • msedge.exe corpus 7 (elastic 7)
  • winrar.exe corpus 15 (elastic 14, splunk 1)
field:"parent_process_basename" kind:wildcard
process.pe.imphashne
  • 28a18f58924d2f4dd2bffbbc85a12952 corpus 2 (elastic 2)
field:"Imphash" kind:ne value:"28a18f58924d2f4dd2bffbbc85a12952"

Exclusions

The rule actively suppresses these predicates.

Suspicious Network Connection via Installer Package

#
Time window
30s
Sequence by
user.id
Source
github.com/elastic/protections-artifacts

Detects the execution of a MacOS installer package with an abnormal child process (e.g bash) followed immediately by a network connection via a suspicious process (e.g curl). Threat actors will build and distribute malicious MacOS installer packages, which have a .pkg extension, many times imitating valid software in order to persuade and infect their victims often using the package files (e.g pre/post install scripts etc.) to download additional tools or malicious software. If this rule fires it should indicate a the installation of a malicious or suspicious package.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects the execution of a MacOS installer package with an abnormal child process (e.g bash) followed immediately by a
network connection via a suspicious process (e.g curl). Threat actors will build and distribute malicious MacOS
installer packages, which have a .pkg extension, many times imitating valid software in order to persuade and infect
their victims often using the package files (e.g pre/post install scripts etc.) to download additional tools or
malicious software. If this rule fires it should indicate a the installation of a malicious or suspicious package.
"""
id = "912f0c30-a7c5-40a5-80e3-a50c6714632f"
license = "Elastic License v2"
name = "Suspicious Network Connection via Installer Package"
os_list = ["macos"]
reference = ["https://redcanary.com/blog/clipping-silver-sparrows-wings"]
version = "1.0.39"

query = '''
sequence by user.id with maxspan=30s
[process where event.type == "start" and event.action == "exec" and 
  process.parent.name in ("installer", "package_script_service") and 
  process.name like ("bash", "sh", "zsh", "dash", "csh", "tcsh", "ksh", "fish", "python*", "osascript", "tclsh*") and
  process.args like ("/Users/*", "/Volumes/*")] 
[process where event.type == "start" and 
 process.parent.pid == 1 and 
  (process.name in ("curl", "wget", "nscurl") or
  (process.name == "osascript" and process.args like~ "*.js"))] as event1
[network where event.type == "start" and 
 process.name in ("curl", "osascript", "wget", "nscurl") and process.pid == event1.process.pid]
'''

min_endpoint_version = "8.4.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1059"
name = "Command and Scripting Interpreter"
reference = "https://attack.mitre.org/techniques/T1059/"
[[threat.technique.subtechnique]]
id = "T1059.007"
name = "JavaScript"
reference = "https://attack.mitre.org/techniques/T1059/007/"



[threat.tactic]
id = "TA0002"
name = "Execution"
reference = "https://attack.mitre.org/tactics/TA0002/"
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1071"
name = "Application Layer Protocol"
reference = "https://attack.mitre.org/techniques/T1071/"
[[threat.technique.subtechnique]]
id = "T1071.001"
name = "Web Protocols"
reference = "https://attack.mitre.org/techniques/T1071/001/"



[threat.tactic]
id = "TA0011"
name = "Command and Control"
reference = "https://attack.mitre.org/tactics/TA0011/"

[internal]
min_endpoint_version = "8.4.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 30s, correlated by user.id.

Stage 1: process

[process where event.type == "start" and event.action == "exec" and 
  process.parent.name in ("installer", "package_script_service") and 
  process.name like ("bash", "sh", "zsh", "dash", "csh", "tcsh", "ksh", "fish", "python*", "osascript", "tclsh*") and
  process.args like ("/Users/*", "/Volumes/*")]

Stage 2: process

[process where event.type == "start" and 
 process.parent.pid == 1 and 
  (process.name in ("curl", "wget", "nscurl") or
  (process.name == "osascript" and process.args like~ "*.js"))] as event1

Stage 3: network

[network where event.type == "start" and 
 process.name in ("curl", "osascript", "wget", "nscurl") and process.pid == event1.process.pid]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argswildcard
  • *.js corpus 2 (elastic 2)
  • /Users/* corpus 6 (elastic 6)
  • /Volumes/* corpus 5 (elastic 5)
field:"process.args" kind:wildcard
process.nameeq
  • osascript corpus 41 (elastic 41)
field:"process_basename" kind:eq value:"osascript"
process.namein
  • curl corpus 82 (elastic 82)
  • nscurl corpus 41 (elastic 41)
  • osascript corpus 12 (elastic 12)
  • wget corpus 41 (elastic 41)
field:"process_basename" kind:in
process.namewildcard
  • bash corpus 6 (elastic 6)
  • csh corpus 5 (elastic 5)
  • dash corpus 6 (elastic 6)
  • fish corpus 5 (elastic 5)
  • ksh corpus 6 (elastic 6)
  • osascript corpus 2 (elastic 2)
  • python* corpus 22 (elastic 22)
  • sh corpus 6 (elastic 6)
  • tclsh*
  • tcsh corpus 6 (elastic 6)
  • zsh corpus 6 (elastic 6)
field:"process_basename" kind:wildcard
process.parent.namein
  • installer
  • package_script_service
field:"parent_process_basename" kind:in
process.parent.pideq
  • 1 transforms: number
field:"parent_process_id" kind:eq value:"1"
process.pideq
  • event1.process.pid (field reference)
field:"process_id" kind:eq value:"event1.process.pid"

Suspicious Privileged Docker Execution

#
Source
github.com/elastic/protections-artifacts

This rule detects the execution of a docker command in a privileged context to mount the root file system and potentially tamper with the host file system. This may indicate an attempt to escape the container.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
This rule detects the execution of a docker command in a privileged context to mount the root file system and
potentially tamper with the host file system. This may indicate an attempt to escape the container.
"""
id = "7b13c79b-e6ec-4a91-b6cd-bc9c264db0c3"
license = "Elastic License v2"
name = "Suspicious Privileged Docker Execution"
os_list = ["linux", "macos"]
reference = ["https://www.wiz.io/blog/shai-hulud-2-0-ongoing-supply-chain-attack"]
version = "1.0.6"

query = '''
process where event.type == "start" and event.action == "exec" and process.name == "docker" and
process.args == "--privileged" and process.args == "run" and process.args == "-v" and
process.args : "/:/*" and
not (
  process.args like ("docker.elastic.co/beats/elastic-agent*", "/usr/bin/ceph-osd") or
  (process.args == "prepare" and process.args in ("/:/hostfs", "/:/hostfs/")) or
  (process.args == "aktosecurity/mirror-api-logging:k8s_ebpf" and process.args == "akto-api-security-traffic-collector") or
  (process.args == "--name=c3-progenitor" and process.args == "localhost/c3:latest") or
  (process.args == "/usr/sbin/ceph-volume" and process.args == "--group-add=disk" and process.args == "--stop-signal=SIGTERM") or
  (process.args like "eu.gcr.io/revolut-labs/cardfinder*" and process.parent.args == "/srv/cardfinder/cardfinder.sh") or
  process.parent.args == "/usr/local/pf/sbin/netdata-docker-wrapper"
)
'''

min_endpoint_version = "7.15.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1068"
name = "Exploitation for Privilege Escalation"
reference = "https://attack.mitre.org/techniques/T1068/"

[[threat.technique]]
id = "T1611"
name = "Escape to Host"
reference = "https://attack.mitre.org/techniques/T1611/"


[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and event.action == "exec" and process.name == "docker" and
process.args == "--privileged" and process.args == "run" and process.args == "-v" and
process.args : "/:/*" and
not (
  process.args like ("docker.elastic.co/beats/elastic-agent*", "/usr/bin/ceph-osd") or
  (process.args == "prepare" and process.args in ("/:/hostfs", "/:/hostfs/")) or
  (process.args == "aktosecurity/mirror-api-logging:k8s_ebpf" and process.args == "akto-api-security-traffic-collector") or
  (process.args == "--name=c3-progenitor" and process.args == "localhost/c3:latest") or
  (process.args == "/usr/sbin/ceph-volume" and process.args == "--group-add=disk" and process.args == "--stop-signal=SIGTERM") or
  (process.args like "eu.gcr.io/revolut-labs/cardfinder*" and process.parent.args == "/srv/cardfinder/cardfinder.sh") or
  process.parent.args == "/usr/local/pf/sbin/netdata-docker-wrapper"
)

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • exec corpus 547 (elastic 547)
field:"EventType" kind:eq value:"exec"
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.argseq
  • --privileged corpus 2 (elastic 2)
  • -v corpus 2 (elastic 2)
  • run corpus 7 (elastic 7)
field:"process.args" kind:eq
process.argswildcard
  • /:/* corpus 2 (elastic 2)
field:"process.args" kind:wildcard value:"/:/*"
process.nameeq
  • docker corpus 4 (elastic 4)
field:"process_basename" kind:eq value:"docker"

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.argseq--group-add=diskexcludes:process.args field:"process.args" value:"--group-add=disk"
process.argseq--stop-signal=SIGTERMexcludes:process.args field:"process.args" value:"--stop-signal=SIGTERM"
process.argseq/usr/sbin/ceph-volumeexcludes:process.args field:"process.args" value:"/usr/sbin/ceph-volume"
process.argseq--name=c3-progenitorexcludes:process.args field:"process.args" value:"--name=c3-progenitor"
process.argseqlocalhost/c3:latestexcludes:process.args field:"process.args" value:"localhost/c3:latest"
process.argseqakto-api-security-traffic-collectorexcludes:process.args field:"process.args" value:"akto-api-security-traffic-collector"
process.argseqaktosecurity/mirror-api-logging:k8s_ebpfexcludes:process.args field:"process.args" value:"aktosecurity/mirror-api-logging:k8s_ebpf"
process.argseqprepareexcludes:process.args field:"process.args" value:"prepare"
process.argsin/:/hostfs, /:/hostfs/excludes:process.args field:"process.args" value:"/:/hostfs" field:"process.args" value:"/:/hostfs/"
process.argsstarts_witheu.gcr.io/revolut-labs/cardfinderexcludes:process.args field:"process.args" value:"eu.gcr.io/revolut-labs/cardfinder"
process.parent.argseq/srv/cardfinder/cardfinder.shexcludes:process.parent.args field:"process.parent.args" value:"/srv/cardfinder/cardfinder.sh"
process.argswildcarddocker.elastic.co/beats/elastic-agent*, /usr/bin/ceph-osdexcludes:process.args field:"process.args" value:"docker.elastic.co/beats/elastic-agent*" field:"process.args" value:"/usr/bin/ceph-osd"
process.parent.argseq/usr/local/pf/sbin/netdata-docker-wrapperexcludes:process.parent.args field:"process.parent.args" value:"/usr/local/pf/sbin/netdata-docker-wrapper"

Suspicious Unsigned DLL Loaded by a Trusted Process

#
Time window
5s
Sequence by
process.entity_id
Source
github.com/elastic/protections-artifacts

Identifies the load of an unsigned or untrusted DLL by a trusted binary followed by loading a networking DLL from unbacked memory region. This may indicate execution via DLL sideloading.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies the load of an unsigned or untrusted DLL by a trusted binary followed by loading a networking DLL from
unbacked memory region. This may indicate execution via DLL sideloading.
"""
id = "14fbbd38-b858-45fa-8bc5-02a7bfd295e6"
license = "Elastic License v2"
name = "Suspicious Unsigned DLL Loaded by a Trusted Process"
os_list = ["windows"]
reference = [
    "https://www.elastic.co/security-labs/upping-the-ante-detecting-in-memory-threats-with-kernel-call-stacks",
]
version = "1.0.21"

query = '''
sequence by process.entity_id with maxspan=5s
[library where
   (dll.Ext.relative_file_creation_time < 5000 or
    dll.Ext.relative_file_name_modify_time < 5000 or
    (dll.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk","USB *") and not dll.path : "C:\\*")) and
    process.code_signature.trusted == true and
    not dll.code_signature.status : ("trusted", "errorExpired", "errorCode_endpoint*") and
    dll.hash.sha256 != null and 
    not dll.hash.sha256 in ("e99fec7f1f2fe16029b4dbe30a96325efd7265c9cc8672f60945ce943684442d", "a654a64f0fbd2c34fc2b22cb41e2bf4ac32bd15ae6620e6a4198beb5270790f6") and
    (process.thread.Ext.call_stack_summary : "ntdll.dll*" and not process.thread.Ext.call_stack_summary : "*Unbacked*") and
    not dll.path : ("?:\\Windows\\Installer\\*",
                   "?:\\Windows\\System32\\DriverStore\\FileRepository\\*",
                   "?:\\Windows\\SysWOW64\\DriverStore\\FileRepository\\*",
                   "?:\\Program Files\\*",
                   "?:\\Program Files (x86)\\*",
                   "?:\\Windows\\assembly\\*") and
   not process.executable :
             ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe", "?:\\Windows\\Explorer.exe",
              "?:\\Windows\\SysWOW64\\*", "?:\\Windows\\System32\\*", "?:\\Windows\\splwow64.exe", "?:\\Windows\\Microsoft.NET\\*") and

   /* DLL loaded from the process.executable current directory */
   endswith~(substring(dll.path, 0, length(dll.path) - (length(dll.name) + 1)), substring(process.executable, 0, length(process.executable) - (length(process.name) + 1)))]
[library where
  dll.name : ("ws2_32.dll", "wininet.dll", "winhttp.dll") and
  process.thread.Ext.call_stack_summary : "ntdll.dll|kernelbase.dll|Unbacked"]
'''

min_endpoint_version = "8.7.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1574"
name = "Hijack Execution Flow"
reference = "https://attack.mitre.org/techniques/T1574/"
[[threat.technique.subtechnique]]
id = "T1574.001"
name = "DLL"
reference = "https://attack.mitre.org/techniques/T1574/001/"



[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

[internal]
min_endpoint_version = "8.7.0"

Stages and Predicates

Ordered sequence: each step below must occur in order within 5s, correlated by process.entity_id.

Stage 1: library

[library where
   (dll.Ext.relative_file_creation_time < 5000 or
    dll.Ext.relative_file_name_modify_time < 5000 or
    (dll.Ext.device.product_id : ("Virtual DVD-ROM", "Virtual Disk","USB *") and not dll.path : "C:\\*")) and
    process.code_signature.trusted == true and
    not dll.code_signature.status : ("trusted", "errorExpired", "errorCode_endpoint*") and
    dll.hash.sha256 != null and
    not dll.hash.sha256 in ("e99fec7f1f2fe16029b4dbe30a96325efd7265c9cc8672f60945ce943684442d", "a654a64f0fbd2c34fc2b22cb41e2bf4ac32bd15ae6620e6a4198beb5270790f6") and
    (process.thread.Ext.call_stack_summary : "ntdll.dll*" and not process.thread.Ext.call_stack_summary : "*Unbacked*") and
    not dll.path : ("?:\\Windows\\Installer\\*",
                   "?:\\Windows\\System32\\DriverStore\\FileRepository\\*",
                   "?:\\Windows\\SysWOW64\\DriverStore\\FileRepository\\*",
                   "?:\\Program Files\\*",
                   "?:\\Program Files (x86)\\*",
                   "?:\\Windows\\assembly\\*") and
   not process.executable :
             ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe", "?:\\Windows\\Explorer.exe",
              "?:\\Windows\\SysWOW64\\*", "?:\\Windows\\System32\\*", "?:\\Windows\\splwow64.exe", "?:\\Windows\\Microsoft.NET\\*") and
   endswith~(substring(dll.path, 0, length(dll.path) - (length(dll.name) + 1)), substring(process.executable, 0, length(process.executable) - (length(process.name) + 1)))]

Stage 2: library

[library where
  dll.name : ("ws2_32.dll", "wininet.dll", "winhttp.dll") and
  process.thread.Ext.call_stack_summary : "ntdll.dll|kernelbase.dll|Unbacked"]

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
dll.Ext.device.product_idwildcard
  • USB * corpus 3 (elastic 3)
  • Virtual DVD-ROM corpus 3 (elastic 3)
  • Virtual Disk corpus 3 (elastic 3)
field:"dll.Ext.device.product_id" kind:wildcard
dll.Ext.relative_file_creation_timelt
  • 5000 transforms: number corpus 6 (elastic 6)
field:"dll.Ext.relative_file_creation_time" kind:lt value:"5000"
dll.Ext.relative_file_name_modify_timelt
  • 5000 transforms: number corpus 6 (elastic 6)
field:"dll.Ext.relative_file_name_modify_time" kind:lt value:"5000"
dll.hash.sha256is_not_null
  • (no value, null check)
field:"Hashes" kind:is_not_null
dll.namewildcard
  • winhttp.dll corpus 16 (elastic 16)
  • wininet.dll corpus 18 (elastic 18)
  • ws2_32.dll corpus 19 (elastic 19)
field:"dll.name" kind:wildcard
process.code_signature.trustedeq
  • true transforms: boolean corpus 14 (elastic 14)
field:"process.code_signature.trusted" kind:eq value:"true"
process.thread.Ext.call_stack_summarywildcard
  • ntdll.dll* corpus 2 (elastic 2)
  • ntdll.dll|kernelbase.dll|Unbacked corpus 6 (elastic 6)
field:"process.thread.Ext.call_stack_summary" kind:wildcard

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
dll.code_signature.statuswildcardtrusted, errorExpired, errorCode_endpoint*excludes:dll.code_signature.status field:"dll.code_signature.status" value:"trusted" field:"dll.code_signature.status" value:"errorExpired" field:"dll.code_signature.status" value:"errorCode_endpoint*"
dll.hash.sha256ina654a64f0fbd2c34fc2b22cb41e2bf4ac32bd15ae6620e6a4198beb5270790f6, e99fec7f1f2fe16029b4dbe30a96325efd7265c9cc8672f60945ce943684442dexcludes:dll.hash.sha256 field:"dll.hash.sha256" value:"a654a64f0fbd2c34fc2b22cb41e2bf4ac32bd15ae6620e6a4198beb5270790f6" field:"dll.hash.sha256" value:"e99fec7f1f2fe16029b4dbe30a96325efd7265c9cc8672f60945ce943684442d"
dll.pathstarts_with?:\Windows\Installer\, ?:\Windows\System32\DriverStore\FileRepository\, ?:\Windows\SysWOW64\DriverStore\FileRepository\, ?:\Program Files\, ?:\Program Files (x86)\, ?:\Windows\assembly\excludes:dll.path
process.executablewildcard?:\Program Files\*.exe, ?:\Program Files (x86)\*.exe, ?:\Windows\Explorer.exe, ?:\Windows\SysWOW64\*, ?:\Windows\System32\*, ?:\Windows\splwow64.exe, ?:\Windows\Microsoft.NET\*excludes:process.executable
process.thread.Ext.call_stack_summarymatchUnbackedexcludes:process.thread.Ext.call_stack_summary field:"process.thread.Ext.call_stack_summary" value:"Unbacked"

UAC Bypass Attempt via Windows Directory Masquerading

#
Source
github.com/elastic/protections-artifacts

Identifies an attempt to bypass User Account Control (UAC) by masquerading as a Microsoft trusted Windows directory. Attackers may bypass UAC to stealthily execute code with elevated permissions.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies an attempt to bypass User Account Control (UAC) by masquerading as a Microsoft trusted Windows directory.
Attackers may bypass UAC to stealthily execute code with elevated permissions.
"""
id = "adaf95d2-28ce-4880-af16-f3041b624440"
license = "Elastic License v2"
name = "UAC Bypass Attempt via Windows Directory Masquerading"
os_list = ["windows"]
reference = ["https://medium.com/tenable-techblog/uac-bypass-by-mocking-trusted-directories-24a96675f6e"]
version = "1.0.31"

query = '''
process where event.action == "start" and
 process.Ext.token.integrity_level_name == "high" and
  process.args :
         ("?:\\Windows \\System32\\*.exe",
          "?:\\Windows \\SysWOW64\\*.exe",
          "?:\\ Windows*\\System32\\*.exe",
          "?:\\ Windows*\\SysWOW64\\*.exe")
'''

min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[threat.technique.subtechnique]]
id = "T1548.002"
name = "Bypass User Account Control"
reference = "https://attack.mitre.org/techniques/T1548/002/"



[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: process

process where event.action == "start" and
 process.Ext.token.integrity_level_name == "high" and
  process.args :
         ("?:\\Windows \\System32\\*.exe",
          "?:\\Windows \\SysWOW64\\*.exe",
          "?:\\ Windows*\\System32\\*.exe",
          "?:\\ Windows*\\SysWOW64\\*.exe")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.actioneq
  • start corpus 388 (elastic 388)
field:"EventType" kind:eq value:"start"
process.Ext.token.integrity_level_nameeq
  • high corpus 19 (elastic 19)
field:"process.Ext.token.integrity_level_name" kind:eq value:"high"
process.argswildcard
  • ?:\ Windows*\SysWOW64\*.exe
  • ?:\ Windows*\System32\*.exe
  • ?:\Windows \SysWOW64\*.exe
  • ?:\Windows \System32\*.exe
field:"process.args" kind:wildcard

UAC Bypass via ComputerDefaults Execution Hijack

#
Time window
1m
Source
github.com/elastic/protections-artifacts

Identifies attempts to bypass User Account Control (UAC) via ComputerDefaults execution hijack. Attackers bypass UAC to stealthily execute code with elevated permissions.

MITRE ATT&CK Coverage

Rule Body

[rule]
description = """
Identifies attempts to bypass User Account Control (UAC) via ComputerDefaults execution hijack. Attackers bypass UAC to
stealthily execute code with elevated permissions.
"""
id = "7c0048d5-356d-4f69-839e-10c1e194958f"
license = "Elastic License v2"
name = "UAC Bypass via ComputerDefaults Execution Hijack"
os_list = ["windows"]
reference = ["https://github.com/hfiref0x/UACME"]
version = "1.0.33"

query = '''
sequence with maxspan=60s
 [registry where registry.hive == "HKEY_USERS" and
   registry.key : "S-1-5-21-*Classes\\ms-settings\\shell\\open\\command"]
 [process where event.action == "start" and process.parent.name : "ComputerDefaults.exe" and
  process.Ext.token.integrity_level_name == "high" and
  not process.executable :
           ("?:\\Windows\\System32\\WerFault.exe",
            "?:\\Windows\\SysWOW64\\WerFault.exe")]
'''

min_endpoint_version = "7.15.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1

[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 1

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1548"
name = "Abuse Elevation Control Mechanism"
reference = "https://attack.mitre.org/techniques/T1548/"
[[threat.technique.subtechnique]]
id = "T1548.002"
name = "Bypass User Account Control"
reference = "https://attack.mitre.org/techniques/T1548/002/"



[threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[internal]
min_endpoint_version = "7.15.0"

Stages and Predicates

Stage 1: registry

[registry where registry.hive == "HKEY_USERS" and
   registry.key : "S-1-5-21-*Classes\\ms-settings\\shell\\open\\command"]

Stage 2: process

[process where event.action == "start" and process.parent.name : "ComputerDefaults.exe" and
  process.Ext.token.integrity_level_name == "high" and
  not process.executable :
           ("?:\\Windows\\System32\\WerFault.exe",
            "?:\\Windows\\SysWOW64\\WerFault.exe")]

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.executableeq?:\Windows\System32\WerFault.exe, ?:\Windows\SysWOW64\WerFault.exeexcludes:process.executable field:"process.executable" value:"?:\Windows\System32\WerFault.exe" field:"process.executable" value:"?:\Windows\SysWOW64\WerFault.exe"

Unauthorized Scope for Public App OAuth2 Token Grant with Client Credentials

#
Status
production
Severity
medium
Time window
9m
Group by
okta.actor.display_name
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies a failed OAuth 2.0 token grant attempt for a public client app using client credentials. This event is generated when a public client app attempts to exchange a client credentials grant for an OAuth 2.0 access token, but the request is denied due to the lack of required scopes. This could indicate compromised client credentials in which an adversary is attempting to obtain an access token for unauthorized scopes. This is a New Terms rule where the okta.actor.display_name field value has not been seen in the last 14 days regarding this event.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2024/09/11"
integration = ["okta"]
maturity = "production"
updated_date = "2026/04/10"

[rule]
author = ["Elastic"]
description = """
Identifies a failed OAuth 2.0 token grant attempt for a public client app using client credentials. This event is
generated when a public client app attempts to exchange a client credentials grant for an OAuth 2.0 access token, but
the request is denied due to the lack of required scopes. This could indicate compromised client credentials in which an
adversary is attempting to obtain an access token for unauthorized scopes. This is a [New
Terms](https://www.elastic.co/guide/en/security/current/rules-ui-create.html#create-new-terms-rule) rule where the
`okta.actor.display_name` field value has not been seen in the last 14 days regarding this event.
"""
from = "now-9m"
index = ["filebeat-*", "logs-okta*"]
language = "kuery"
license = "Elastic License v2"
name = "Unauthorized Scope for Public App OAuth2 Token Grant with Client Credentials"
note = """## Triage and analysis

> **Disclaimer**:
> 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.

### Investigating Unauthorized Scope for Public App OAuth2 Token Grant with Client Credentials

OAuth 2.0 is a protocol for authorization, allowing apps to access resources on behalf of users. Public client apps, lacking secure storage, use client credentials for token grants. Adversaries may exploit compromised credentials to request unauthorized scopes. The detection rule identifies failed token grants due to scope mismatches, signaling potential misuse of client credentials.

### Possible investigation steps

- Review the `okta.actor.display_name` field to identify the public client app involved in the failed token grant attempt and determine if it is a known or expected application.
- Examine the `okta.debug_context.debug_data.flattened.requestedScopes` field to understand which unauthorized scopes were requested and assess their potential impact if accessed.
- Investigate the `okta.actor.type` field to confirm that the actor is indeed a public client app, which lacks secure storage, and evaluate the risk of compromised credentials.
- Check the `okta.outcome.reason` field for "no_matching_scope" to verify that the failure was due to a scope mismatch, indicating an attempt to access unauthorized resources.
- Analyze the `okta.client.user_agent.raw_user_agent` field to ensure the request did not originate from known Okta integrations, which are excluded from the rule, to rule out false positives.
- Correlate the event with other security logs or alerts to identify any patterns or additional suspicious activities related to the same client credentials or IP address.

### False positive analysis

- Frequent legitimate access attempts by known public client apps may trigger false positives. To manage this, consider creating exceptions for specific `okta.actor.display_name` values that are known to frequently request scopes without malicious intent.
- Automated processes or integrations that use client credentials might occasionally request scopes not typically associated with their function. Review these processes and, if deemed non-threatening, exclude their `okta.client.user_agent.raw_user_agent` from triggering the rule.
- Development or testing environments often simulate various OAuth 2.0 token grant scenarios, which can result in false positives. Identify and exclude these environments by their `okta.actor.display_name` or other distinguishing attributes.
- Regularly review and update the list of non-threatening scopes in `okta.debug_context.debug_data.flattened.requestedScopes` to ensure that legitimate scope requests are not flagged as unauthorized.

### Response and remediation

- Immediately revoke the compromised client credentials to prevent further unauthorized access attempts.
- Conduct a thorough review of the affected public client app's access logs to identify any successful unauthorized access or data exfiltration attempts.
- Notify the application owner and relevant security teams about the incident to ensure coordinated response efforts.
- Implement additional monitoring on the affected app and associated user accounts to detect any further suspicious activities.
- Update and enforce stricter access controls and scope permissions for public client apps to minimize the risk of unauthorized scope requests.
- Consider implementing multi-factor authentication (MFA) for accessing sensitive resources to add an additional layer of security.
- Escalate the incident to the security operations center (SOC) for further investigation and to determine if broader organizational impacts exist."""
references = [
    "https://github.blog/news-insights/company-news/security-alert-stolen-oauth-user-tokens/",
    "https://developer.okta.com/docs/reference/api/event-types/",
    "https://www.elastic.co/security-labs/monitoring-okta-threats-with-elastic-security",
    "https://www.elastic.co/security-labs/starter-guide-to-understanding-okta",
]
risk_score = 47
rule_id = "6649e656-6f85-11ef-8876-f661ea17fbcc"
severity = "medium"
tags = [
    "Domain: SaaS",
    "Data Source: Okta",
    "Use Case: Threat Detection",
    "Use Case: Identity and Access Audit",
    "Tactic: Defense Evasion",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "new_terms"

query = '''
data_stream.dataset: okta.system
    and event.action: "app.oauth2.as.token.grant"
    and okta.actor.type: "PublicClientApp"
    and okta.debug_context.debug_data.flattened.grantType: "client_credentials"
    and okta.outcome.result: "FAILURE"
    and not okta.client.user_agent.raw_user_agent: "Okta-Integrations"
    and not okta.actor.display_name: (Okta* or Datadog)
    and not okta.debug_context.debug_data.flattened.requestedScopes: ("okta.logs.read" or "okta.eventHooks.read" or "okta.inlineHooks.read")
    and okta.outcome.reason: "no_matching_scope"
'''


[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"

[[rule.threat.technique.subtechnique]]
id = "T1078.004"
name = "Cloud Accounts"
reference = "https://attack.mitre.org/techniques/T1078/004/"

[[rule.threat.technique]]
id = "T1550"
name = "Use Alternate Authentication Material"
reference = "https://attack.mitre.org/techniques/T1550/"

[[rule.threat.technique.subtechnique]]
id = "T1550.001"
name = "Application Access Token"
reference = "https://attack.mitre.org/techniques/T1550/001/"

[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[rule.new_terms]
field = "new_terms_fields"
value = ["okta.actor.display_name"]
[[rule.new_terms.history_window_start]]
field = "history_window_start"
value = "now-14d"


Stages and Predicates

Stage 1: new_terms

data_stream.dataset: okta.system
    and event.action: "app.oauth2.as.token.grant"
    and okta.actor.type: "PublicClientApp"
    and okta.debug_context.debug_data.flattened.grantType: "client_credentials"
    and okta.outcome.result: "FAILURE"
    and not okta.client.user_agent.raw_user_agent: "Okta-Integrations"
    and not okta.actor.display_name: (Okta* or Datadog)
    and not okta.debug_context.debug_data.flattened.requestedScopes: ("okta.logs.read" or "okta.eventHooks.read" or "okta.inlineHooks.read")
    and okta.outcome.reason: "no_matching_scope"

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

Unusual Source IP for Windows Privileged Operations Detected

#
Status
production
Severity
low
Author
Elastic
Source
github.com/elastic/detection-rules

A machine learning job has identified a user performing privileged operations in Windows from an uncommon source IP, indicating potential privileged access activity. This could suggest an account compromise, misuse of administrative privileges, or an attacker leveraging a new network location to escalate privileges.

MITRE ATT&CK Coverage

TacticTechniques
Initial Access
Privilege Escalation

Rule Body

[metadata]
creation_date = "2025/02/18"
integration = ["pad", "system"]
maturity = "production"
updated_date = "2026/07/27"
min_stack_version = "9.4.0"
min_stack_comments = "Use EA (Entity Analytics) fields"

[rule]
anomaly_threshold = 75
author = ["Elastic"]
description = """
A machine learning job has identified a user performing privileged operations in Windows from an uncommon source IP,
indicating potential privileged access activity. This could suggest an account compromise, misuse of administrative
privileges, or an attacker leveraging a new network location to escalate privileges.
"""
from = "now-1h"
interval = "15m"
license = "Elastic License v2"
machine_learning_job_id = "pad_windows_rare_source_ip_by_user_ea"
name = "Unusual Source IP for Windows Privileged Operations Detected"
note = """## Triage and analysis

> **Disclaimer**:
> 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.

### Investigating Unusual Source IP for Windows Privileged Operations Detected

Machine learning models analyze network patterns to identify anomalies, such as privileged operations from uncommon IPs. Adversaries may exploit this by using compromised accounts or new network locations to escalate privileges. This detection rule leverages ML to flag such deviations, indicating potential misuse or compromise, aiding in early threat identification and response.

### Possible investigation steps

- Review the source IP address flagged by the alert to determine if it is associated with known or trusted locations, such as corporate offices or VPN endpoints.
- Check the user account involved in the alert for any recent changes or unusual activity, such as password resets, privilege changes, or login attempts from other uncommon locations.
- Analyze the timeline of the privileged operations performed to identify any patterns or sequences that may indicate malicious intent or unauthorized access.
- Correlate the alert with other security events or logs, such as firewall logs, VPN logs, or endpoint security alerts, to gather additional context about the source IP and user activity.
- Investigate any recent changes in network configurations or access policies that might explain the unusual source IP, such as new VPN configurations or changes in IP address allocations.

### False positive analysis

- Employees working remotely or traveling may trigger alerts due to accessing systems from new IP addresses. Regularly update the list of known IP addresses for remote workers to reduce false positives.
- Use of VPNs or proxy services can result in unusual IP addresses being flagged. Maintain a whitelist of IP addresses associated with approved VPN or proxy services.
- Scheduled maintenance or administrative tasks performed by IT staff from different network locations might be misidentified. Document and exclude these known activities from triggering alerts.
- Cloud service providers often use dynamic IP ranges that can appear unusual. Identify and whitelist IP ranges associated with trusted cloud services to prevent unnecessary alerts.
- Implement a review process for flagged events to quickly identify and dismiss benign activities, ensuring that only genuine threats are escalated for further investigation.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized access or lateral movement by the adversary.
- Verify the legitimacy of the source IP by cross-referencing with known IP addresses and geolocations associated with the user. If the IP is confirmed to be malicious, block it at the firewall and update threat intelligence feeds.
- Reset the credentials of the compromised account and enforce a password change for all accounts with similar access levels to prevent further unauthorized access.
- Conduct a thorough review of recent privileged operations performed by the affected account to identify any unauthorized changes or data access, and revert any malicious modifications.
- Escalate the incident to the security operations center (SOC) for further investigation and to determine if additional systems or accounts have been compromised.
- Implement additional monitoring on the affected system and user account to detect any further suspicious activity, leveraging enhanced logging and alerting mechanisms.
- Review and update access controls and privilege management policies to ensure that only necessary privileges are granted, reducing the risk of privilege escalation in the future."""
references = [
    "https://www.elastic.co/guide/en/security/current/prebuilt-ml-jobs.html",
    "https://docs.elastic.co/en/integrations/pad",
]
risk_score = 21
rule_id = "08be5599-3719-4bbd-8cbc-7e9cff556881"
setup = """## Setup

The rule requires the Privileged Access Detection integration assets to be installed, as well as Windows logs collected by the System integration.

### Privileged Access Detection Setup
The Privileged Access Detection integration detects privileged access activity by identifying abnormalities in Windows, Linux and Okta events. Anomalies are detected using Elastic's Anomaly Detection feature.

#### Prerequisite Requirements:
- Fleet is required for Privileged Access Detection.
- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html).
- Windows events collected by the [System](https://docs.elastic.co/en/integrations/system) integration.
- To add the System integration to an Elastic Agent policy, refer to [this](https://www.elastic.co/guide/en/fleet/current/add-integration-to-policy.html) guide.

#### The following steps should be executed to install assets associated with the Privileged Access Detection integration:
- Go to the Kibana homepage. Under Management, click Integrations.
- In the query bar, search for Privileged Access Detection and select the integration to see more details about it.
- Follow the instructions under the **Installation** section.
- For this rule to work, complete the instructions through **Add preconfigured anomaly detection jobs**.
"""
severity = "low"
tags = [
    "Data Source: Windows Security Event Logs",
    "Use Case: Privileged Access Detection",
    "Rule Type: ML",
    "Rule Type: Machine Learning",
    "Tactic: Privilege Escalation",
    "Resources: Investigation Guide",
]
type = "machine_learning"
[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"

[rule.threat.tactic]
id = "TA0004"
name = "Privilege Escalation"
reference = "https://attack.mitre.org/tactics/TA0004/"

[[rule.threat]]
framework = "MITRE ATT&CK"

[[rule.threat.technique]]
id = "T1078"
name = "Valid Accounts"
reference = "https://attack.mitre.org/techniques/T1078/"

[rule.threat.tactic]
id = "TA0001"
name = "Initial Access"
reference = "https://attack.mitre.org/tactics/TA0001/"

User Keychain DB Access by Self-Signed Binary

#
Source
github.com/elastic/protections-artifacts

Detects when a self-signed binary (signed with native CodeSign tool) attempts to open the user's Keychain DB. This activity is not normal and should be considered suspicious. The macOS keychain is highly sought after and targeted by threat actors as it contains sensitive credential data that can be used to further compromise a user or environment.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[rule]
description = """
Detects when a self-signed binary (signed with native CodeSign tool) attempts to open the user's Keychain DB. This
activity is not normal and should be considered suspicious. The macOS keychain is highly sought after and targeted by
threat actors as it contains sensitive credential data that can be used to further compromise a user or environment.
"""
id = "af71383d-f843-468a-b365-c202a547bc65"
license = "Elastic License v2"
name = "User Keychain DB Access by Self-Signed Binary"
os_list = ["macos"]
reference = ["https://attack.mitre.org/techniques/T1555/001/", "https://github.com/MythicAgents/poseidon"]
version = "1.0.14"

query = '''
file where event.action == "open" and file.name like "login.keychain-db" and 
 process.code_signature.trusted == false and 
 process.code_signature.signing_id regex~ """[A-Za-z0-9\_\s]{2,}\-[a-z0-9]{40}""" and 
 not process.executable like ("/opt/homebrew/*", "/usr/local/Cellar/*") and 
 not process.code_signature.signing_id like~ ("python-*", 
                                              "python3-*", 
                                              "apphost-*", 
                                              "laclient-*",
                                              "emulator-*",
                                              "eclipse-*",
                                              "mksdcard-*",
                                              "MicrosoftSqlToolsServiceLayer-*",
                                              "binary-*", 
                                              "ruby-*",
                                              "rg-*", 
                                              "jspawnhelper-*",
                                              "dotnet-*") and 
not Effective_process.executable like ("/Users/*/Library/Application Support/Claude/claude-code/*/claude.app/Contents/MacOS/claude", "/Applications/Claude.app/Contents/MacOS/Claude") and 
not process.executable == "/usr/local/bin/symfony"
'''

min_endpoint_version = "8.11.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1555"
name = "Credentials from Password Stores"
reference = "https://attack.mitre.org/techniques/T1555/"
[[threat.technique.subtechnique]]
id = "T1555.001"
name = "Keychain"
reference = "https://attack.mitre.org/techniques/T1555/001/"



[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

[internal]
min_endpoint_version = "8.11.0"

Stages and Predicates

Stage 1: file

file where event.action == "open" and file.name like "login.keychain-db" and 
 process.code_signature.trusted == false and 
 process.code_signature.signing_id regex~ """[A-Za-z0-9\_\s]{2,}\-[a-z0-9]{40}""" and 
 not process.executable like ("/opt/homebrew/*", "/usr/local/Cellar/*") and 
 not process.code_signature.signing_id like~ ("python-*", 
                                              "python3-*", 
                                              "apphost-*", 
                                              "laclient-*",
                                              "emulator-*",
                                              "eclipse-*",
                                              "mksdcard-*",
                                              "MicrosoftSqlToolsServiceLayer-*",
                                              "binary-*", 
                                              "ruby-*",
                                              "rg-*", 
                                              "jspawnhelper-*",
                                              "dotnet-*") and 
not Effective_process.executable like ("/Users/*/Library/Application Support/Claude/claude-code/*/claude.app/Contents/MacOS/claude", "/Applications/Claude.app/Contents/MacOS/Claude") and 
not process.executable == "/usr/local/bin/symfony"

Indicators

These rows show field, operator, and value matches.

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
Effective_process.executablewildcard/Users/*/Library/Application Support/Claude/claude-code/*/claude.app/Contents/MacOS/claude, /Applications/Claude.app/Contents/MacOS/Claudeexcludes:Effective_process.executable field:"Effective_process.executable" value:"/Users/*/Library/Application Support/Claude/claude-code/*/claude.app/Contents/MacOS/claude" field:"Effective_process.executable" value:"/Applications/Claude.app/Contents/MacOS/Claude"
process.code_signature.signing_idstarts_withpython-, python3-, apphost-, laclient-, emulator-, eclipse-, mksdcard-, MicrosoftSqlToolsServiceLayer-, binary-, ruby-, rg-, jspawnhelper-, dotnet-excludes:process.code_signature.signing_id
process.executableeq/usr/local/bin/symfonyexcludes:process.executable field:"process.executable" value:"/usr/local/bin/symfony"
process.executablestarts_with/opt/homebrew/, /usr/local/Cellar/excludes:process.executable field:"process.executable" value:"/opt/homebrew/" field:"process.executable" value:"/usr/local/Cellar/"

Windows Sandbox with Sensitive Configuration

#
Status
production
Severity
medium
Time window
9m
Author
Elastic
Source
github.com/elastic/detection-rules

Identifies Windows sanfbox processes indicating the start of a new container with sensitive configurations like write access to the host file system, network connection and automatic execution via logon command. Malware may abuse the sandbox feature to evade detection.

MITRE ATT&CK Coverage

Telemetry Coverage

Rule Body

[metadata]
creation_date = "2025/04/14"
integration = ["endpoint", "windows", "m365_defender", "sentinel_one_cloud_funnel", "crowdstrike"]
maturity = "production"
updated_date = "2026/05/04"

[rule]
author = ["Elastic"]
description = """
Identifies Windows sanfbox processes indicating the start of a new container with sensitive configurations like write
access to the host file system, network connection and automatic execution via logon command. Malware may abuse the
sandbox feature to evade detection.
"""
from = "now-9m"
index = [
    "logs-endpoint.events.process-*",
    "winlogbeat-*",
    "logs-windows.sysmon_operational-*",
    "endgame-*",
    "logs-m365_defender.event-*",
    "logs-sentinel_one_cloud_funnel.*",
    "logs-crowdstrike.fdr*",
]
language = "eql"
license = "Elastic License v2"
name = "Windows Sandbox with Sensitive Configuration"
note = """ ## Triage and analysis

> **Disclaimer**:
> 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.

### Investigating Windows Sandbox with Sensitive Configuration

Windows Sandbox is a lightweight virtual environment designed to safely run untrusted applications. It isolates processes from the host system, preventing permanent changes. However, adversaries can exploit this by configuring the sandbox to access host resources, enabling network connections, or executing commands at startup. The detection rule identifies such misuse by monitoring specific process activities and configurations indicative of potential abuse, such as unauthorized file system access or network enablement, helping analysts spot and mitigate threats effectively.

### Possible investigation steps

- Review the process details for "wsb.exe" or "WindowsSandboxClient.exe" to confirm the start of a new container and check for any unusual command-line arguments that match the query criteria, such as "<Networking>Enable</Networking>" or "<NetworkingEnabled>true>".
- Investigate any file system access attempts by the sandbox, particularly focusing on write access to the host file system indicated by "<HostFolder>C:\\<ReadOnly>false". Determine if any unauthorized or suspicious files have been modified or created.
- Examine network activity associated with the sandbox process to identify any unexpected or unauthorized connections, especially if "<NetworkingEnabled>true>" is present in the command line.
- Check for any logon commands executed by the sandbox process using "<LogonCommand>" in the command line to identify potential persistence mechanisms or automated tasks that could indicate malicious intent.
- Correlate the sandbox activity with other security alerts or logs from data sources like Elastic Endgame, Sysmon, or Microsoft Defender XDR to gather additional context and identify any related suspicious activities.

### False positive analysis

- Legitimate software installations or updates may configure the Windows Sandbox to enable network connections or access host resources. Users can create exceptions for known software update processes to prevent unnecessary alerts.
- Developers and IT administrators might use Windows Sandbox for testing purposes, which could involve enabling network connections or accessing host files. Establishing a list of approved users or processes that frequently perform these actions can help reduce false positives.
- Automated scripts or tools that configure the sandbox for legitimate purposes, such as testing or development, may trigger the rule. Identifying and excluding these scripts from monitoring can minimize false alerts.
- Security tools or system management software might use sandbox features for legitimate operations. Users should verify and whitelist these tools to avoid misidentification as threats.

### Response and remediation

- Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
- Terminate any suspicious processes identified by the detection rule, specifically those related to Windows Sandbox misuse, such as "wsb.exe" or "WindowsSandboxClient.exe".
- Conduct a thorough review of the system's file system and network logs to identify any unauthorized access or data transfers that may have occurred.
- Remove any unauthorized configurations or scripts found within the Windows Sandbox environment that enable network connections or host file system access.
- Restore the system to a known good state using backups or system restore points, ensuring that any malicious changes are reversed.
- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine if additional systems are affected.
- Implement enhanced monitoring and alerting for similar suspicious activities, focusing on process creation and command-line parameters related to Windows Sandbox configurations.
"""

setup = """## Setup

This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.

Setup instructions: https://ela.st/install-elastic-defend

### Additional data sources

This rule also supports the following third-party data sources. For setup instructions, refer to the links below:

- [CrowdStrike](https://ela.st/crowdstrike-integration)
- [Microsoft Defender XDR](https://ela.st/m365-defender)
- [SentinelOne Cloud Funnel](https://ela.st/sentinel-one-cloud-funnel)
- [Sysmon Event ID 1 - Process Creation](https://ela.st/sysmon-event-1-setup)
"""

references = ["https://blog-en.itochuci.co.jp/entry/2025/03/12/140000"]
risk_score = 47
rule_id = "56d9cf6c-46ea-4019-9c7f-b1fdb855fee3"
severity = "medium"
tags = [
    "Domain: Endpoint",
    "OS: Windows",
    "Use Case: Threat Detection",
    "Tactic: Defense Evasion",
    "Data Source: Elastic Endgame",
    "Data Source: Elastic Defend",
    "Data Source: Sysmon",
    "Data Source: Microsoft Defender XDR",
    "Data Source: SentinelOne",
    "Data Source: Crowdstrike",
    "Resources: Investigation Guide",
]
timestamp_override = "event.ingested"
type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
  process.name : ("wsb.exe", "WindowsSandboxClient.exe") and
  process.command_line : ("*<Networking>Enable</Networking>*",
                          "*<HostFolder>C:\\*<ReadOnly>false*",
                          "*<LogonCommand>*",
                          "*<NetworkingEnabled>true*")
'''


[[rule.threat]]
framework = "MITRE ATT&CK"
[[rule.threat.technique]]
id = "T1564"
name = "Hide Artifacts"
reference = "https://attack.mitre.org/techniques/T1564/"
[[rule.threat.technique.subtechnique]]
id = "T1564.006"
name = "Run Virtual Instance"
reference = "https://attack.mitre.org/techniques/T1564/006/"



[rule.threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"

Stages and Predicates

Stage 1: process

process where host.os.type == "windows" and event.type == "start" and
  process.name : ("wsb.exe", "WindowsSandboxClient.exe") and
  process.command_line : ("*<Networking>Enable</Networking>*",
                          "*<HostFolder>C:\\*<ReadOnly>false*",
                          "*<LogonCommand>*",
                          "*<NetworkingEnabled>true*")

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1036 (elastic 1036)
field:"event.type" kind:eq value:"start"
process.command_linewildcard
  • *<HostFolder>C:\*<ReadOnly>false* corpus 2 (elastic 2)
  • *<LogonCommand>* corpus 2 (elastic 2)
  • *<Networking>Enable</Networking>* corpus 2 (elastic 2)
  • *<NetworkingEnabled>true* corpus 2 (elastic 2)
field:"CommandLine" kind:wildcard
process.namewildcard
  • WindowsSandboxClient.exe corpus 2 (elastic 2)
  • wsb.exe corpus 2 (elastic 2)
field:"process_basename" kind:wildcard

Back to all Elastic rules