cloudstack icon indicating copy to clipboard operation
cloudstack copied to clipboard

Unable to access exact web ui to delete SSH Key Pair Button

Open apraba05 opened this issue 1 year ago • 4 comments

I'm currently looking to find where the SSH Key Pair Button can be removed from the UI as our customers don't need this. I've dug through the chunk files but there is no clear indication as to where the exact file or where I can delete the UI is.

Thanks!

apraba05 avatar May 07 '25 17:05 apraba05

Thanks for opening your first issue here! Be sure to follow the issue template!

boring-cyborg[bot] avatar May 07 '25 17:05 boring-cyborg[bot]

Image

This is the current view but we are unable to find the exact source code as to where we remove these components as the user doesn't need access to this or needs to view this. Thanks!

apraba05 avatar May 07 '25 18:05 apraba05

Hello, @apraba05

This is the source code that controls the display of the SSH key pairs section:

https://github.com/apache/cloudstack/blob/39c5641cbe674b19bc77082b850565f634a7cb84/ui/src/config/section/compute.js#L827-L910

The best approach to hide it from end users is by revoking access to the APIs that manage SSH key pairs, which essentially are: listSSHKeyPairs, createSSHKeyPair and deleteSSHKeyPair. To revoke the APIs access, I'd recommend creating a custom role based on the existing role that is in use by the end user accounts.

bernardodemarco avatar May 07 '25 18:05 bernardodemarco

I'm actually just looking to remove it completely from the UI. This would then ensure that the user is unable to view it all. It's fine even if the Administrators are unable to view it too. I needed to do it for the Affinity Groups and User Data.

Thanks for your help @bernardodemarco!

apraba05 avatar May 07 '25 19:05 apraba05