PlatformMaintainAccess

Identify Mondoo organization and space IDs

To find the ID of an organization and a space:

  1. In the top navigation bar of the Mondoo App, select your region. Mondoo displays all organizations in the region.

    Mondoo organization ID

    Note each organization's ID in smaller text below the organization name. In the image above, the organization IDs are blissful-mcnulty-255959 and dewey-marzipan.

  2. Select the organization containing the space you want and, in the side navigation bar, select Spaces.

    Mondoo spaces

  3. Select the space you want and, in the side navigation bar, select Settings.

    Mondoo space ID

    On the General Settings tab, note the ID of the space in the first field, Name (A unique ID used to identify this space). In the image above, the space ID is bunny-ears-chopsticks.

Grant Mondoo organization and space access using cURL

Send a setScimGroupMapping GraphQL mutation based on this sample:

mutation {
  setScimGroupMapping(
    input: {
      orgMrn: "//captain.api.mondoo.app/organizations/YOUR-ORG-ID"
      group: "YOUR-IDP-GROUP"
      mappings: [
        {
          orgMrn: "//captain.api.mondoo.app/organizations/YOUR-ORG-ID"
          iamRole: "//iam.api.mondoo.app/roles/editor"
        }
        {
          spaceMrn: "//captain.api.mondoo.app/spaces/YOUR-SPACE-ID"
          iamRole: "//iam.api.mondoo.app/roles/editor"
        }
        {
          spaceMrn: "//captain.api.mondoo.app/spaces/YOUR-SPACE-ID"
          iamRole: "//iam.api.mondoo.app/roles/viewer"
        }
      ]
    }
  ) {
    group
  }
}

Each entry in mappings grants one role. Use orgMrn to grant the role across the whole organization, or spaceMrn to grant it in a single space. The sample above grants the group the editor role organization-wide, the editor role in one space, and the viewer role in that same space.

To send the mutation with cURL, save it as a JSON request body in a file named scim-mapping.gql. The API expects the mutation in the query field of a JSON object, so it is collapsed onto one line with the inner quotes escaped:

{
  "query": "mutation { setScimGroupMapping(input: { orgMrn: \"//captain.api.mondoo.app/organizations/YOUR-ORG-ID\", group: \"YOUR-IDP-GROUP\", mappings: [{ orgMrn: \"//captain.api.mondoo.app/organizations/YOUR-ORG-ID\", iamRole: \"//iam.api.mondoo.app/roles/editor\" }, { spaceMrn: \"//captain.api.mondoo.app/spaces/YOUR-SPACE-ID\", iamRole: \"//iam.api.mondoo.app/roles/editor\" }, { spaceMrn: \"//captain.api.mondoo.app/spaces/YOUR-SPACE-ID\", iamRole: \"//iam.api.mondoo.app/roles/viewer\" }] }) { group } }"
}
For...Substitute...
YOUR-ORG-IDThe ID of the organization to which you want to grant a group access
YOUR-SPACE-IDThe ID of the space to which you want to grant a group access

Execute the query:

$ export TOKEN='eyJhbGciOiJF...'
$ curl -i -X POST -H "content-type: application/json" \
  -H "authorization: Bearer $TOKEN" -d @scim-mapping.gql \
  https://api.YOUR-COMPANY-NAME.mondoo.com/query

On this page