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] Adds UI support for filtering by rule source customization #197340

Merged
merged 9 commits into from
Nov 6, 2024

Conversation

dplumlee
Copy link
Contributor

@dplumlee dplumlee commented Oct 22, 2024

Summary

Addresses #180169

Note

Feature is behind the prebuiltRulesCustomizationEnabled feature flag.

Adds a filter for prebuilt rules in the Update rules table for "Modified" and "Unmodified" rules. Also adds a badge column in the Rules table to display whether a prebuilt rule has been customized or not.

Also switches the "Customized Elastic rule" badge on the rule details page to align with the updated language of "Modified Elastic rule"

Screenshots

Modified badge in Rules table

Screenshot 2024-11-05 at 3 05 56 PM

Modification filter dropdown on Rule update page

Screenshot 2024-10-24 at 11 46 26 AM

New "customized rule" badge language on Rule details page

Screenshot 2024-11-05 at 3 14 58 PM

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@dplumlee dplumlee added release_note:skip Skip the PR/issue when compiling release notes v9.0.0 Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area backport:version Backport to applied version labels v8.17.0 labels Oct 22, 2024
@dplumlee dplumlee self-assigned this Oct 22, 2024
@dplumlee dplumlee marked this pull request as ready for review October 23, 2024 17:20
@dplumlee dplumlee requested a review from a team as a code owner October 23, 2024 17:20
@dplumlee dplumlee requested a review from xcrzx October 23, 2024 17:20
@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-rule-management (Team:Detection Rule Management)

@dplumlee dplumlee added the ci:cloud-deploy Create or update a Cloud deployment label Oct 24, 2024
@xcrzx
Copy link
Contributor

xcrzx commented Oct 31, 2024

I just started reviewing the PR and noticed an inconsistency in how we refer to customized rules.

On the rule details page, we label them "Customized":

On the rule table, we label them "Modified":

I think we should use consistent naming across different pages. I’m fine with either term, let’s just pick one and stick with it.

@xcrzx
Copy link
Contributor

xcrzx commented Oct 31, 2024

@dplumlee, the ticked description also mentions:

Change Integrations badge to just icon and number count as in the design below.

Should it also be implemented in this PR?

Copy link
Contributor

@xcrzx xcrzx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the PR locally with the feature flag on and off and found no issues 👍

I’m leaving a couple of suggestions to clarify naming. It would also be great to add a few happy path tests to cover the new functionality.

@dplumlee
Copy link
Contributor Author

dplumlee commented Nov 1, 2024

I think we should use consistent naming across different pages. I’m fine with either term, let’s just pick one and stick with it.

@xcrzx That's a good point, I would agree. I think the badge was added before we recently changed some of the language we were using, @ARWNightingale / @approksiu should we be using "Modified" or "Customized" to refer to the customized prebuilt rules in the UI

@approksiu
Copy link

@xcrzx That's a good point, I would agree. I think the badge was added before we recently changed some of the language we were using, @ARWNightingale / @approksiu should we be using "Modified" or "Customized" to refer to the customized prebuilt rules in the UI

The most recent naming is "modified" - let's use it, good catch!

@banderror
Copy link
Contributor

banderror commented Nov 4, 2024

Hey @approksiu, we've been using the word "customized" and "customization" all over the place - in tickets, PR descriptions, code, API contracts, and even the data we store in Elasticsearch in rule saved objects. Any good reason we should divert from it in favor of "modified"? If we do it, we will need to update the existing terminology everywhere, except the already closed issues. Renaming the rule_source.is_customized field in Elasticsearch won't be possible because we don't have a migration mechanism for rules.

@approksiu
Copy link

Hey @approksiu, we've been using the word "customized" and "customization" all over the place - in tickets, PR descriptions, code, API contracts, and even the data we store in Elasticsearch in rule saved objects. Any good reason we should divert from it in favor of "modified"? If we do it, we will need to update the existing terminology everywhere, except the already closed issues. Renaming the rule_source.is_customized field in Elasticsearch won't be possible because we don't have a migration mechanism for rules.

We only need to change the badge on the Rule details page to "modified", no need to change "customized" naming in code. The "Modified" badge is the interim solution till we have faceted filters and an additional indication of modified/customized fields on the rule page/flyout. cc @dplumlee @xcrzx @banderror

@banderror
Copy link
Contributor

The above sounds good to me, we discussed this with @approksiu offline too.

@dplumlee
Copy link
Contributor Author

dplumlee commented Nov 5, 2024

@xcrzx Addressed your comments and added a couple cypress tests behind the feature flag. Tried to follow the pattern in this PR to try and align testing efforts

@dplumlee dplumlee requested a review from xcrzx November 5, 2024 20:09
@dplumlee dplumlee removed the ci:cloud-deploy Create or update a Cloud deployment label Nov 5, 2024
Copy link
Contributor

@xcrzx xcrzx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing my comments, @dplumlee 👍
Verified the changes locally, everything looks good!

@dplumlee
Copy link
Contributor Author

dplumlee commented Nov 6, 2024

@elasticmachine merge upstream

@dplumlee dplumlee enabled auto-merge (squash) November 6, 2024 16:08
@dplumlee
Copy link
Contributor Author

dplumlee commented Nov 6, 2024

@elasticmachine merge upstream

@dplumlee dplumlee merged commit f740d95 into elastic:main Nov 6, 2024
43 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 6139 6141 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 21.0MB 21.0MB +8.4KB

History

cc @dplumlee

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 6, 2024
…omization (elastic#197340)

## Summary

Addresses elastic#180169

> [!NOTE]
> Feature is behind the `prebuiltRulesCustomizationEnabled` feature
flag.

Adds a filter for prebuilt rules in the Update rules table for
"Modified" and "Unmodified" rules. Also adds a badge column in the Rules
table to display whether a prebuilt rule has been customized or not.

Also switches the "Customized Elastic rule" badge on the rule details
page to align with the updated language of "_Modified_ Elastic rule"

### Screenshots

#### Modified badge in Rules table
![Screenshot 2024-11-05 at 3 05
56 PM](https://github.com/user-attachments/assets/1f3313bb-7171-42b5-99b0-b9fb296fefd3)

#### Modification filter dropdown on Rule update page
<img width="1479" alt="Screenshot 2024-10-24 at 11 46 26 AM"
src="https://github.com/user-attachments/assets/82715abe-6ff6-4ba6-97b3-6fab9f42069e">

#### New "customized rule" badge language on Rule details page
![Screenshot 2024-11-05 at 3 14
58 PM](https://github.com/user-attachments/assets/4e22ba3a-e13f-4cf1-88c0-6b5b0b2c258a)

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit f740d95)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

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

Questions ?

Please refer to the Backport tool documentation

@dplumlee dplumlee deleted the rule-table-filter-new-rule-types branch November 6, 2024 20:37
kibanamachine added a commit that referenced this pull request Nov 7, 2024
…e customization (#197340) (#199217)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution] Adds UI support for filtering by rule source
customization (#197340)](#197340)

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

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

<!--BACKPORT [{"author":{"name":"Davis
Plumlee","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-06T19:51:25Z","message":"[Security
Solution] Adds UI support for filtering by rule source customization
(#197340)\n\n## Summary\r\n\r\nAddresses
https://github.com/elastic/kibana/issues/180169\r\n\r\n> [!NOTE] \r\n>
Feature is behind the `prebuiltRulesCustomizationEnabled`
feature\r\nflag.\r\n\r\nAdds a filter for prebuilt rules in the Update
rules table for\r\n\"Modified\" and \"Unmodified\" rules. Also adds a
badge column in the Rules\r\ntable to display whether a prebuilt rule
has been customized or not.\r\n\r\nAlso switches the \"Customized
Elastic rule\" badge on the rule details\r\npage to align with the
updated language of \"_Modified_ Elastic rule\"\r\n\r\n###
Screenshots\r\n\r\n#### Modified badge in Rules table\r\n![Screenshot
2024-11-05 at 3
05\r\n56 PM](https://github.com/user-attachments/assets/1f3313bb-7171-42b5-99b0-b9fb296fefd3)\r\n\r\n####
Modification filter dropdown on Rule update page\r\n<img width=\"1479\"
alt=\"Screenshot 2024-10-24 at 11 46
26 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/82715abe-6ff6-4ba6-97b3-6fab9f42069e\">\r\n\r\n####
New \"customized rule\" badge language on Rule details
page\r\n![Screenshot 2024-11-05 at 3
14\r\n58 PM](https://github.com/user-attachments/assets/4e22ba3a-e13f-4cf1-88c0-6b5b0b2c258a)\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] Any UI touched in this PR is usable by keyboard only (learn
more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n\r\n\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n-
[ ] This will appear in the **Release Notes** and follow
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"f740d953c7c624ddc26e1bef7a88dd9bb901a451","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","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v8.17.0"],"title":"[Security Solution] Adds
UI support for filtering by rule source
customization","number":197340,"url":"https://github.com/elastic/kibana/pull/197340","mergeCommit":{"message":"[Security
Solution] Adds UI support for filtering by rule source customization
(#197340)\n\n## Summary\r\n\r\nAddresses
https://github.com/elastic/kibana/issues/180169\r\n\r\n> [!NOTE] \r\n>
Feature is behind the `prebuiltRulesCustomizationEnabled`
feature\r\nflag.\r\n\r\nAdds a filter for prebuilt rules in the Update
rules table for\r\n\"Modified\" and \"Unmodified\" rules. Also adds a
badge column in the Rules\r\ntable to display whether a prebuilt rule
has been customized or not.\r\n\r\nAlso switches the \"Customized
Elastic rule\" badge on the rule details\r\npage to align with the
updated language of \"_Modified_ Elastic rule\"\r\n\r\n###
Screenshots\r\n\r\n#### Modified badge in Rules table\r\n![Screenshot
2024-11-05 at 3
05\r\n56 PM](https://github.com/user-attachments/assets/1f3313bb-7171-42b5-99b0-b9fb296fefd3)\r\n\r\n####
Modification filter dropdown on Rule update page\r\n<img width=\"1479\"
alt=\"Screenshot 2024-10-24 at 11 46
26 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/82715abe-6ff6-4ba6-97b3-6fab9f42069e\">\r\n\r\n####
New \"customized rule\" badge language on Rule details
page\r\n![Screenshot 2024-11-05 at 3
14\r\n58 PM](https://github.com/user-attachments/assets/4e22ba3a-e13f-4cf1-88c0-6b5b0b2c258a)\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] Any UI touched in this PR is usable by keyboard only (learn
more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n\r\n\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n-
[ ] This will appear in the **Release Notes** and follow
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"f740d953c7c624ddc26e1bef7a88dd9bb901a451"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/197340","number":197340,"mergeCommit":{"message":"[Security
Solution] Adds UI support for filtering by rule source customization
(#197340)\n\n## Summary\r\n\r\nAddresses
https://github.com/elastic/kibana/issues/180169\r\n\r\n> [!NOTE] \r\n>
Feature is behind the `prebuiltRulesCustomizationEnabled`
feature\r\nflag.\r\n\r\nAdds a filter for prebuilt rules in the Update
rules table for\r\n\"Modified\" and \"Unmodified\" rules. Also adds a
badge column in the Rules\r\ntable to display whether a prebuilt rule
has been customized or not.\r\n\r\nAlso switches the \"Customized
Elastic rule\" badge on the rule details\r\npage to align with the
updated language of \"_Modified_ Elastic rule\"\r\n\r\n###
Screenshots\r\n\r\n#### Modified badge in Rules table\r\n![Screenshot
2024-11-05 at 3
05\r\n56 PM](https://github.com/user-attachments/assets/1f3313bb-7171-42b5-99b0-b9fb296fefd3)\r\n\r\n####
Modification filter dropdown on Rule update page\r\n<img width=\"1479\"
alt=\"Screenshot 2024-10-24 at 11 46
26 AM\"\r\nsrc=\"https://github.com/user-attachments/assets/82715abe-6ff6-4ba6-97b3-6fab9f42069e\">\r\n\r\n####
New \"customized rule\" badge language on Rule details
page\r\n![Screenshot 2024-11-05 at 3
14\r\n58 PM](https://github.com/user-attachments/assets/4e22ba3a-e13f-4cf1-88c0-6b5b0b2c258a)\r\n\r\n\r\n###
Checklist\r\n\r\nDelete any items that are not applicable to this
PR.\r\n\r\n- [x] Any text added follows [EUI's
writing\r\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\r\nsentence case text and includes
[i18n\r\nsupport](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)\r\n-
[x] Any UI touched in this PR is usable by keyboard only (learn
more\r\nabout [keyboard
accessibility](https://webaim.org/techniques/keyboard/))\r\n\r\n\r\n\r\n###
For maintainers\r\n\r\n- [ ] This was checked for breaking API changes
and was
[labeled\r\nappropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)\r\n-
[ ] This will appear in the **Release Notes** and follow
the\r\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\r\n\r\n---------\r\n\r\nCo-authored-by:
Elastic Machine
<[email protected]>","sha":"f740d953c7c624ddc26e1bef7a88dd9bb901a451"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: Davis Plumlee <[email protected]>
Co-authored-by: Davis Plumlee <[email protected]>
mgadewoll pushed a commit to mgadewoll/kibana that referenced this pull request Nov 7, 2024
…omization (elastic#197340)

## Summary

Addresses elastic#180169

> [!NOTE]  
> Feature is behind the `prebuiltRulesCustomizationEnabled` feature
flag.

Adds a filter for prebuilt rules in the Update rules table for
"Modified" and "Unmodified" rules. Also adds a badge column in the Rules
table to display whether a prebuilt rule has been customized or not.

Also switches the "Customized Elastic rule" badge on the rule details
page to align with the updated language of "_Modified_ Elastic rule"

### Screenshots

#### Modified badge in Rules table
![Screenshot 2024-11-05 at 3 05
56 PM](https://github.com/user-attachments/assets/1f3313bb-7171-42b5-99b0-b9fb296fefd3)

#### Modification filter dropdown on Rule update page
<img width="1479" alt="Screenshot 2024-10-24 at 11 46 26 AM"
src="https://github.com/user-attachments/assets/82715abe-6ff6-4ba6-97b3-6fab9f42069e">

#### New "customized rule" badge language on Rule details page
![Screenshot 2024-11-05 at 3 14
58 PM](https://github.com/user-attachments/assets/4e22ba3a-e13f-4cf1-88c0-6b5b0b2c258a)


### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))



### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels)
- [ ] This will appear in the **Release Notes** and follow the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Elastic Machine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:version Backport to applied version labels Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area release_note:skip Skip the PR/issue when compiling release notes 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.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants