Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.15] [Security Solution] [Attack discovery] Updates Gemini connecto…
…r to ignore unknown properties in responses (#192915) (#193221) # Backport This will backport the following commits from `main` to `8.15`: - [[Security Solution] [Attack discovery] Updates Gemini connector to ignore unknown properties in responses (#192915)](#192915) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Andrew Macri","email":"andrew.macri@elastic.co"},"sourceCommit":{"committedDate":"2024-09-17T19:46:48Z","message":"[Security Solution] [Attack discovery] Updates Gemini connector to ignore unknown properties in responses (#192915)\n\n## [Security Solution] [Attack discovery] Updates Gemini connector to ignore unknown properties in responses\r\n\r\n### Summary\r\n\r\nThis PR updates the Gemini connector's `RunApiResponseSchema` to ignore unknown properties in responses.\r\n\r\nIt fixes an issue where the recent addition of a `modelVersion` in Gemini responses causes Attack discovery to fail with the following error:\r\n\r\n```\r\nAttack discovery generation failed\r\n\r\nActionsClientLlm: action result status is error: an error occurred while running the action - Response validation failed (Error: [modelVersion]: definition for this key is missing)\r\n```\r\n\r\nshown in the screenshot below:\r\n\r\n![error](https://github.com/user-attachments/assets/8b706290-27ca-42d9-b972-3d8613af690c)\r\n\r\n### Desk testing\r\n\r\nTo reproduce:\r\n\r\n1) Navigate to Security > Attack discovery\r\n\r\n2) Select a Gemini connector\r\n\r\n3) Click Generate\r\n\r\n**Expected result**\r\n\r\n- Attack discoveries are generated\r\n\r\n**Actual result**\r\n\r\n- The following error is displayed:\r\n\r\n```\r\nAttack discovery generation failed\r\n\r\nActionsClientLlm: action result status is error: an error occurred while running the action - Response validation failed (Error: [modelVersion]: definition for this key is missing)\r\n```\r\n\r\n![error](https://github.com/user-attachments/assets/8b706290-27ca-42d9-b972-3d8613af690c)","sha":"699db81856eaf9a3666f4f46fa58ee4619b3b17c","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","v9.0.0","Team: SecuritySolution","Team:Security Generative AI","v8.16.0","v8.15.2"],"title":"[Security Solution] [Attack discovery] Updates Gemini connector to ignore unknown properties in responses","number":192915,"url":"https://github.com/elastic/kibana/pull/192915","mergeCommit":{"message":"[Security Solution] [Attack discovery] Updates Gemini connector to ignore unknown properties in responses (#192915)\n\n## [Security Solution] [Attack discovery] Updates Gemini connector to ignore unknown properties in responses\r\n\r\n### Summary\r\n\r\nThis PR updates the Gemini connector's `RunApiResponseSchema` to ignore unknown properties in responses.\r\n\r\nIt fixes an issue where the recent addition of a `modelVersion` in Gemini responses causes Attack discovery to fail with the following error:\r\n\r\n```\r\nAttack discovery generation failed\r\n\r\nActionsClientLlm: action result status is error: an error occurred while running the action - Response validation failed (Error: [modelVersion]: definition for this key is missing)\r\n```\r\n\r\nshown in the screenshot below:\r\n\r\n![error](https://github.com/user-attachments/assets/8b706290-27ca-42d9-b972-3d8613af690c)\r\n\r\n### Desk testing\r\n\r\nTo reproduce:\r\n\r\n1) Navigate to Security > Attack discovery\r\n\r\n2) Select a Gemini connector\r\n\r\n3) Click Generate\r\n\r\n**Expected result**\r\n\r\n- Attack discoveries are generated\r\n\r\n**Actual result**\r\n\r\n- The following error is displayed:\r\n\r\n```\r\nAttack discovery generation failed\r\n\r\nActionsClientLlm: action result status is error: an error occurred while running the action - Response validation failed (Error: [modelVersion]: definition for this key is missing)\r\n```\r\n\r\n![error](https://github.com/user-attachments/assets/8b706290-27ca-42d9-b972-3d8613af690c)","sha":"699db81856eaf9a3666f4f46fa58ee4619b3b17c"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.15"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/192915","number":192915,"mergeCommit":{"message":"[Security Solution] [Attack discovery] Updates Gemini connector to ignore unknown properties in responses (#192915)\n\n## [Security Solution] [Attack discovery] Updates Gemini connector to ignore unknown properties in responses\r\n\r\n### Summary\r\n\r\nThis PR updates the Gemini connector's `RunApiResponseSchema` to ignore unknown properties in responses.\r\n\r\nIt fixes an issue where the recent addition of a `modelVersion` in Gemini responses causes Attack discovery to fail with the following error:\r\n\r\n```\r\nAttack discovery generation failed\r\n\r\nActionsClientLlm: action result status is error: an error occurred while running the action - Response validation failed (Error: [modelVersion]: definition for this key is missing)\r\n```\r\n\r\nshown in the screenshot below:\r\n\r\n![error](https://github.com/user-attachments/assets/8b706290-27ca-42d9-b972-3d8613af690c)\r\n\r\n### Desk testing\r\n\r\nTo reproduce:\r\n\r\n1) Navigate to Security > Attack discovery\r\n\r\n2) Select a Gemini connector\r\n\r\n3) Click Generate\r\n\r\n**Expected result**\r\n\r\n- Attack discoveries are generated\r\n\r\n**Actual result**\r\n\r\n- The following error is displayed:\r\n\r\n```\r\nAttack discovery generation failed\r\n\r\nActionsClientLlm: action result status is error: an error occurred while running the action - Response validation failed (Error: [modelVersion]: definition for this key is missing)\r\n```\r\n\r\n![error](https://github.com/user-attachments/assets/8b706290-27ca-42d9-b972-3d8613af690c)","sha":"699db81856eaf9a3666f4f46fa58ee4619b3b17c"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.15","label":"v8.15.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Andrew Macri <andrew.macri@elastic.co>
- Loading branch information