[Rules migration] Add install and install all migration rules endpoints (#11283)#202026
Conversation
|
Pinging @elastic/security-solution (Team: SecuritySolution) |
|
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
install and install all migration rules endpoints (#11283)
x-pack/plugins/security_solution/public/siem_migrations/rules/components/rules_table/index.tsx
Show resolved
Hide resolved
.../plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml
Outdated
Show resolved
Hide resolved
.../plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml
Outdated
Show resolved
Hide resolved
.../plugins/security_solution/common/siem_migrations/model/api/rules/rule_migration.schema.yaml
Outdated
Show resolved
Hide resolved
| return useGetMigrationRulesQuery(migrationId, { | ||
| onError: (error) => { | ||
| addError(error, { title: i18n.GET_MIGRATION_RULES_FAILURE }); | ||
| }, | ||
| }); |
There was a problem hiding this comment.
We send a new options object every time, would it make sense to memoize it? 🤔 (I am not sure, maybe that's fine)
There was a problem hiding this comment.
I do not see anywhere in code us memoizing options. Also, wondering why we never do that. Will check it
x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/rules/helpers.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/rules/install.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/rules/install_all.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/common/siem_migrations/utils.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/server/lib/siem_migrations/rules/api/rules/install_all.ts
Outdated
Show resolved
Hide resolved
| export interface InstallRule { | ||
| id: string; | ||
| elastic_rule: ElasticRule; | ||
| } |
There was a problem hiding this comment.
correct, will remove it!
...security_solution/server/lib/siem_migrations/rules/data/rule_migrations_data_rules_client.ts
Show resolved
Hide resolved
…les/data/rule_migrations_data_rules_client.ts Co-authored-by: Sergi Massaneda <sergi.massaneda@gmail.com>
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
History
cc @e40pud |
|
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/12088437721 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…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 <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Sergi Massaneda <sergi.massaneda@gmail.com> (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
…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":"ievgen.sorokopud@elastic.co"},"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 <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Sergi Massaneda <sergi.massaneda@gmail.com>","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 <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Sergi Massaneda <sergi.massaneda@gmail.com>","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 <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Sergi Massaneda <sergi.massaneda@gmail.com>","sha":"07fbb925859121d391271a183c8ba00109f53ce1"}},{"branch":"8.x","label":"v8.18.0","labelRegex":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
…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 <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Sergi Massaneda <sergi.massaneda@gmail.com>
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 migrationAlso 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