-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Remove exceptions_list
, author
and license
from Diffable Rule
#196561
Conversation
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikitaindik Deleted the author and license components since they won't be needed, and the DiffableRule type doesn't allow it anymore anyways. Let me know if this makes sense.
@@ -10,10 +10,4 @@ import type { DiffableAllFields } from '../../../../../../../common/api/detectio | |||
type NonEditableFields = Readonly<Set<keyof DiffableAllFields>>; | |||
|
|||
/* These fields are not visible in the comparison UI and are not editable */ | |||
export const HIDDEN_FIELDS: NonEditableFields = new Set([ | |||
'alert_suppression', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikitaindik alert_suppression
actually needs to be displayed in the diff and be able to be customized by the user. Can you make a note of that for the work that you and Maxim are currently doing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
Actually, can you please remove this whole file since these constants are not used anywhere. It's a duplicate of this constant. I thought I removed it but it looks like it got resurrected during a merge.
I wonder if I can just reuse your FIELDS_TO_UPGRADE_TO_TARGET_VERSION
constant to hide non-editable fields from the "left side / right side" in UI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank @jpdjere! The PR LGTM overall. Left a couple comments.
Removed the file with the constants.
Yes. I think you can actually use both |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
History
cc @jpdjere |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Changes LGTM.
Starting backport for target branches: 8.16, 8.x |
…from Diffable Rule (elastic#196561) Resolves: elastic#196213 ## Summary Excludes the fields `exceptions_list`, `author` and `license` from the `DiffableRule` definition. This will: - prevent them from appearing in the Three Way Diff component - prevent them from being able to be passed as a value in the `fields` object of the `/upgrade/_perform` endpoint to set a specific `pick_version` for it (NOTE: the current logic already forces `exceptions_list` to upgrade to the CURRENT version, but removing it from DiffableRule, will completely remove the from the payload schema, and the endpoint will then throw a validation error if included, rather than silently ignoring it) ## Screenshots ### Before ![image](https://github.com/user-attachments/assets/aacd0b43-bb29-46d0-990d-c669224c1451) ### After ![image](https://github.com/user-attachments/assets/e568ca7f-03fc-42d6-8879-d3f23558ae9d) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) (cherry picked from commit 716fdb2)
…from Diffable Rule (elastic#196561) Resolves: elastic#196213 ## Summary Excludes the fields `exceptions_list`, `author` and `license` from the `DiffableRule` definition. This will: - prevent them from appearing in the Three Way Diff component - prevent them from being able to be passed as a value in the `fields` object of the `/upgrade/_perform` endpoint to set a specific `pick_version` for it (NOTE: the current logic already forces `exceptions_list` to upgrade to the CURRENT version, but removing it from DiffableRule, will completely remove the from the payload schema, and the endpoint will then throw a validation error if included, rather than silently ignoring it) ## Screenshots ### Before ![image](https://github.com/user-attachments/assets/aacd0b43-bb29-46d0-990d-c669224c1451) ### After ![image](https://github.com/user-attachments/assets/e568ca7f-03fc-42d6-8879-d3f23558ae9d) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) (cherry picked from commit 716fdb2)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…author` and `license` from Diffable Rule (#196561) (#196903) # Backport This will backport the following commits from `main` to `8.16`: - [[Security Solution] Remove `exceptions_list`, `author` and `license` from Diffable Rule (#196561)](#196561) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Juan Pablo Djeredjian","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-18T14:50:36Z","message":"[Security Solution] Remove `exceptions_list`, `author` and `license` from Diffable Rule (#196561)\n\nResolves: https://github.com/elastic/kibana/issues/196213\r\n\r\n## Summary\r\n\r\nExcludes the fields `exceptions_list`, `author` and `license` from the\r\n`DiffableRule` definition.\r\n\r\nThis will:\r\n\r\n- prevent them from appearing in the Three Way Diff component\r\n- prevent them from being able to be passed as a value in the `fields`\r\nobject of the `/upgrade/_perform` endpoint to set a specific\r\n`pick_version` for it (NOTE: the current logic already forces\r\n`exceptions_list` to upgrade to the CURRENT version, but removing it\r\nfrom DiffableRule, will completely remove the from the payload schema,\r\nand the endpoint will then throw a validation error if included, rather\r\nthan silently ignoring it)\r\n\r\n## Screenshots\r\n\r\n### Before\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/aacd0b43-bb29-46d0-990d-c669224c1451)\r\n\r\n\r\n### After\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/e568ca7f-03fc-42d6-8879-d3f23558ae9d)\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#kibana-release-notes-process)","sha":"716fdb23c7d42c9f7c29525af793ff1594ad67f0","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:prev-minor","v8.16.0"],"title":"[Security Solution] Remove `exceptions_list`, `author` and `license` from Diffable Rule","number":196561,"url":"https://github.com/elastic/kibana/pull/196561","mergeCommit":{"message":"[Security Solution] Remove `exceptions_list`, `author` and `license` from Diffable Rule (#196561)\n\nResolves: https://github.com/elastic/kibana/issues/196213\r\n\r\n## Summary\r\n\r\nExcludes the fields `exceptions_list`, `author` and `license` from the\r\n`DiffableRule` definition.\r\n\r\nThis will:\r\n\r\n- prevent them from appearing in the Three Way Diff component\r\n- prevent them from being able to be passed as a value in the `fields`\r\nobject of the `/upgrade/_perform` endpoint to set a specific\r\n`pick_version` for it (NOTE: the current logic already forces\r\n`exceptions_list` to upgrade to the CURRENT version, but removing it\r\nfrom DiffableRule, will completely remove the from the payload schema,\r\nand the endpoint will then throw a validation error if included, rather\r\nthan silently ignoring it)\r\n\r\n## Screenshots\r\n\r\n### Before\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/aacd0b43-bb29-46d0-990d-c669224c1451)\r\n\r\n\r\n### After\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/e568ca7f-03fc-42d6-8879-d3f23558ae9d)\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#kibana-release-notes-process)","sha":"716fdb23c7d42c9f7c29525af793ff1594ad67f0"}},"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/196561","number":196561,"mergeCommit":{"message":"[Security Solution] Remove `exceptions_list`, `author` and `license` from Diffable Rule (#196561)\n\nResolves: https://github.com/elastic/kibana/issues/196213\r\n\r\n## Summary\r\n\r\nExcludes the fields `exceptions_list`, `author` and `license` from the\r\n`DiffableRule` definition.\r\n\r\nThis will:\r\n\r\n- prevent them from appearing in the Three Way Diff component\r\n- prevent them from being able to be passed as a value in the `fields`\r\nobject of the `/upgrade/_perform` endpoint to set a specific\r\n`pick_version` for it (NOTE: the current logic already forces\r\n`exceptions_list` to upgrade to the CURRENT version, but removing it\r\nfrom DiffableRule, will completely remove the from the payload schema,\r\nand the endpoint will then throw a validation error if included, rather\r\nthan silently ignoring it)\r\n\r\n## Screenshots\r\n\r\n### Before\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/aacd0b43-bb29-46d0-990d-c669224c1451)\r\n\r\n\r\n### After\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/e568ca7f-03fc-42d6-8879-d3f23558ae9d)\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#kibana-release-notes-process)","sha":"716fdb23c7d42c9f7c29525af793ff1594ad67f0"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Juan Pablo Djeredjian <[email protected]>
…uthor` and `license` from Diffable Rule (#196561) (#196904) # Backport This will backport the following commits from `main` to `8.x`: - [[Security Solution] Remove `exceptions_list`, `author` and `license` from Diffable Rule (#196561)](#196561) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Juan Pablo Djeredjian","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-18T14:50:36Z","message":"[Security Solution] Remove `exceptions_list`, `author` and `license` from Diffable Rule (#196561)\n\nResolves: https://github.com/elastic/kibana/issues/196213\r\n\r\n## Summary\r\n\r\nExcludes the fields `exceptions_list`, `author` and `license` from the\r\n`DiffableRule` definition.\r\n\r\nThis will:\r\n\r\n- prevent them from appearing in the Three Way Diff component\r\n- prevent them from being able to be passed as a value in the `fields`\r\nobject of the `/upgrade/_perform` endpoint to set a specific\r\n`pick_version` for it (NOTE: the current logic already forces\r\n`exceptions_list` to upgrade to the CURRENT version, but removing it\r\nfrom DiffableRule, will completely remove the from the payload schema,\r\nand the endpoint will then throw a validation error if included, rather\r\nthan silently ignoring it)\r\n\r\n## Screenshots\r\n\r\n### Before\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/aacd0b43-bb29-46d0-990d-c669224c1451)\r\n\r\n\r\n### After\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/e568ca7f-03fc-42d6-8879-d3f23558ae9d)\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#kibana-release-notes-process)","sha":"716fdb23c7d42c9f7c29525af793ff1594ad67f0","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:prev-minor","v8.16.0"],"title":"[Security Solution] Remove `exceptions_list`, `author` and `license` from Diffable Rule","number":196561,"url":"https://github.com/elastic/kibana/pull/196561","mergeCommit":{"message":"[Security Solution] Remove `exceptions_list`, `author` and `license` from Diffable Rule (#196561)\n\nResolves: https://github.com/elastic/kibana/issues/196213\r\n\r\n## Summary\r\n\r\nExcludes the fields `exceptions_list`, `author` and `license` from the\r\n`DiffableRule` definition.\r\n\r\nThis will:\r\n\r\n- prevent them from appearing in the Three Way Diff component\r\n- prevent them from being able to be passed as a value in the `fields`\r\nobject of the `/upgrade/_perform` endpoint to set a specific\r\n`pick_version` for it (NOTE: the current logic already forces\r\n`exceptions_list` to upgrade to the CURRENT version, but removing it\r\nfrom DiffableRule, will completely remove the from the payload schema,\r\nand the endpoint will then throw a validation error if included, rather\r\nthan silently ignoring it)\r\n\r\n## Screenshots\r\n\r\n### Before\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/aacd0b43-bb29-46d0-990d-c669224c1451)\r\n\r\n\r\n### After\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/e568ca7f-03fc-42d6-8879-d3f23558ae9d)\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#kibana-release-notes-process)","sha":"716fdb23c7d42c9f7c29525af793ff1594ad67f0"}},"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/196561","number":196561,"mergeCommit":{"message":"[Security Solution] Remove `exceptions_list`, `author` and `license` from Diffable Rule (#196561)\n\nResolves: https://github.com/elastic/kibana/issues/196213\r\n\r\n## Summary\r\n\r\nExcludes the fields `exceptions_list`, `author` and `license` from the\r\n`DiffableRule` definition.\r\n\r\nThis will:\r\n\r\n- prevent them from appearing in the Three Way Diff component\r\n- prevent them from being able to be passed as a value in the `fields`\r\nobject of the `/upgrade/_perform` endpoint to set a specific\r\n`pick_version` for it (NOTE: the current logic already forces\r\n`exceptions_list` to upgrade to the CURRENT version, but removing it\r\nfrom DiffableRule, will completely remove the from the payload schema,\r\nand the endpoint will then throw a validation error if included, rather\r\nthan silently ignoring it)\r\n\r\n## Screenshots\r\n\r\n### Before\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/aacd0b43-bb29-46d0-990d-c669224c1451)\r\n\r\n\r\n### After\r\n\r\n\r\n![image](https://github.com/user-attachments/assets/e568ca7f-03fc-42d6-8879-d3f23558ae9d)\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#kibana-release-notes-process)","sha":"716fdb23c7d42c9f7c29525af793ff1594ad67f0"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Juan Pablo Djeredjian <[email protected]>
Resolves: #196213
Summary
Excludes the fields
exceptions_list
,author
andlicense
from theDiffableRule
definition.This will:
fields
object of the/upgrade/_perform
endpoint to set a specificpick_version
for it (NOTE: the current logic already forcesexceptions_list
to upgrade to the CURRENT version, but removing it from DiffableRule, will completely remove the from the payload schema, and the endpoint will then throw a validation error if included, rather than silently ignoring it)Screenshots
Before
After
For maintainers