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

[Security solution] AI connector changes #170150

Merged
merged 3 commits into from
Oct 30, 2023

Conversation

stephmilovic
Copy link
Contributor

@stephmilovic stephmilovic commented Oct 30, 2023

Summary

Two quick 8.11 fixes for GenAI connectors:

  1. Increase timeout for runApi sub-action of OpenAI connector, allowing for more time for the request to fulfill for non-streaming requests (Feature Request: Adjustable response timeout per GenAI connector #166561, https://github.com/elastic/security-team/issues/7873)
  2. Adds the service: bedrock argument to the aws signature for bedrock requests. Their documentation said they could infer this value from the url, but this has proven to be false. Prevents this error that was happening for some regions:
Screenshot 2023-10-30 at 10 49 39 AM

@stephmilovic stephmilovic 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. Team:Threat Hunting:Explore v8.11.0 v8.12.0 labels Oct 30, 2023
@stephmilovic stephmilovic requested review from a team as code owners October 30, 2023 16:03
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

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

@@ -114,6 +114,8 @@ export class OpenAIConnector extends SubActionConnector<Config, Secrets> {
method: 'post',
responseSchema: RunActionResponseSchema,
data: sanitizedBody,
// give up to 2 minutes for response
timeout: 120000,
Copy link
Member

Choose a reason for hiding this comment

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

Have you tried this in practice? The thing I'm worrying about is that task manager could potentially "kill" the task if it hit's IT's timeout limit - which I believe can be extended but will need to look up how ...

TM can't really kill a task, but will basically ignore it if it runs over it's time-limit, and would then generate some kind of warning / error. And potentially retry it, but I believe it doesn't today ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See this issue #166561

Copy link
Contributor Author

@stephmilovic stephmilovic Oct 30, 2023

Choose a reason for hiding this comment

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

Have you tried this in practice?

We already have this length timeout on bedrock. @jamesspi has been running into issues with OpenAI not having enough time, and has been using Bedrock because it allows the extra time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the default task timeout is 5 minutes and I don't think we set a custom timeout for action tasks so this shouldn't be cancelled due to timeout

Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

code LGTM, given comments in the PR concerning task manager timeouts.

@stephmilovic stephmilovic enabled auto-merge (squash) October 30, 2023 21:11
Copy link
Contributor

@YulNaumenko YulNaumenko left a comment

Choose a reason for hiding this comment

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

LGTM

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Serverless Security Cypress Tests #1 / Enrichment Custom query rule from new risk scores Should has enrichment fields from legacy risk Should has enrichment fields from legacy risk

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.11

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 30, 2023
kibanamachine added a commit that referenced this pull request Oct 31, 2023
# Backport

This will backport the following commits from `main` to `8.11`:
- [[Security solution] AI connector changes
(#170150)](#170150)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT [{"author":{"name":"Steph
Milovic","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-10-30T22:31:47Z","message":"[Security
solution] AI connector changes
(#170150)","sha":"75586c8233ff83ab0df403d13d5a674c216d0271","branchLabelMapping":{"^v8.12.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Threat
Hunting","Team: SecuritySolution","Team:Threat
Hunting:Explore","v8.11.0","v8.12.0"],"number":170150,"url":"https://github.com/elastic/kibana/pull/170150","mergeCommit":{"message":"[Security
solution] AI connector changes
(#170150)","sha":"75586c8233ff83ab0df403d13d5a674c216d0271"}},"sourceBranch":"main","suggestedTargetBranches":["8.11"],"targetPullRequestStates":[{"branch":"8.11","label":"v8.11.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.12.0","labelRegex":"^v8.12.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/170150","number":170150,"mergeCommit":{"message":"[Security
solution] AI connector changes
(#170150)","sha":"75586c8233ff83ab0df403d13d5a674c216d0271"}}]}]
BACKPORT-->

Co-authored-by: Steph Milovic <[email protected]>
@jamesspi jamesspi added this to the 8.11 milestone Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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:Explore Team:Threat Hunting Security Solution Threat Hunting Team v8.11.0 v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants