-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] [Attack discovery] Updates Gemini connector to ignore unknown properties in responses #192915
[Security Solution] [Attack discovery] Updates Gemini connector to ignore unknown properties in responses #192915
Conversation
… ignore unknown properties in responses ### Summary This PR updates the Gemini connector's `RunApiResponseSchema` to ignore unknown properties in responses. It fixes an issue where the recent addition of a `modelVersion` in Gemini responses causes Attack discovery to fail with the following error: ``` Attack discovery generation failed ActionsClientLlm: action result status is error: an error occurred while running the action - Response validation failed (Error: [modelVersion]: definition for this key is missing) ``` shown in the screenshot below: ![error](https://github.com/user-attachments/assets/8b706290-27ca-42d9-b972-3d8613af690c) ### Desk testing To reproduce: 1) Navigate to Security > Attack discovery 2) Select a Gemini connector 3) Click Generate **Expected result** - Attack discoveries are generated **Actual result** - The following error is displayed: ``` Attack discovery generation failed ActionsClientLlm: action result status is error: an error occurred while running the action - Response validation failed (Error: [modelVersion]: definition for this key is missing) ``` ![error](https://github.com/user-attachments/assets/8b706290-27ca-42d9-b972-3d8613af690c)
Pinging @elastic/security-solution (Team: SecuritySolution) |
Files by Code Ownerelastic/appex-ai-infra
elastic/obs-ai-assistant
elastic/response-ops
elastic/security-generative-ai
|
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 for the fix, LGTM!
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]
History
To update your PR or re-run it, just comment with: |
…nore unknown properties in responses (elastic#192915) ## [Security Solution] [Attack discovery] Updates Gemini connector to ignore unknown properties in responses ### Summary This PR updates the Gemini connector's `RunApiResponseSchema` to ignore unknown properties in responses. It fixes an issue where the recent addition of a `modelVersion` in Gemini responses causes Attack discovery to fail with the following error: ``` Attack discovery generation failed ActionsClientLlm: action result status is error: an error occurred while running the action - Response validation failed (Error: [modelVersion]: definition for this key is missing) ``` shown in the screenshot below: ![error](https://github.com/user-attachments/assets/8b706290-27ca-42d9-b972-3d8613af690c) ### Desk testing To reproduce: 1) Navigate to Security > Attack discovery 2) Select a Gemini connector 3) Click Generate **Expected result** - Attack discoveries are generated **Actual result** - The following error is displayed: ``` Attack discovery generation failed ActionsClientLlm: action result status is error: an error occurred while running the action - Response validation failed (Error: [modelVersion]: definition for this key is missing) ``` ![error](https://github.com/user-attachments/assets/8b706290-27ca-42d9-b972-3d8613af690c) (cherry picked from commit 699db81)
…nore unknown properties in responses (elastic#192915) ## [Security Solution] [Attack discovery] Updates Gemini connector to ignore unknown properties in responses ### Summary This PR updates the Gemini connector's `RunApiResponseSchema` to ignore unknown properties in responses. It fixes an issue where the recent addition of a `modelVersion` in Gemini responses causes Attack discovery to fail with the following error: ``` Attack discovery generation failed ActionsClientLlm: action result status is error: an error occurred while running the action - Response validation failed (Error: [modelVersion]: definition for this key is missing) ``` shown in the screenshot below: ![error](https://github.com/user-attachments/assets/8b706290-27ca-42d9-b972-3d8613af690c) ### Desk testing To reproduce: 1) Navigate to Security > Attack discovery 2) Select a Gemini connector 3) Click Generate **Expected result** - Attack discoveries are generated **Actual result** - The following error is displayed: ``` Attack discovery generation failed ActionsClientLlm: action result status is error: an error occurred while running the action - Response validation failed (Error: [modelVersion]: definition for this key is missing) ``` ![error](https://github.com/user-attachments/assets/8b706290-27ca-42d9-b972-3d8613af690c) (cherry picked from commit 699db81)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…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":"#192915 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](#192915 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>
… to ignore unknown properties in responses (#192915) (#193222) # Backport This will backport the following commits from `main` to `8.x`: - [[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":"#192915 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](#192915 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>
…nore unknown properties in responses (elastic#192915) ## [Security Solution] [Attack discovery] Updates Gemini connector to ignore unknown properties in responses ### Summary This PR updates the Gemini connector's `RunApiResponseSchema` to ignore unknown properties in responses. It fixes an issue where the recent addition of a `modelVersion` in Gemini responses causes Attack discovery to fail with the following error: ``` Attack discovery generation failed ActionsClientLlm: action result status is error: an error occurred while running the action - Response validation failed (Error: [modelVersion]: definition for this key is missing) ``` shown in the screenshot below: ![error](https://github.com/user-attachments/assets/8b706290-27ca-42d9-b972-3d8613af690c) ### Desk testing To reproduce: 1) Navigate to Security > Attack discovery 2) Select a Gemini connector 3) Click Generate **Expected result** - Attack discoveries are generated **Actual result** - The following error is displayed: ``` Attack discovery generation failed ActionsClientLlm: action result status is error: an error occurred while running the action - Response validation failed (Error: [modelVersion]: definition for this key is missing) ``` ![error](https://github.com/user-attachments/assets/8b706290-27ca-42d9-b972-3d8613af690c)
[Security Solution] [Attack discovery] Updates Gemini connector to ignore unknown properties in responses
Summary
This PR updates the Gemini connector's
RunApiResponseSchema
to ignore unknown properties in responses.It fixes an issue where the recent addition of a
modelVersion
in Gemini responses causes Attack discovery to fail with the following error:shown in the screenshot below:
Desk testing
To reproduce:
Navigate to Security > Attack discovery
Select a Gemini connector
Click Generate
Expected result
Actual result