Skip to content

[Security solution] Bedrock region fix#214251

Merged
stephmilovic merged 3 commits intoelastic:mainfrom
stephmilovic:bedrock_region_fix
Mar 13, 2025
Merged

[Security solution] Bedrock region fix#214251
stephmilovic merged 3 commits intoelastic:mainfrom
stephmilovic:bedrock_region_fix

Conversation

@stephmilovic
Copy link
Contributor

@stephmilovic stephmilovic commented Mar 12, 2025

Summary

The regex to extract the region from the Bedrock url was incorrect. This resulted in the region getting defaulted to us-east-1. This PR corrects the regex, and adds tests for each possible Bedrock runtime url to ensure the regex works as expected.

I also extracted any utility functions used by the bedrock connector into a utils file and added tests for each utility function.

@stephmilovic stephmilovic added release_note:fix v9.0.0 Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Security Generative AI Security Generative AI backport:version Backport to applied version labels v8.18.0 v9.1.0 v8.19.0 v8.17.4 labels Mar 12, 2025
@stephmilovic stephmilovic requested review from a team as code owners March 12, 2025 17:42
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

@stephmilovic stephmilovic merged commit cf73559 into elastic:main Mar 13, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.18, 8.x, 9.0

https://github.com/elastic/kibana/actions/runs/13836466796

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Mar 13, 2025
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.17 Backport failed because of merge conflicts
8.18 Backport failed because of merge conflicts
8.x
9.0 Backport failed because of merge conflicts

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 214251

Questions ?

Please refer to the Backport tool documentation

stephmilovic added a commit to stephmilovic/kibana that referenced this pull request Mar 13, 2025
(cherry picked from commit cf73559)

# Conflicts:
#	x-pack/platform/plugins/shared/stack_connectors/server/connector_types/bedrock/bedrock.ts
stephmilovic added a commit to stephmilovic/kibana that referenced this pull request Mar 13, 2025
(cherry picked from commit cf73559)

# Conflicts:
#	x-pack/platform/plugins/shared/stack_connectors/server/connector_types/bedrock/bedrock.ts
@stephmilovic
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
9.0
8.18
8.17

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

Questions ?

Please refer to the Backport tool documentation

stephmilovic added a commit to stephmilovic/kibana that referenced this pull request Mar 13, 2025
(cherry picked from commit cf73559)

# Conflicts:
#	x-pack/plugins/stack_connectors/server/connector_types/bedrock/bedrock.ts
#	x-pack/plugins/stack_connectors/server/connector_types/bedrock/utils.test.ts
#	x-pack/plugins/stack_connectors/server/connector_types/bedrock/utils.ts
kibanamachine added a commit that referenced this pull request Mar 13, 2025
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security solution] Bedrock region fix
(#214251)](#214251)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Steph
Milovic","email":"stephanie.milovic@elastic.co"},"sourceCommit":{"committedDate":"2025-03-13T14:01:03Z","message":"[Security
solution] Bedrock region fix
(#214251)","sha":"cf73559e2dd5ce6e793b6b92183c43e6e09fc629","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:
SecuritySolution","Team:Security Generative
AI","backport:version","v8.18.0","v9.1.0","v8.19.0","v8.17.4"],"title":"[Security
solution] Bedrock region
fix","number":214251,"url":"https://github.com/elastic/kibana/pull/214251","mergeCommit":{"message":"[Security
solution] Bedrock region fix
(#214251)","sha":"cf73559e2dd5ce6e793b6b92183c43e6e09fc629"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x","8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214251","number":214251,"mergeCommit":{"message":"[Security
solution] Bedrock region fix
(#214251)","sha":"cf73559e2dd5ce6e793b6b92183c43e6e09fc629"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Steph Milovic <stephanie.milovic@elastic.co>
stephmilovic added a commit that referenced this pull request Mar 13, 2025
# Backport

This will backport the following commits from `main` to `9.0`:
- [[Security solution] Bedrock region fix
(#214251)](#214251)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Steph
Milovic","email":"stephanie.milovic@elastic.co"},"sourceCommit":{"committedDate":"2025-03-13T14:01:03Z","message":"[Security
solution] Bedrock region fix
(#214251)","sha":"cf73559e2dd5ce6e793b6b92183c43e6e09fc629","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:
SecuritySolution","Team:Security Generative
AI","backport:version","v8.18.0","v9.1.0","v8.19.0","v8.17.4"],"title":"[Security
solution] Bedrock region
fix","number":214251,"url":"https://github.com/elastic/kibana/pull/214251","mergeCommit":{"message":"[Security
solution] Bedrock region fix
(#214251)","sha":"cf73559e2dd5ce6e793b6b92183c43e6e09fc629"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214251","number":214251,"mergeCommit":{"message":"[Security
solution] Bedrock region fix
(#214251)","sha":"cf73559e2dd5ce6e793b6b92183c43e6e09fc629"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/214388","number":214388,"state":"OPEN"},{"branch":"8.17","label":"v8.17.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
stephmilovic added a commit that referenced this pull request Mar 13, 2025
# Backport

This will backport the following commits from `main` to `8.17`:
- [[Security solution] Bedrock region fix
(#214251)](#214251)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Steph
Milovic","email":"stephanie.milovic@elastic.co"},"sourceCommit":{"committedDate":"2025-03-13T14:01:03Z","message":"[Security
solution] Bedrock region fix
(#214251)","sha":"cf73559e2dd5ce6e793b6b92183c43e6e09fc629","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:
SecuritySolution","Team:Security Generative
AI","backport:version","v8.18.0","v9.1.0","v8.19.0","v8.17.4"],"title":"[Security
solution] Bedrock region
fix","number":214251,"url":"https://github.com/elastic/kibana/pull/214251","mergeCommit":{"message":"[Security
solution] Bedrock region fix
(#214251)","sha":"cf73559e2dd5ce6e793b6b92183c43e6e09fc629"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214251","number":214251,"mergeCommit":{"message":"[Security
solution] Bedrock region fix
(#214251)","sha":"cf73559e2dd5ce6e793b6b92183c43e6e09fc629"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/214388","number":214388,"state":"OPEN"},{"branch":"8.17","label":"v8.17.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
stephmilovic added a commit that referenced this pull request Mar 13, 2025
# Backport

This will backport the following commits from `main` to `8.18`:
- [[Security solution] Bedrock region fix
(#214251)](#214251)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Steph
Milovic","email":"stephanie.milovic@elastic.co"},"sourceCommit":{"committedDate":"2025-03-13T14:01:03Z","message":"[Security
solution] Bedrock region fix
(#214251)","sha":"cf73559e2dd5ce6e793b6b92183c43e6e09fc629","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:
SecuritySolution","Team:Security Generative
AI","backport:version","v8.18.0","v9.1.0","v8.19.0","v8.17.4"],"title":"[Security
solution] Bedrock region
fix","number":214251,"url":"https://github.com/elastic/kibana/pull/214251","mergeCommit":{"message":"[Security
solution] Bedrock region fix
(#214251)","sha":"cf73559e2dd5ce6e793b6b92183c43e6e09fc629"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.17"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/214251","number":214251,"mergeCommit":{"message":"[Security
solution] Bedrock region fix
(#214251)","sha":"cf73559e2dd5ce6e793b6b92183c43e6e09fc629"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/214388","number":214388,"state":"OPEN"},{"branch":"8.17","label":"v8.17.4","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:fix Team:Security Generative AI Security Generative AI Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.17.4 v8.18.0 v8.19.0 v9.0.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants