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][Detection Engine] fixes ES|QL data tier filter from adv settings #196390

Merged
merged 5 commits into from
Oct 17, 2024

Conversation

vitaliidm
Copy link
Contributor

@vitaliidm vitaliidm commented Oct 15, 2024

Summary

Demo

Screen.Recording.2024-10-15.at.18.04.43.mov

How to test

Create a deployment with cold and frozen data tiers and use following commands to create index and ILM

Data tiers commands
PUT /_cluster/settings
{
  "persistent": {
    "indices.lifecycle.poll_interval": "1m"
  }
}


PUT /_ilm/policy/filtering_data_tiers
{
  "policy": {
    "phases": {
        "frozen": {
          "min_age": "10m",
          "actions": {
            "searchable_snapshot": {
              "snapshot_repository": "found-snapshots",
              "force_merge_index": true
            }
          }
        },
        "cold": {
          "min_age": "1m",
          "actions": {
            "searchable_snapshot": {
              "snapshot_repository": "found-snapshots",
              "force_merge_index": true
            },
            "set_priority": {
              "priority": 0
            }
          }
        },
        "hot": {
          "min_age": "0ms",
          "actions": {
            "set_priority": {
              "priority": 100
            }
          }
        }
    }
  }
}


PUT /_index_template/filtering_data_tiers_template
{
  "index_patterns": [
    "filtering_data_tiers*"
  ],
  "template": {
    "settings": {
      "index.lifecycle.name": "filtering_data_tiers",
      "index.lifecycle.rollover_alias": "test-filtering_data_tiers"
    },
    "mappings": {
      "_meta": {
        "version": "1.6.0"
      },
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "host": {
          "properties": {
            "name": {
              "type": "keyword",
              "ignore_above": 1024
            }
          }
        }
      }
    }
  }
}

PUT /filtering_data_tiers-000001
{
  "aliases": {
    "filtering_data_tiers": {
      "is_write_index": true
    }
  }
}


POST filtering_data_tiers/_doc
{
  "@timestamp": "2024-07-08T17:00:01.000Z",
  "host.name": "test-0"
}

@vitaliidm vitaliidm added release_note:skip Skip the PR/issue when compiling release notes Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) Team:Detection Engine Security Solution Detection Engine Area v8.16.0 labels Oct 15, 2024
@vitaliidm vitaliidm self-assigned this Oct 15, 2024
@vitaliidm vitaliidm marked this pull request as ready for review October 16, 2024 14:32
@vitaliidm vitaliidm requested review from a team as code owners October 16, 2024 14:32
@vitaliidm vitaliidm requested a review from rylnd October 16, 2024 14:32
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-engine (Team:Detection Engine)

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @vitaliidm

@vitaliidm vitaliidm merged commit c79f0ae into elastic:main Oct 17, 2024
40 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.x

