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 GenAI] Fetching Assistant Knowledge Base fails when current user's username contains a : character (#11159) #200131

Merged
merged 9 commits into from
Nov 18, 2024

Conversation

e40pud
Copy link
Contributor

@e40pud e40pud commented Nov 14, 2024

Summary

Original bug: internal link

This PR fixes the next bug:
When the user is logged in with a username that contains a : character, fetching Knowlege Base entries fails with an error. This is preventing customers from viewing their created KB entries. This problem affects ECE customers using the SSO login option.

There were a similar bugfix which inspired this one #181709

There is no easy way to reproduce this but you can try and change the line in question so that the faulty username is used instead of the one passed in.

@MadameSheema Do you know a way to login locally with the username that contains a : character? As mentioned above this situation is possible with the ECE customers using SSO login.

Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

@e40pud e40pud 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.17.0 v8.16.1 labels Nov 14, 2024
@e40pud e40pud self-assigned this Nov 14, 2024
@e40pud e40pud requested a review from a team as a code owner November 14, 2024 09:46
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

cc @e40pud

@e40pud e40pud merged commit aa0dcdc into elastic:main Nov 18, 2024
37 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.16, 8.x

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 18, 2024
… user's username contains a : character (elastic#11159) (elastic#200131)

## Summary

Original bug: [internal
link](elastic/security-team#11159)

**This PR fixes the next bug**:
When the user is logged in with a username that contains a `:`
character, fetching Knowlege Base entries fails with an error. This is
preventing customers from viewing their created KB entries. This problem
affects ECE customers using the SSO login option.

There were a similar bugfix which inspired this one
elastic#181709

There is no easy way to reproduce this but you can try and change the
line in question so that the faulty username is used instead of the one
passed in.

@MadameSheema Do you know a way to login locally with the username that
contains a `:` character? As mentioned above this situation is possible
with the ECE customers using SSO login.

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit aa0dcdc)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 18, 2024
… user's username contains a : character (elastic#11159) (elastic#200131)

## Summary

Original bug: [internal
link](elastic/security-team#11159)

**This PR fixes the next bug**:
When the user is logged in with a username that contains a `:`
character, fetching Knowlege Base entries fails with an error. This is
preventing customers from viewing their created KB entries. This problem
affects ECE customers using the SSO login option.

There were a similar bugfix which inspired this one
elastic#181709

There is no easy way to reproduce this but you can try and change the
line in question so that the faulty username is used instead of the one
passed in.

@MadameSheema Do you know a way to login locally with the username that
contains a `:` character? As mentioned above this situation is possible
with the ECE customers using SSO login.

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit aa0dcdc)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.16
8.x

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

Questions ?

Please refer to the Backport tool documentation

jesuswr pushed a commit to jesuswr/kibana that referenced this pull request Nov 18, 2024
… user's username contains a : character (elastic#11159) (elastic#200131)

## Summary

Original bug: [internal
link](elastic/security-team#11159)

**This PR fixes the next bug**:
When the user is logged in with a username that contains a `:`
character, fetching Knowlege Base entries fails with an error. This is
preventing customers from viewing their created KB entries. This problem
affects ECE customers using the SSO login option.

There were a similar bugfix which inspired this one
elastic#181709

There is no easy way to reproduce this but you can try and change the
line in question so that the faulty username is used instead of the one
passed in.

@MadameSheema Do you know a way to login locally with the username that
contains a `:` character? As mentioned above this situation is possible
with the ECE customers using SSO login.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
kibanamachine added a commit that referenced this pull request Nov 18, 2024
…urrent user&#x27;s username contains a : character (#11159) (#200131) (#200611)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security GenAI] Fetching Assistant Knowledge Base fails when current
user&#x27;s username contains a : character (#11159)
(#200131)](#200131)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Ievgen
Sorokopud","email":"ievgen.sorokopud@elastic.co"},"sourceCommit":{"committedDate":"2024-11-18T16:24:04Z","message":"[Security
GenAI] Fetching Assistant Knowledge Base fails when current user's
username contains a : character (#11159) (#200131)\n\n##
Summary\r\n\r\nOriginal bug:
[internal\r\nlink](https://github.com/elastic/security-team/issues/11159)\r\n\r\n**This
PR fixes the next bug**:\r\nWhen the user is logged in with a username
that contains a `:`\r\ncharacter, fetching Knowlege Base entries fails
with an error. This is\r\npreventing customers from viewing their
created KB entries. This problem\r\naffects ECE customers using the SSO
login option.\r\n\r\nThere were a similar bugfix which inspired this
one\r\nhttps://github.com//pull/181709\r\n\r\nThere is no
easy way to reproduce this but you can try and change the\r\nline in
question so that the faulty username is used instead of the
one\r\npassed in.\r\n\r\n@MadameSheema Do you know a way to login
locally with the username that\r\ncontains a `:` character? As mentioned
above this situation is possible\r\nwith the ECE customers using SSO
login.\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"aa0dcdcf0164a916d569ac269e87bb3179c467c2","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.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.17.0","v8.16.1"],"title":"[Security GenAI]
Fetching Assistant Knowledge Base fails when current user's username
contains a : character
(#11159)","number":200131,"url":"https://github.com/elastic/kibana/pull/200131","mergeCommit":{"message":"[Security
GenAI] Fetching Assistant Knowledge Base fails when current user's
username contains a : character (#11159) (#200131)\n\n##
Summary\r\n\r\nOriginal bug:
[internal\r\nlink](https://github.com/elastic/security-team/issues/11159)\r\n\r\n**This
PR fixes the next bug**:\r\nWhen the user is logged in with a username
that contains a `:`\r\ncharacter, fetching Knowlege Base entries fails
with an error. This is\r\npreventing customers from viewing their
created KB entries. This problem\r\naffects ECE customers using the SSO
login option.\r\n\r\nThere were a similar bugfix which inspired this
one\r\nhttps://github.com//pull/181709\r\n\r\nThere is no
easy way to reproduce this but you can try and change the\r\nline in
question so that the faulty username is used instead of the
one\r\npassed in.\r\n\r\n@MadameSheema Do you know a way to login
locally with the username that\r\ncontains a `:` character? As mentioned
above this situation is possible\r\nwith the ECE customers using SSO
login.\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"aa0dcdcf0164a916d569ac269e87bb3179c467c2"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200131","number":200131,"mergeCommit":{"message":"[Security
GenAI] Fetching Assistant Knowledge Base fails when current user's
username contains a : character (#11159) (#200131)\n\n##
Summary\r\n\r\nOriginal bug:
[internal\r\nlink](https://github.com/elastic/security-team/issues/11159)\r\n\r\n**This
PR fixes the next bug**:\r\nWhen the user is logged in with a username
that contains a `:`\r\ncharacter, fetching Knowlege Base entries fails
with an error. This is\r\npreventing customers from viewing their
created KB entries. This problem\r\naffects ECE customers using the SSO
login option.\r\n\r\nThere were a similar bugfix which inspired this
one\r\nhttps://github.com//pull/181709\r\n\r\nThere is no
easy way to reproduce this but you can try and change the\r\nline in
question so that the faulty username is used instead of the
one\r\npassed in.\r\n\r\n@MadameSheema Do you know a way to login
locally with the username that\r\ncontains a `:` character? As mentioned
above this situation is possible\r\nwith the ECE customers using SSO
login.\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"aa0dcdcf0164a916d569ac269e87bb3179c467c2"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Ievgen Sorokopud <ievgen.sorokopud@elastic.co>
kibanamachine added a commit that referenced this pull request Nov 18, 2024
…current user&#x27;s username contains a : character (#11159) (#200131) (#200610)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[Security GenAI] Fetching Assistant Knowledge Base fails when current
user&#x27;s username contains a : character (#11159)
(#200131)](#200131)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Ievgen
Sorokopud","email":"ievgen.sorokopud@elastic.co"},"sourceCommit":{"committedDate":"2024-11-18T16:24:04Z","message":"[Security
GenAI] Fetching Assistant Knowledge Base fails when current user's
username contains a : character (#11159) (#200131)\n\n##
Summary\r\n\r\nOriginal bug:
[internal\r\nlink](https://github.com/elastic/security-team/issues/11159)\r\n\r\n**This
PR fixes the next bug**:\r\nWhen the user is logged in with a username
that contains a `:`\r\ncharacter, fetching Knowlege Base entries fails
with an error. This is\r\npreventing customers from viewing their
created KB entries. This problem\r\naffects ECE customers using the SSO
login option.\r\n\r\nThere were a similar bugfix which inspired this
one\r\nhttps://github.com//pull/181709\r\n\r\nThere is no
easy way to reproduce this but you can try and change the\r\nline in
question so that the faulty username is used instead of the
one\r\npassed in.\r\n\r\n@MadameSheema Do you know a way to login
locally with the username that\r\ncontains a `:` character? As mentioned
above this situation is possible\r\nwith the ECE customers using SSO
login.\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"aa0dcdcf0164a916d569ac269e87bb3179c467c2","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.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.17.0","v8.16.1"],"title":"[Security GenAI]
Fetching Assistant Knowledge Base fails when current user's username
contains a : character
(#11159)","number":200131,"url":"https://github.com/elastic/kibana/pull/200131","mergeCommit":{"message":"[Security
GenAI] Fetching Assistant Knowledge Base fails when current user's
username contains a : character (#11159) (#200131)\n\n##
Summary\r\n\r\nOriginal bug:
[internal\r\nlink](https://github.com/elastic/security-team/issues/11159)\r\n\r\n**This
PR fixes the next bug**:\r\nWhen the user is logged in with a username
that contains a `:`\r\ncharacter, fetching Knowlege Base entries fails
with an error. This is\r\npreventing customers from viewing their
created KB entries. This problem\r\naffects ECE customers using the SSO
login option.\r\n\r\nThere were a similar bugfix which inspired this
one\r\nhttps://github.com//pull/181709\r\n\r\nThere is no
easy way to reproduce this but you can try and change the\r\nline in
question so that the faulty username is used instead of the
one\r\npassed in.\r\n\r\n@MadameSheema Do you know a way to login
locally with the username that\r\ncontains a `:` character? As mentioned
above this situation is possible\r\nwith the ECE customers using SSO
login.\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"aa0dcdcf0164a916d569ac269e87bb3179c467c2"}},"sourceBranch":"main","suggestedTargetBranches":["8.x","8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200131","number":200131,"mergeCommit":{"message":"[Security
GenAI] Fetching Assistant Knowledge Base fails when current user's
username contains a : character (#11159) (#200131)\n\n##
Summary\r\n\r\nOriginal bug:
[internal\r\nlink](https://github.com/elastic/security-team/issues/11159)\r\n\r\n**This
PR fixes the next bug**:\r\nWhen the user is logged in with a username
that contains a `:`\r\ncharacter, fetching Knowlege Base entries fails
with an error. This is\r\npreventing customers from viewing their
created KB entries. This problem\r\naffects ECE customers using the SSO
login option.\r\n\r\nThere were a similar bugfix which inspired this
one\r\nhttps://github.com//pull/181709\r\n\r\nThere is no
easy way to reproduce this but you can try and change the\r\nline in
question so that the faulty username is used instead of the
one\r\npassed in.\r\n\r\n@MadameSheema Do you know a way to login
locally with the username that\r\ncontains a `:` character? As mentioned
above this situation is possible\r\nwith the ECE customers using SSO
login.\r\n\r\n### Checklist\r\n\r\nCheck the PR satisfies following
conditions. \r\n\r\nReviewers should verify this PR satisfies this list
as well.\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"aa0dcdcf0164a916d569ac269e87bb3179c467c2"}},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.16","label":"v8.16.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Ievgen Sorokopud <ievgen.sorokopud@elastic.co>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Dec 12, 2024
… user's username contains a : character (elastic#11159) (elastic#200131)

## Summary

Original bug: [internal
link](elastic/security-team#11159)

**This PR fixes the next bug**:
When the user is logged in with a username that contains a `:`
character, fetching Knowlege Base entries fails with an error. This is
preventing customers from viewing their created KB entries. This problem
affects ECE customers using the SSO login option.

There were a similar bugfix which inspired this one
elastic#181709

There is no easy way to reproduce this but you can try and change the
line in question so that the faulty username is used instead of the one
passed in.

@MadameSheema Do you know a way to login locally with the username that
contains a `:` character? As mentioned above this situation is possible
with the ECE customers using SSO login.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
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.16.1 v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants