API key pair restructure follow-ups - #13828
Open
bernardodemarco wants to merge 2 commits into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13828 +/- ##
============================================
- Coverage 19.64% 19.64% -0.01%
+ Complexity 19790 19785 -5
============================================
Files 6368 6368
Lines 574889 574904 +15
Branches 70353 70358 +5
============================================
- Hits 112962 112937 -25
- Misses 449656 449694 +38
- Partials 12271 12273 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Member
Author
|
@blueorangutan package |
|
@bernardodemarco a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18805 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A workflow introduced in the API key pair restructure tries to retrieve the accessing API key contained in HTTP requests by looking up for the
apiKeystring in a case-sensitive way. However, when verifying a request, the Management Server also accepts the API key to be specified in lowercase (apikey). The same behavior happens for thesignatureparameter.Thus, if the API key is specified as
apikeyin HTTP requests, the key pair validation workflow does not identify the key used for authentication and it assumes that they are established via session. This behavior can leak key pairs with broader permission sets than the accessing pair actually has. These leaks can only happen for pairs belonging to the same user; one user from one account is not able to access keys from another user of another account.Another incorrect behavior was found out, which allows for an accessing API key with a limited permission scope to register other pairs with all the permissions of the corresponding user's account. This is possible when no explicit permissions are defined and, under these circumstances, the registration workflow assumes the authentication was performed with an accessing pair without any explicit permissions as well.
This PR fixes all these reported issues.
Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
I created an API key pair with the following permissions. This pair was used for the execution of all described test cases, except when informed otherwise:
API key pair permissions
Leak of key pairs belonging to the same user
listUserKeysAPI with the key pair created in the previous stepgetUserKeysAPIRegistration of key pairs with a broader permission scope
registerUserKeysAPI without specifying explicit rulesregisterUserKeysAPI specifying a rule set belonging to the set of the key pair used to perform the requestregisterUserKeysAPI specifying rules which the accessing key pair does not have access to