API key pair restructure follow-ups - #13828
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13828 +/- ##
=========================================
Coverage 19.65% 19.65%
- Complexity 19798 19803 +5
=========================================
Files 6368 6368
Lines 574943 574965 +22
Branches 70355 70361 +6
=========================================
+ Hits 113015 113030 +15
- Misses 449658 449660 +2
- Partials 12270 12275 +5
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 |
|
[SF] Trillian test result (tid-16728)
|
|
@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 18865 |
|
@blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-16758)
|
|
thanks @bernardodemarco @winterhazel @wido |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
…ponding permissions denied in the account's role
9747ad0 to
dee7dd3
Compare
|
@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 18898 |
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