-
Notifications
You must be signed in to change notification settings - Fork 301
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
Escape pipe character for injected users #5175
Conversation
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5175 +/- ##
==========================================
- Coverage 71.68% 71.64% -0.04%
==========================================
Files 337 337
Lines 22785 22788 +3
Branches 3605 3605
==========================================
- Hits 16333 16327 -6
- Misses 4651 4655 +4
- Partials 1801 1806 +5
🚀 New features to boost your workflow:
|
Do we know where the error message noted in #2756 comes from?
I do not see it touched in the PR, so I would guess that the error still persists. |
This error is specifically from AOS. The actual issue reported mentions usage of usage of Cognito with Amazon OpenSearch Service (AOS). |
Thank you for the PR @shikharj05! The user's reporting the issue have only mentioned a problem with usernames in certain SSO providers. Do you think we should limit this change to username and add logic to forbid it in other fields like roles and backend roles or should we do a blanket escape for all fields? |
IMO, it's better to escape all fields like roles, tenants, etc to be consistent and prevent future issues in the same area. |
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.
Thank you @shikharj05
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/security/backport-2.19 2.19
# Navigate to the new working tree
pushd ../.worktrees/security/backport-2.19
# Create a new branch
git switch --create backport/backport-5175-to-2.19
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 1c787b5125a23e872acf77a6b9b83902791596a5
# Push it to GitHub
git push --set-upstream origin backport/backport-5175-to-2.19
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/security/backport-2.19 Then, create a pull request where the |
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Description
Escape pipe while setting UserInfo in ThreadContext
Common-utils PR- opensearch-project/common-utils#801
Bug fix
Allow OIDC use-cases where username contain pipes.
usernames, roles & tenants will escape pipe character if present.
Issues Resolved
#2756
Is this a backport? If so, please add backport PR # and/or commits #, and remove
backport-failed
label from the original PR.Do these changes introduce new permission(s) to be displayed in the static dropdown on the front-end? If so, please open a draft PR in the security dashboards plugin and link the draft PR here
Testing
[Please provide details of testing done: unit testing, integration testing and manual testing]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.