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

System admin should not be able to read user's API key #73

Closed
mKowalski256 opened this issue Jul 30, 2024 · 1 comment
Closed

System admin should not be able to read user's API key #73

mKowalski256 opened this issue Jul 30, 2024 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mKowalski256
Copy link
Contributor

mKowalski256 commented Jul 30, 2024

To Reproduce
Steps to reproduce the behavior:

  1. Login as a userA, go to My RSpace -> My Profile page, generate API key.
  2. Logout, login as a System Admin, go to System page, start 'Operating as' the userA
  3. While operating as the userA, navigate to their profile, scroll down to 'API key and click on 'show key'
    -- the System Admin will be able to see the user's API key

Additionally, there is a sysadmin API allowing to retrieve users' API keys.

Expected behavior
Only user should be able to access their API key. While the System Admin is a privileged user, they shouldn't be able to impersonate users outside the impersonations scheme provided by the GUI app itself.

There may be specific migration scenarios that use API to re-create user's content, and for that they need to create/retrieve/delete API keys. We may keep supporting API methods meant for that, but these should be guarded by deployment property that is disabled by default.

Also note that while action of viewing user's API key is traceable (logged in httpRequests.log and error.log) it's maybe worth additional logging in SecurityEvents.txt.

Additional context
Based on a reported issue #58.

@mKowalski256 mKowalski256 added the bug Something isn't working label Jul 30, 2024
@rspace-os rspace-os deleted a comment from github-actions bot Jul 30, 2024
@mKowalski256 mKowalski256 changed the title System admin should not see user's API key in 'operate as' mode System admin should not be able to read user's API key Jul 30, 2024
@mKowalski256
Copy link
Contributor Author

Fixed with commit 73ae18d522a - System Admin should no longer be able to retrieve API key generated by the user.

Note that System Admin can still revoke/regenerate new API key for the user - these are useful in some support scenarios, and risk-wise it's similar to how we allow System Admin to change user's password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants