-
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
[ResponseOps][Rules] Fix case action templates in stack for security serverless #195763
Conversation
Pinging @elastic/response-ops (Team:ResponseOps) |
Pinging @elastic/response-ops-cases (Feature:Cases) |
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.
@@ -167,7 +168,7 @@ export interface TriggersAndActionsUIPublicPluginStart { | |||
interface PluginsSetup { | |||
management: ManagementSetup; | |||
home?: HomePublicPluginSetup; | |||
cloud?: { isCloudEnabled: boolean }; | |||
cloud: CloudSetup; |
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.
I think the type should be optional, correct?
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.
You're right, thank you!
@@ -39,11 +39,20 @@ export const CasesParamsFieldsComponent: React.FunctionComponent< | |||
ActionParamsProps<CasesActionParams> | |||
> = ({ actionParams, editAction, errors, index, producerId, featureId }) => { | |||
const { | |||
cloud, |
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.
Just a reminder that the cases_params
component is rendered through various applications that provide the KibanaContextProvider
. Even if the triggers actions UI provides cloud
maybe other solutions will not. If it is working in Security then they definitely provide it 🙂.
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.
But this portion of cases' code is only used by triggers_actions_ui
so it's safe to assume that cloud will be provided no? I added cloud to triggers actions UI because they define Kibana context for connectors.
If it is working in Security then they definitely provide it 🙂.
The important part is that it works in Stack Management so that is independent of security right? (even if the project is security serverless)
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.
This portion of code is being used everywhere the alerts flyout is being used. Also, the actions component is being exported and used by the Security solution in their rules form:
Nevertheless, even if the cloud
plugin is not available because you can only create security rules there the owner
will always be correct + @js-jankisalvi tested it 🙂 . The issue is on Stack so it should be fine.
/ci |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
History
cc @adcoelho |
Starting backport for target branches: 8.x https://github.com/elastic/kibana/actions/runs/11326568180 |
…serverless (elastic#195763) Fixes elastic#195599 ## Summary This PR ensures that we can use templates in the case action when: 1. the project is serverless security, and 2. the rule is created in stack management ### How to test 1. Add the following line to `serverless.yml` - `xpack.cloud.serverless.project_id: test-123` 3. Start Elastic search in serverless security mode - `yarn es serverless --projectType security` 4. Start Kibana in serverless security mode - `yarn start --serverless=security` 5. Go to Security > Cases > Settings and add a template. 6. Go to stack and create a rule with the case action. 7. Confirm the template created in step 5 can be selected. <img width="586" alt="Screenshot 2024-10-10 at 15 00 46" src="https://github.com/user-attachments/assets/5379e1d1-f0eb-4829-9604-ee5a0e3d050b"> **Please double-check also that the templates in the case action still work as expected in normal scenarios.** --------- Co-authored-by: kibanamachine <[email protected]> (cherry picked from commit 97322a8)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…urity serverless (#195763) (#196110) # Backport This will backport the following commits from `main` to `8.x`: - [[ResponseOps][Rules] Fix case action templates in stack for security serverless (#195763)](#195763) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Antonio","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-14T11:25:29Z","message":"[ResponseOps][Rules] Fix case action templates in stack for security serverless (#195763)\n\nFixes #195599\r\n\r\n## Summary\r\n\r\nThis PR ensures that we can use templates in the case action when:\r\n1. the project is serverless security, and\r\n2. the rule is created in stack management\r\n\r\n### How to test\r\n\r\n1. Add the following line to `serverless.yml` -\r\n`xpack.cloud.serverless.project_id: test-123`\r\n3. Start Elastic search in serverless security mode - `yarn es\r\nserverless --projectType security`\r\n4. Start Kibana in serverless security mode - `yarn start\r\n--serverless=security`\r\n5. Go to Security > Cases > Settings and add a template.\r\n6. Go to stack and create a rule with the case action.\r\n7. Confirm the template created in step 5 can be selected.\r\n\r\n<img width=\"586\" alt=\"Screenshot 2024-10-10 at 15 00 46\"\r\nsrc=\"https://github.com/user-attachments/assets/5379e1d1-f0eb-4829-9604-ee5a0e3d050b\">\r\n\r\n**Please double-check also that the templates in the case action still\r\nwork as expected in normal scenarios.**\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"97322a871357ba69e7c64543831fbf1597ca8ff9","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","Team:ResponseOps","v9.0.0","Feature:Cases","backport:prev-minor","v8.16.0"],"title":"[ResponseOps][Rules] Fix case action templates in stack for security serverless","number":195763,"url":"https://github.com/elastic/kibana/pull/195763","mergeCommit":{"message":"[ResponseOps][Rules] Fix case action templates in stack for security serverless (#195763)\n\nFixes #195599\r\n\r\n## Summary\r\n\r\nThis PR ensures that we can use templates in the case action when:\r\n1. the project is serverless security, and\r\n2. the rule is created in stack management\r\n\r\n### How to test\r\n\r\n1. Add the following line to `serverless.yml` -\r\n`xpack.cloud.serverless.project_id: test-123`\r\n3. Start Elastic search in serverless security mode - `yarn es\r\nserverless --projectType security`\r\n4. Start Kibana in serverless security mode - `yarn start\r\n--serverless=security`\r\n5. Go to Security > Cases > Settings and add a template.\r\n6. Go to stack and create a rule with the case action.\r\n7. Confirm the template created in step 5 can be selected.\r\n\r\n<img width=\"586\" alt=\"Screenshot 2024-10-10 at 15 00 46\"\r\nsrc=\"https://github.com/user-attachments/assets/5379e1d1-f0eb-4829-9604-ee5a0e3d050b\">\r\n\r\n**Please double-check also that the templates in the case action still\r\nwork as expected in normal scenarios.**\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"97322a871357ba69e7c64543831fbf1597ca8ff9"}},"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/195763","number":195763,"mergeCommit":{"message":"[ResponseOps][Rules] Fix case action templates in stack for security serverless (#195763)\n\nFixes #195599\r\n\r\n## Summary\r\n\r\nThis PR ensures that we can use templates in the case action when:\r\n1. the project is serverless security, and\r\n2. the rule is created in stack management\r\n\r\n### How to test\r\n\r\n1. Add the following line to `serverless.yml` -\r\n`xpack.cloud.serverless.project_id: test-123`\r\n3. Start Elastic search in serverless security mode - `yarn es\r\nserverless --projectType security`\r\n4. Start Kibana in serverless security mode - `yarn start\r\n--serverless=security`\r\n5. Go to Security > Cases > Settings and add a template.\r\n6. Go to stack and create a rule with the case action.\r\n7. Confirm the template created in step 5 can be selected.\r\n\r\n<img width=\"586\" alt=\"Screenshot 2024-10-10 at 15 00 46\"\r\nsrc=\"https://github.com/user-attachments/assets/5379e1d1-f0eb-4829-9604-ee5a0e3d050b\">\r\n\r\n**Please double-check also that the templates in the case action still\r\nwork as expected in normal scenarios.**\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <[email protected]>","sha":"97322a871357ba69e7c64543831fbf1597ca8ff9"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Antonio <[email protected]>
Fixes #195599
Summary
This PR ensures that we can use templates in the case action when:
How to test
serverless.yml
-xpack.cloud.serverless.project_id: test-123
yarn es serverless --projectType security
yarn start --serverless=security
Please double-check also that the templates in the case action still work as expected in normal scenarios.