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

[Rules migration] Add install and install all migration rules endpoints (#11283) #202026

Merged

Conversation

e40pud
Copy link
Contributor

@e40pud e40pud commented Nov 27, 2024

Summary

Internal link to the feature details

With these changes we two new routes:

  • /internal/siem_migrations/rules/install: allows to install a specific set of migration rules
  • /internal/siem_migrations/rules/install_translated: allows to install all translated rules in specified migration

Also we connect these two new API calls with the "Install" button within the "migration rules" table and the "Install translated rules" button on the "SIEM migration rules" page.

Screenshots

Screen.Recording.2024-11-27.at.17.19.44.mov

@e40pud e40pud added release_note:skip Skip the PR/issue when compiling release notes Team:Threat Hunting Security Solution Threat Hunting Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. backport:version Backport to applied version labels v8.18.0 labels Nov 27, 2024
@e40pud e40pud requested review from P1llus and semd November 27, 2024 16:26
@e40pud e40pud self-assigned this Nov 27, 2024
@e40pud e40pud requested a review from a team as a code owner November 27, 2024 16:26
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-threat-hunting (Team:Threat Hunting)

@e40pud e40pud changed the title [Rules migration] Add install and install all migration rules endpoints (#11283) [Rules migration] Add install and install all migration rules endpoints (#11283) Nov 27, 2024
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner November 27, 2024 16:51
Comment on lines +15 to +19
return useGetMigrationRulesQuery(migrationId, {
onError: (error) => {
addError(error, { title: i18n.GET_MIGRATION_RULES_FAILURE });
},
});
Copy link
Contributor

Choose a reason for hiding this comment

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

We send a new options object every time, would it make sense to memoize it? 🤔 (I am not sure, maybe that's fine)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I do not see anywhere in code us memoizing options. Also, wondering why we never do that. Will check it

Comment on lines 18 to 21
export interface InstallRule {
id: string;
elastic_rule: ElasticRule;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not used, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct, will remove it!

Copy link
Contributor

@semd semd left a comment

Choose a reason for hiding this comment

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

LGTM!

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 6295 6308 +13

Async chunks

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

id before after diff
securitySolution 14.6MB 14.6MB +6.3KB

History

cc @e40pud

@e40pud e40pud merged commit 07fbb92 into elastic:main Nov 29, 2024
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

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

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [SecuritySolution] Entity Engine status tab (#201235)
- [SIEM migrations][Onboarding] Add support for topics in the onboarding page (#201411)
- [SIEM Rule Migration] Minor prompt improvements (#201941)

Manual backport

To create the backport manually run:

node scripts/backport --pr 202026

Questions ?

Please refer to the Backport tool documentation

@e40pud
Copy link
Contributor Author

e40pud commented Nov 29, 2024

💚 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

e40pud added a commit to e40pud/kibana that referenced this pull request Nov 29, 2024
…points (elastic#11283) (elastic#202026)

## Summary

[Internal link](elastic/security-team#10820)
to the feature details

With these changes we two new routes:

* `/internal/siem_migrations/rules/install`: allows to install a
specific set of migration rules
* `/internal/siem_migrations/rules/install_translated`: allows to
install all translated rules in specified migration

Also we connect these two new API calls with the "Install" button within
the "migration rules" table and the "Install translated rules" button on
the "SIEM migration rules" page.

### Screenshots

https://github.com/user-attachments/assets/29390d07-eab5-4157-8958-1e3f8459db09

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Sergi Massaneda <[email protected]>
(cherry picked from commit 07fbb92)

# Conflicts:
#	x-pack/plugins/security_solution/public/siem_migrations/rules/api/api.ts
#	x-pack/plugins/security_solution/server/lib/siem_migrations/rules/task/agent/nodes/match_prebuilt_rule/match_prebuilt_rule.ts
#	x-pack/test/api_integration/services/security_solution_api.gen.ts
e40pud added a commit that referenced this pull request Nov 30, 2024
…es endpoints (#11283) (#202026) (#202368)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Rules migration] Add `install` and `install all` migration rules
endpoints (#11283)
(#202026)](#202026)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Ievgen
Sorokopud","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-29T17:05:20Z","message":"[Rules
migration] Add `install` and `install all` migration rules endpoints
(#11283) (#202026)\n\n## Summary\r\n\r\n[Internal
link](https://github.com/elastic/security-team/issues/10820)\r\nto the
feature details\r\n\r\nWith these changes we two new routes:\r\n\r\n*
`/internal/siem_migrations/rules/install`: allows to install
a\r\nspecific set of migration rules\r\n*
`/internal/siem_migrations/rules/install_translated`: allows
to\r\ninstall all translated rules in specified migration\r\n\r\nAlso we
connect these two new API calls with the \"Install\" button
within\r\nthe \"migration rules\" table and the \"Install translated
rules\" button on\r\nthe \"SIEM migration rules\" page.\r\n\r\n###
Screenshots\r\n\r\n\r\nhttps://github.com/user-attachments/assets/29390d07-eab5-4157-8958-1e3f8459db09\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>\r\nCo-authored-by:
Sergi Massaneda
<[email protected]>","sha":"07fbb925859121d391271a183c8ba00109f53ce1","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","Team:Threat
Hunting","Team:
SecuritySolution","backport:version","v8.18.0"],"number":202026,"url":"https://github.com/elastic/kibana/pull/202026","mergeCommit":{"message":"[Rules
migration] Add `install` and `install all` migration rules endpoints
(#11283) (#202026)\n\n## Summary\r\n\r\n[Internal
link](https://github.com/elastic/security-team/issues/10820)\r\nto the
feature details\r\n\r\nWith these changes we two new routes:\r\n\r\n*
`/internal/siem_migrations/rules/install`: allows to install
a\r\nspecific set of migration rules\r\n*
`/internal/siem_migrations/rules/install_translated`: allows
to\r\ninstall all translated rules in specified migration\r\n\r\nAlso we
connect these two new API calls with the \"Install\" button
within\r\nthe \"migration rules\" table and the \"Install translated
rules\" button on\r\nthe \"SIEM migration rules\" page.\r\n\r\n###
Screenshots\r\n\r\n\r\nhttps://github.com/user-attachments/assets/29390d07-eab5-4157-8958-1e3f8459db09\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>\r\nCo-authored-by:
Sergi Massaneda
<[email protected]>","sha":"07fbb925859121d391271a183c8ba00109f53ce1"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202026","number":202026,"mergeCommit":{"message":"[Rules
migration] Add `install` and `install all` migration rules endpoints
(#11283) (#202026)\n\n## Summary\r\n\r\n[Internal
link](https://github.com/elastic/security-team/issues/10820)\r\nto the
feature details\r\n\r\nWith these changes we two new routes:\r\n\r\n*
`/internal/siem_migrations/rules/install`: allows to install
a\r\nspecific set of migration rules\r\n*
`/internal/siem_migrations/rules/install_translated`: allows
to\r\ninstall all translated rules in specified migration\r\n\r\nAlso we
connect these two new API calls with the \"Install\" button
within\r\nthe \"migration rules\" table and the \"Install translated
rules\" button on\r\nthe \"SIEM migration rules\" page.\r\n\r\n###
Screenshots\r\n\r\n\r\nhttps://github.com/user-attachments/assets/29390d07-eab5-4157-8958-1e3f8459db09\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>\r\nCo-authored-by:
Sergi Massaneda
<[email protected]>","sha":"07fbb925859121d391271a183c8ba00109f53ce1"}},{"branch":"8.x","label":"v8.18.0","labelRegex":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 9, 2024
…points (elastic#11283) (elastic#202026)

## Summary

[Internal link](elastic/security-team#10820)
to the feature details

With these changes we two new routes:

* `/internal/siem_migrations/rules/install`: allows to install a
specific set of migration rules
* `/internal/siem_migrations/rules/install_translated`: allows to
install all translated rules in specified migration

Also we connect these two new API calls with the "Install" button within
the "migration rules" table and the "Install translated rules" button on
the "SIEM migration rules" page.

### Screenshots


https://github.com/user-attachments/assets/29390d07-eab5-4157-8958-1e3f8459db09

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Sergi Massaneda <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
…points (elastic#11283) (elastic#202026)

## Summary

[Internal link](elastic/security-team#10820)
to the feature details

With these changes we two new routes:

* `/internal/siem_migrations/rules/install`: allows to install a
specific set of migration rules
* `/internal/siem_migrations/rules/install_translated`: allows to
install all translated rules in specified migration

Also we connect these two new API calls with the "Install" button within
the "migration rules" table and the "Install translated rules" button on
the "SIEM migration rules" page.

### Screenshots


https://github.com/user-attachments/assets/29390d07-eab5-4157-8958-1e3f8459db09

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Sergi Massaneda <[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 release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Threat Hunting Security Solution Threat Hunting Team v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants