Which users are Nexus Repository Manager Admins? - Sonatype Nexus Repository / Best Practices - Sonatype Community

Which users are Nexus Repository Manager Admins?

post by mworthington on Jun 1, 2018

Michael Worthington

Continuing the discussion from Advanced Use Cases for the Nexus Repository Manager API:

An important piece of information for Nexus Administrators is understanding what users have access to which parts of the application, or more specifically, what users are assigned to a specific role. With the API and UI, it is easy to look up a specific user and see all of the roles assigned to that user. But doing the opposite takes a little more work.

By leveraging the Integrations API, you can upload this groovy script nexus-scripting-examples/listRolesToUsers.groovy at master · sonatype-nexus-community/nexus-scripting-examples · GitHub and use a REST-style call to run the script to get all the roles, or one specific role, and their assigned users.

Lookup all users with Nexus Administrator privileges:

curl -X POST http://localhost:8081/service/siesta/rest/v1/script/listrolestousers/run -u username:password -H 'content-type: text/plain' -d '{ "id": "nx-admin" }' | jq -c -r '.result' | jq .

I am using jq to format the result curl stdout as json to make it nice and pretty to read. Here are all the admin users in my demo instance:

{
  "nx-admin": [
      "admin",
      "homer",
      "marge",
      "mworthington",
      "nrmfirewall"
  ]
}

New & Unread Topics

Topic Replies Views Activity
Nexus H2 repair steps for version 3.79
Best Practices
3 221 Mar 6
Application Health Check required permissions for role assignment
Best Practices
nexus-v3
2 94 Mar 25
RAW Repository Powershell Helpfiles
Best Practices
nexus-repository, help
1 78 Mar 2
Upgrade from 3.80 to 3.89 failed
Best Practices
nexus-repository, help, upgrade
1 190 Feb 5
Are there official STIGs or hardening guidelines available for Sonatype Nexus Repository?
Best Practices
nexus-repository
2 122 Apr 23