API key pair restructure follow-ups - #13828
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:
|
|
@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 |
|
@blueorangutan test |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
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