Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Incorrect is_customized Value on Re-Import of Non-Customized Prebuilt Rule #202613

Open
Tracked by #201502
pborgonovi opened this issue Dec 2, 2024 · 6 comments
Assignees
Labels
8.18 candidate bug Fixes for quality problems that affect the customer experience Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.17.1 v8.18.0 v9.0.0

Comments

@pborgonovi
Copy link
Contributor

pborgonovi commented Dec 2, 2024

Describe the bug:

When re-importing a prebuilt rule and overwriting an existing prebuilt rule in the system, the rule is incorrectly marked as "is_customized": true, even though the re-imported rule has not been customized and matches the original prebuilt version.

Kibana/Elasticsearch Stack version:

8.x

Server OS version:

Browser and Browser OS versions:

Elastic Endpoint version:

Original install method (e.g. download page, yum, from source, etc.):

Functional Area (e.g. Endpoint management, timelines, resolver, etc.):

Pre requisites:

  1. prebuiltRulesCustomizationEnabled Feature flag is ON
  2. Have prebuilt rules installed

Steps to reproduce:

  1. Export a prebuilt rule in its original state
  2. Re-import the original rule by overwriting rule_id

Current behavior:

The re-imported rule is flagged as "is_customized": true despite having all fields in original state.

Expected behavior:

The re-imported rule should correctly be flagged as "is_customized": false

Screenshots (if relevant):

Screen.Recording.2024-12-02.at.3.31.08.PM.mov
{
    "id": "2422eb80-eb9b-4ba1-baba-b7139adbd1c9",
    "updated_at": "2024-12-02T23:31:31.127Z",
    "updated_by": "elastic",
    "created_at": "2024-12-02T18:24:46.699Z",
    "created_by": "elastic",
    "name": "Windows Event Logs Cleared",
    "tags": [
        "Domain: Endpoint",
        "OS: Windows",
        "Use Case: Threat Detection",
        "Tactic: Defense Evasion",
        "Resources: Investigation Guide",
        "Data Source: System"
    ],
    "interval": "5m",
    "enabled": false,
    "revision": 1,
    "description": "Identifies attempts to clear Windows event log stores. This is often done by attackers in an attempt to evade detection or destroy forensic evidence on a system.",
    "risk_score": 21,
    "severity": "low",
    "note": "## Triage and analysis\n\n### Investigating Windows Event Logs Cleared\n\nWindows event logs are a fundamental data source for security monitoring, forensics, and incident response. Adversaries can tamper, clear, and delete this data to break SIEM detections, cover their tracks, and slow down incident response.\n\nThis rule looks for the occurrence of clear actions on the `security` event log.\n\n#### Possible investigation steps\n\n- 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.\n- Identify the user account that performed the action and whether it should perform this kind of action.\n- Contact the account owner and confirm whether they are aware of this activity.\n- Investigate other alerts associated with the user/host during the past 48 hours.\n  - Verify if any other anti-forensics behaviors were observed.\n- Investigate the event logs prior to the action for suspicious behaviors that an attacker may be trying to cover up.\n\n### False positive analysis\n\n- This activity is unlikely to happen legitimately. Benign true positives (B-TPs) can be added as exceptions if necessary.\n\n### Response and remediation\n\n- Initiate the incident response process based on the outcome of the triage.\n  - This activity is potentially done after the adversary achieves its objectives on the host. Ensure that previous actions, if any, are investigated accordingly with their response playbooks.\n- Isolate the involved host to prevent further post-compromise behavior.\n- 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.\n- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.\n- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.\n- 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).\n",
    "license": "Elastic License v2",
    "output_index": "",
    "timestamp_override": "event.ingested",
    "author": [
        "Elastic",
        "Anabella Cristaldi"
    ],
    "false_positives": [],
    "from": "now-9m",
    "rule_id": "45ac4800-840f-414c-b221-53dd36a5aaf7",
    "max_signals": 100,
    "risk_score_mapping": [],
    "severity_mapping": [],
    "threat": [
        {
            "framework": "MITRE ATT&CK",
            "tactic": {
                "id": "TA0005",
                "name": "Defense Evasion",
                "reference": "https://attack.mitre.org/tactics/TA0005/"
            },
            "technique": [
                {
                    "id": "T1070",
                    "name": "Indicator Removal",
                    "reference": "https://attack.mitre.org/techniques/T1070/",
                    "subtechnique": [
                        {
                            "id": "T1070.001",
                            "name": "Clear Windows Event Logs",
                            "reference": "https://attack.mitre.org/techniques/T1070/001/"
                        }
                    ]
                }
            ]
        }
    ],
    "to": "now",
    "references": [],
    "version": 109,
    "exceptions_list": [],
    "immutable": true,
    "rule_source": {
        "type": "external",
        "is_customized": true
    },
    "related_integrations": [
        {
            "package": "system",
            "version": "^1.6.4"
        },
        {
            "package": "windows",
            "version": "^1.5.0"
        }
    ],
    "required_fields": [
        {
            "name": "event.action",
            "type": "keyword",
            "ecs": true
        },
        {
            "name": "winlog.api",
            "type": "keyword",
            "ecs": false
        },
        {
            "name": "winlog.provider_name",
            "type": "keyword",
            "ecs": false
        }
    ],
    "setup": "",
    "type": "query",
    "language": "kuery",
    "index": [
        "winlogbeat-*",
        "logs-system.*",
        "logs-windows.*"
    ],
    "query": "event.action:(\"audit-log-cleared\" or \"Log clear\") and winlog.api:\"wineventlog\" and\n  not winlog.provider_name:\"AD FS Auditing\"\n",
    "actions": []
}

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

Any additional context (logs, chat logs, magical formulas, etc.):

@pborgonovi pborgonovi added bug Fixes for quality problems that affect the customer experience impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team triage_needed labels Dec 2, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@pborgonovi pborgonovi added impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area and removed impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. labels Dec 2, 2024
@banderror banderror assigned dplumlee and unassigned banderror Dec 5, 2024
@banderror
Copy link
Contributor

@pborgonovi Great catch!

@dplumlee Could you please look into this one? I suspect it's the same bug as #201631 and #202575 and could be already fixed by #202824.

@dplumlee
Copy link
Contributor

dplumlee commented Dec 5, 2024

@pborgonovi I'm not able to repro this on a fresh pull of main or 8.x using the same rule you have in the attached video, can you validate?

@pborgonovi
Copy link
Contributor Author

@dplumlee

This is the same situation as 202613: the issue happens when the rule has update available:

Screen.Recording.2024-12-06.at.9.22.50.AM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.18 candidate bug Fixes for quality problems that affect the customer experience Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.17.1 v8.18.0 v9.0.0
Projects
None yet
Development

No branches or pull requests

4 participants