https://github.com/elastic/kibana/actions/runs/11385967571

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 17, 2024
…om adv settings (elastic#196390)

## Summary

- fixes absent data tier filter for ES|QL rule
- followup to elastic#186908

### Demo

https://github.com/user-attachments/assets/a6f1290f-ea77-43bf-8def-42712ca5d1b0

### How to test

Create a deployment with cold and frozen data tiers and use following
commands to create index and ILM

<details>
<summary>Data tiers commands</summary>

```JSON

PUT /_cluster/settings
{
  "persistent": {
    "indices.lifecycle.poll_interval": "1m"
  }
}

PUT /_ilm/policy/filtering_data_tiers
{
  "policy": {
    "phases": {
        "frozen": {
          "min_age": "10m",
          "actions": {
            "searchable_snapshot": {
              "snapshot_repository": "found-snapshots",
              "force_merge_index": true
            }
          }
        },
        "cold": {
          "min_age": "1m",
          "actions": {
            "searchable_snapshot": {
              "snapshot_repository": "found-snapshots",
              "force_merge_index": true
            },
            "set_priority": {
              "priority": 0
            }
          }
        },
        "hot": {
          "min_age": "0ms",
          "actions": {
            "set_priority": {
              "priority": 100
            }
          }
        }
    }
  }
}

PUT /_index_template/filtering_data_tiers_template
{
  "index_patterns": [
    "filtering_data_tiers*"
  ],
  "template": {
    "settings": {
      "index.lifecycle.name": "filtering_data_tiers",
      "index.lifecycle.rollover_alias": "test-filtering_data_tiers"
    },
    "mappings": {
      "_meta": {
        "version": "1.6.0"
      },
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "host": {
          "properties": {
            "name": {
              "type": "keyword",
              "ignore_above": 1024
            }
          }
        }
      }
    }
  }
}

PUT /filtering_data_tiers-000001
{
  "aliases": {
    "filtering_data_tiers": {
      "is_write_index": true
    }
  }
}

POST filtering_data_tiers/_doc
{
  "@timestamp": "2024-07-08T17:00:01.000Z",
  "host.name": "test-0"
}

```

</details>

(cherry picked from commit c79f0ae)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 17, 2024
…om adv settings (elastic#196390)

## Summary

- fixes absent data tier filter for ES|QL rule
- followup to elastic#186908

### Demo

https://github.com/user-attachments/assets/a6f1290f-ea77-43bf-8def-42712ca5d1b0

### How to test

Create a deployment with cold and frozen data tiers and use following
commands to create index and ILM

<details>
<summary>Data tiers commands</summary>

```JSON

PUT /_cluster/settings
{
  "persistent": {
    "indices.lifecycle.poll_interval": "1m"
  }
}

PUT /_ilm/policy/filtering_data_tiers
{
  "policy": {
    "phases": {
        "frozen": {
          "min_age": "10m",
          "actions": {
            "searchable_snapshot": {
              "snapshot_repository": "found-snapshots",
              "force_merge_index": true
            }
          }
        },
        "cold": {
          "min_age": "1m",
          "actions": {
            "searchable_snapshot": {
              "snapshot_repository": "found-snapshots",
              "force_merge_index": true
            },
            "set_priority": {
              "priority": 0
            }
          }
        },
        "hot": {
          "min_age": "0ms",
          "actions": {
            "set_priority": {
              "priority": 100
            }
          }
        }
    }
  }
}

PUT /_index_template/filtering_data_tiers_template
{
  "index_patterns": [
    "filtering_data_tiers*"
  ],
  "template": {
    "settings": {
      "index.lifecycle.name": "filtering_data_tiers",
      "index.lifecycle.rollover_alias": "test-filtering_data_tiers"
    },
    "mappings": {
      "_meta": {
        "version": "1.6.0"
      },
      "properties": {
        "@timestamp": {
          "type": "date"
        },
        "host": {
          "properties": {
            "name": {
              "type": "keyword",
              "ignore_above": 1024
            }
          }
        }
      }
    }
  }
}

PUT /filtering_data_tiers-000001
{
  "aliases": {
    "filtering_data_tiers": {
      "is_write_index": true
    }
  }
}

POST filtering_data_tiers/_doc
{
  "@timestamp": "2024-07-08T17:00:01.000Z",
  "host.name": "test-0"
}

```

</details>

(cherry picked from commit c79f0ae)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.16
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Oct 17, 2024
…ter from adv settings (#196390) (#196699)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution][Detection Engine] fixes ES|QL data tier filter
from adv settings
(#196390)](#196390)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Vitalii
Dmyterko","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-17T13:28:14Z","message":"[Security
Solution][Detection Engine] fixes ES|QL data tier filter from adv
settings (#196390)\n\n## Summary\r\n\r\n- fixes absent data tier filter
for ES|QL rule\r\n- followup to
https://github.com/elastic/kibana/pull/186908\r\n\r\n###
Demo\r\n\r\n\r\nhttps://github.com/user-attachments/assets/a6f1290f-ea77-43bf-8def-42712ca5d1b0\r\n\r\n\r\n\r\n###
How to test\r\n\r\nCreate a deployment with cold and frozen data tiers
and use following\r\ncommands to create index and
ILM\r\n\r\n\r\n<details>\r\n<summary>Data tiers
commands</summary>\r\n\r\n```JSON\r\n\r\nPUT /_cluster/settings\r\n{\r\n
\"persistent\": {\r\n \"indices.lifecycle.poll_interval\": \"1m\"\r\n
}\r\n}\r\n\r\n\r\nPUT /_ilm/policy/filtering_data_tiers\r\n{\r\n
\"policy\": {\r\n \"phases\": {\r\n \"frozen\": {\r\n \"min_age\":
\"10m\",\r\n \"actions\": {\r\n \"searchable_snapshot\": {\r\n
\"snapshot_repository\": \"found-snapshots\",\r\n \"force_merge_index\":
true\r\n }\r\n }\r\n },\r\n \"cold\": {\r\n \"min_age\": \"1m\",\r\n
\"actions\": {\r\n \"searchable_snapshot\": {\r\n
\"snapshot_repository\": \"found-snapshots\",\r\n \"force_merge_index\":
true\r\n },\r\n \"set_priority\": {\r\n \"priority\": 0\r\n }\r\n }\r\n
},\r\n \"hot\": {\r\n \"min_age\": \"0ms\",\r\n \"actions\": {\r\n
\"set_priority\": {\r\n \"priority\": 100\r\n }\r\n }\r\n }\r\n }\r\n
}\r\n}\r\n\r\n\r\nPUT
/_index_template/filtering_data_tiers_template\r\n{\r\n
\"index_patterns\": [\r\n \"filtering_data_tiers*\"\r\n ],\r\n
\"template\": {\r\n \"settings\": {\r\n \"index.lifecycle.name\":
\"filtering_data_tiers\",\r\n \"index.lifecycle.rollover_alias\":
\"test-filtering_data_tiers\"\r\n },\r\n \"mappings\": {\r\n \"_meta\":
{\r\n \"version\": \"1.6.0\"\r\n },\r\n \"properties\": {\r\n
\"@timestamp\": {\r\n \"type\": \"date\"\r\n },\r\n \"host\": {\r\n
\"properties\": {\r\n \"name\": {\r\n \"type\": \"keyword\",\r\n
\"ignore_above\": 1024\r\n }\r\n }\r\n }\r\n }\r\n }\r\n
}\r\n}\r\n\r\nPUT /filtering_data_tiers-000001\r\n{\r\n \"aliases\":
{\r\n \"filtering_data_tiers\": {\r\n \"is_write_index\": true\r\n }\r\n
}\r\n}\r\n\r\n\r\nPOST filtering_data_tiers/_doc\r\n{\r\n
\"@timestamp\": \"2024-07-08T17:00:01.000Z\",\r\n \"host.name\":
\"test-0\"\r\n}\r\n\r\n\r\n```\r\n\r\n</details>","sha":"c79f0ae78633c81beebd3f95735326cc872be7f6","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","backport:prev-minor","Team:Detection
Engine","v8.16.0"],"title":"[Security Solution][Detection Engine] fixes
ES|QL data tier filter from adv
settings","number":196390,"url":"https://github.com/elastic/kibana/pull/196390","mergeCommit":{"message":"[Security
Solution][Detection Engine] fixes ES|QL data tier filter from adv
settings (#196390)\n\n## Summary\r\n\r\n- fixes absent data tier filter
for ES|QL rule\r\n- followup to
https://github.com/elastic/kibana/pull/186908\r\n\r\n###
Demo\r\n\r\n\r\nhttps://github.com/user-attachments/assets/a6f1290f-ea77-43bf-8def-42712ca5d1b0\r\n\r\n\r\n\r\n###
How to test\r\n\r\nCreate a deployment with cold and frozen data tiers
and use following\r\ncommands to create index and
ILM\r\n\r\n\r\n<details>\r\n<summary>Data tiers
commands</summary>\r\n\r\n```JSON\r\n\r\nPUT /_cluster/settings\r\n{\r\n
\"persistent\": {\r\n \"indices.lifecycle.poll_interval\": \"1m\"\r\n
}\r\n}\r\n\r\n\r\nPUT /_ilm/policy/filtering_data_tiers\r\n{\r\n
\"policy\": {\r\n \"phases\": {\r\n \"frozen\": {\r\n \"min_age\":
\"10m\",\r\n \"actions\": {\r\n \"searchable_snapshot\": {\r\n
\"snapshot_repository\": \"found-snapshots\",\r\n \"force_merge_index\":
true\r\n }\r\n }\r\n },\r\n \"cold\": {\r\n \"min_age\": \"1m\",\r\n
\"actions\": {\r\n \"searchable_snapshot\": {\r\n
\"snapshot_repository\": \"found-snapshots\",\r\n \"force_merge_index\":
true\r\n },\r\n \"set_priority\": {\r\n \"priority\": 0\r\n }\r\n }\r\n
},\r\n \"hot\": {\r\n \"min_age\": \"0ms\",\r\n \"actions\": {\r\n
\"set_priority\": {\r\n \"priority\": 100\r\n }\r\n }\r\n }\r\n }\r\n
}\r\n}\r\n\r\n\r\nPUT
/_index_template/filtering_data_tiers_template\r\n{\r\n
\"index_patterns\": [\r\n \"filtering_data_tiers*\"\r\n ],\r\n
\"template\": {\r\n \"settings\": {\r\n \"index.lifecycle.name\":
\"filtering_data_tiers\",\r\n \"index.lifecycle.rollover_alias\":
\"test-filtering_data_tiers\"\r\n },\r\n \"mappings\": {\r\n \"_meta\":
{\r\n \"version\": \"1.6.0\"\r\n },\r\n \"properties\": {\r\n
\"@timestamp\": {\r\n \"type\": \"date\"\r\n },\r\n \"host\": {\r\n
\"properties\": {\r\n \"name\": {\r\n \"type\": \"keyword\",\r\n
\"ignore_above\": 1024\r\n }\r\n }\r\n }\r\n }\r\n }\r\n
}\r\n}\r\n\r\nPUT /filtering_data_tiers-000001\r\n{\r\n \"aliases\":
{\r\n \"filtering_data_tiers\": {\r\n \"is_write_index\": true\r\n }\r\n
}\r\n}\r\n\r\n\r\nPOST filtering_data_tiers/_doc\r\n{\r\n
\"@timestamp\": \"2024-07-08T17:00:01.000Z\",\r\n \"host.name\":
\"test-0\"\r\n}\r\n\r\n\r\n```\r\n\r\n</details>","sha":"c79f0ae78633c81beebd3f95735326cc872be7f6"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196390","number":196390,"mergeCommit":{"message":"[Security
Solution][Detection Engine] fixes ES|QL data tier filter from adv
settings (#196390)\n\n## Summary\r\n\r\n- fixes absent data tier filter
for ES|QL rule\r\n- followup to
https://github.com/elastic/kibana/pull/186908\r\n\r\n###
Demo\r\n\r\n\r\nhttps://github.com/user-attachments/assets/a6f1290f-ea77-43bf-8def-42712ca5d1b0\r\n\r\n\r\n\r\n###
How to test\r\n\r\nCreate a deployment with cold and frozen data tiers
and use following\r\ncommands to create index and
ILM\r\n\r\n\r\n<details>\r\n<summary>Data tiers
commands</summary>\r\n\r\n```JSON\r\n\r\nPUT /_cluster/settings\r\n{\r\n
\"persistent\": {\r\n \"indices.lifecycle.poll_interval\": \"1m\"\r\n
}\r\n}\r\n\r\n\r\nPUT /_ilm/policy/filtering_data_tiers\r\n{\r\n
\"policy\": {\r\n \"phases\": {\r\n \"frozen\": {\r\n \"min_age\":
\"10m\",\r\n \"actions\": {\r\n \"searchable_snapshot\": {\r\n
\"snapshot_repository\": \"found-snapshots\",\r\n \"force_merge_index\":
true\r\n }\r\n }\r\n },\r\n \"cold\": {\r\n \"min_age\": \"1m\",\r\n
\"actions\": {\r\n \"searchable_snapshot\": {\r\n
\"snapshot_repository\": \"found-snapshots\",\r\n \"force_merge_index\":
true\r\n },\r\n \"set_priority\": {\r\n \"priority\": 0\r\n }\r\n }\r\n
},\r\n \"hot\": {\r\n \"min_age\": \"0ms\",\r\n \"actions\": {\r\n
\"set_priority\": {\r\n \"priority\": 100\r\n }\r\n }\r\n }\r\n }\r\n
}\r\n}\r\n\r\n\r\nPUT
/_index_template/filtering_data_tiers_template\r\n{\r\n
\"index_patterns\": [\r\n \"filtering_data_tiers*\"\r\n ],\r\n
\"template\": {\r\n \"settings\": {\r\n \"index.lifecycle.name\":
\"filtering_data_tiers\",\r\n \"index.lifecycle.rollover_alias\":
\"test-filtering_data_tiers\"\r\n },\r\n \"mappings\": {\r\n \"_meta\":
{\r\n \"version\": \"1.6.0\"\r\n },\r\n \"properties\": {\r\n
\"@timestamp\": {\r\n \"type\": \"date\"\r\n },\r\n \"host\": {\r\n
\"properties\": {\r\n \"name\": {\r\n \"type\": \"keyword\",\r\n
\"ignore_above\": 1024\r\n }\r\n }\r\n }\r\n }\r\n }\r\n
}\r\n}\r\n\r\nPUT /filtering_data_tiers-000001\r\n{\r\n \"aliases\":
{\r\n \"filtering_data_tiers\": {\r\n \"is_write_index\": true\r\n }\r\n
}\r\n}\r\n\r\n\r\nPOST filtering_data_tiers/_doc\r\n{\r\n
\"@timestamp\": \"2024-07-08T17:00:01.000Z\",\r\n \"host.name\":
\"test-0\"\r\n}\r\n\r\n\r\n```\r\n\r\n</details>","sha":"c79f0ae78633c81beebd3f95735326cc872be7f6"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Vitalii Dmyterko <[email protected]>
kibanamachine added a commit that referenced this pull request Oct 17, 2024
…lter from adv settings (#196390) (#196698)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Security Solution][Detection Engine] fixes ES|QL data tier filter
from adv settings
(#196390)](#196390)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Vitalii
Dmyterko","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-17T13:28:14Z","message":"[Security
Solution][Detection Engine] fixes ES|QL data tier filter from adv
settings (#196390)\n\n## Summary\r\n\r\n- fixes absent data tier filter
for ES|QL rule\r\n- followup to
https://github.com/elastic/kibana/pull/186908\r\n\r\n###
Demo\r\n\r\n\r\nhttps://github.com/user-attachments/assets/a6f1290f-ea77-43bf-8def-42712ca5d1b0\r\n\r\n\r\n\r\n###
How to test\r\n\r\nCreate a deployment with cold and frozen data tiers
and use following\r\ncommands to create index and
ILM\r\n\r\n\r\n<details>\r\n<summary>Data tiers
commands</summary>\r\n\r\n```JSON\r\n\r\nPUT /_cluster/settings\r\n{\r\n
\"persistent\": {\r\n \"indices.lifecycle.poll_interval\": \"1m\"\r\n
}\r\n}\r\n\r\n\r\nPUT /_ilm/policy/filtering_data_tiers\r\n{\r\n
\"policy\": {\r\n \"phases\": {\r\n \"frozen\": {\r\n \"min_age\":
\"10m\",\r\n \"actions\": {\r\n \"searchable_snapshot\": {\r\n
\"snapshot_repository\": \"found-snapshots\",\r\n \"force_merge_index\":
true\r\n }\r\n }\r\n },\r\n \"cold\": {\r\n \"min_age\": \"1m\",\r\n
\"actions\": {\r\n \"searchable_snapshot\": {\r\n
\"snapshot_repository\": \"found-snapshots\",\r\n \"force_merge_index\":
true\r\n },\r\n \"set_priority\": {\r\n \"priority\": 0\r\n }\r\n }\r\n
},\r\n \"hot\": {\r\n \"min_age\": \"0ms\",\r\n \"actions\": {\r\n
\"set_priority\": {\r\n \"priority\": 100\r\n }\r\n }\r\n }\r\n }\r\n
}\r\n}\r\n\r\n\r\nPUT
/_index_template/filtering_data_tiers_template\r\n{\r\n
\"index_patterns\": [\r\n \"filtering_data_tiers*\"\r\n ],\r\n
\"template\": {\r\n \"settings\": {\r\n \"index.lifecycle.name\":
\"filtering_data_tiers\",\r\n \"index.lifecycle.rollover_alias\":
\"test-filtering_data_tiers\"\r\n },\r\n \"mappings\": {\r\n \"_meta\":
{\r\n \"version\": \"1.6.0\"\r\n },\r\n \"properties\": {\r\n
\"@timestamp\": {\r\n \"type\": \"date\"\r\n },\r\n \"host\": {\r\n
\"properties\": {\r\n \"name\": {\r\n \"type\": \"keyword\",\r\n
\"ignore_above\": 1024\r\n }\r\n }\r\n }\r\n }\r\n }\r\n
}\r\n}\r\n\r\nPUT /filtering_data_tiers-000001\r\n{\r\n \"aliases\":
{\r\n \"filtering_data_tiers\": {\r\n \"is_write_index\": true\r\n }\r\n
}\r\n}\r\n\r\n\r\nPOST filtering_data_tiers/_doc\r\n{\r\n
\"@timestamp\": \"2024-07-08T17:00:01.000Z\",\r\n \"host.name\":
\"test-0\"\r\n}\r\n\r\n\r\n```\r\n\r\n</details>","sha":"c79f0ae78633c81beebd3f95735326cc872be7f6","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","backport:prev-minor","Team:Detection
Engine","v8.16.0"],"title":"[Security Solution][Detection Engine] fixes
ES|QL data tier filter from adv
settings","number":196390,"url":"https://github.com/elastic/kibana/pull/196390","mergeCommit":{"message":"[Security
Solution][Detection Engine] fixes ES|QL data tier filter from adv
settings (#196390)\n\n## Summary\r\n\r\n- fixes absent data tier filter
for ES|QL rule\r\n- followup to
https://github.com/elastic/kibana/pull/186908\r\n\r\n###
Demo\r\n\r\n\r\nhttps://github.com/user-attachments/assets/a6f1290f-ea77-43bf-8def-42712ca5d1b0\r\n\r\n\r\n\r\n###
How to test\r\n\r\nCreate a deployment with cold and frozen data tiers
and use following\r\ncommands to create index and
ILM\r\n\r\n\r\n<details>\r\n<summary>Data tiers
commands</summary>\r\n\r\n```JSON\r\n\r\nPUT /_cluster/settings\r\n{\r\n
\"persistent\": {\r\n \"indices.lifecycle.poll_interval\": \"1m\"\r\n
}\r\n}\r\n\r\n\r\nPUT /_ilm/policy/filtering_data_tiers\r\n{\r\n
\"policy\": {\r\n \"phases\": {\r\n \"frozen\": {\r\n \"min_age\":
\"10m\",\r\n \"actions\": {\r\n \"searchable_snapshot\": {\r\n
\"snapshot_repository\": \"found-snapshots\",\r\n \"force_merge_index\":
true\r\n }\r\n }\r\n },\r\n \"cold\": {\r\n \"min_age\": \"1m\",\r\n
\"actions\": {\r\n \"searchable_snapshot\": {\r\n
\"snapshot_repository\": \"found-snapshots\",\r\n \"force_merge_index\":
true\r\n },\r\n \"set_priority\": {\r\n \"priority\": 0\r\n }\r\n }\r\n
},\r\n \"hot\": {\r\n \"min_age\": \"0ms\",\r\n \"actions\": {\r\n
\"set_priority\": {\r\n \"priority\": 100\r\n }\r\n }\r\n }\r\n }\r\n
}\r\n}\r\n\r\n\r\nPUT
/_index_template/filtering_data_tiers_template\r\n{\r\n
\"index_patterns\": [\r\n \"filtering_data_tiers*\"\r\n ],\r\n
\"template\": {\r\n \"settings\": {\r\n \"index.lifecycle.name\":
\"filtering_data_tiers\",\r\n \"index.lifecycle.rollover_alias\":
\"test-filtering_data_tiers\"\r\n },\r\n \"mappings\": {\r\n \"_meta\":
{\r\n \"version\": \"1.6.0\"\r\n },\r\n \"properties\": {\r\n
\"@timestamp\": {\r\n \"type\": \"date\"\r\n },\r\n \"host\": {\r\n
\"properties\": {\r\n \"name\": {\r\n \"type\": \"keyword\",\r\n
\"ignore_above\": 1024\r\n }\r\n }\r\n }\r\n }\r\n }\r\n
}\r\n}\r\n\r\nPUT /filtering_data_tiers-000001\r\n{\r\n \"aliases\":
{\r\n \"filtering_data_tiers\": {\r\n \"is_write_index\": true\r\n }\r\n
}\r\n}\r\n\r\n\r\nPOST filtering_data_tiers/_doc\r\n{\r\n
\"@timestamp\": \"2024-07-08T17:00:01.000Z\",\r\n \"host.name\":
\"test-0\"\r\n}\r\n\r\n\r\n```\r\n\r\n</details>","sha":"c79f0ae78633c81beebd3f95735326cc872be7f6"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196390","number":196390,"mergeCommit":{"message":"[Security
Solution][Detection Engine] fixes ES|QL data tier filter from adv
settings (#196390)\n\n## Summary\r\n\r\n- fixes absent data tier filter
for ES|QL rule\r\n- followup to
https://github.com/elastic/kibana/pull/186908\r\n\r\n###
Demo\r\n\r\n\r\nhttps://github.com/user-attachments/assets/a6f1290f-ea77-43bf-8def-42712ca5d1b0\r\n\r\n\r\n\r\n###
How to test\r\n\r\nCreate a deployment with cold and frozen data tiers
and use following\r\ncommands to create index and
ILM\r\n\r\n\r\n<details>\r\n<summary>Data tiers
commands</summary>\r\n\r\n```JSON\r\n\r\nPUT /_cluster/settings\r\n{\r\n
\"persistent\": {\r\n \"indices.lifecycle.poll_interval\": \"1m\"\r\n
}\r\n}\r\n\r\n\r\nPUT /_ilm/policy/filtering_data_tiers\r\n{\r\n
\"policy\": {\r\n \"phases\": {\r\n \"frozen\": {\r\n \"min_age\":
\"10m\",\r\n \"actions\": {\r\n \"searchable_snapshot\": {\r\n
\"snapshot_repository\": \"found-snapshots\",\r\n \"force_merge_index\":
true\r\n }\r\n }\r\n },\r\n \"cold\": {\r\n \"min_age\": \"1m\",\r\n
\"actions\": {\r\n \"searchable_snapshot\": {\r\n
\"snapshot_repository\": \"found-snapshots\",\r\n \"force_merge_index\":
true\r\n },\r\n \"set_priority\": {\r\n \"priority\": 0\r\n }\r\n }\r\n
},\r\n \"hot\": {\r\n \"min_age\": \"0ms\",\r\n \"actions\": {\r\n
\"set_priority\": {\r\n \"priority\": 100\r\n }\r\n }\r\n }\r\n }\r\n
}\r\n}\r\n\r\n\r\nPUT
/_index_template/filtering_data_tiers_template\r\n{\r\n
\"index_patterns\": [\r\n \"filtering_data_tiers*\"\r\n ],\r\n
\"template\": {\r\n \"settings\": {\r\n \"index.lifecycle.name\":
\"filtering_data_tiers\",\r\n \"index.lifecycle.rollover_alias\":
\"test-filtering_data_tiers\"\r\n },\r\n \"mappings\": {\r\n \"_meta\":
{\r\n \"version\": \"1.6.0\"\r\n },\r\n \"properties\": {\r\n
\"@timestamp\": {\r\n \"type\": \"date\"\r\n },\r\n \"host\": {\r\n
\"properties\": {\r\n \"name\": {\r\n \"type\": \"keyword\",\r\n
\"ignore_above\": 1024\r\n }\r\n }\r\n }\r\n }\r\n }\r\n
}\r\n}\r\n\r\nPUT /filtering_data_tiers-000001\r\n{\r\n \"aliases\":
{\r\n \"filtering_data_tiers\": {\r\n \"is_write_index\": true\r\n }\r\n
}\r\n}\r\n\r\n\r\nPOST filtering_data_tiers/_doc\r\n{\r\n
\"@timestamp\": \"2024-07-08T17:00:01.000Z\",\r\n \"host.name\":
\"test-0\"\r\n}\r\n\r\n\r\n```\r\n\r\n</details>","sha":"c79f0ae78633c81beebd3f95735326cc872be7f6"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Vitalii Dmyterko <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:Detection Engine Security Solution Detection Engine Area Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.16.0 v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants