website logo
HomeGithubSlack
⌘K
Overview
Quick Start
Supported Services
Running CloudGraph in EKS
Compliance
Rules Engine
AWS
Querying AWS Data
AWS Policy Packs
Billing Data
Services
Azure
Querying Azure Data
Azure Policy Packs
Services
GCP
Querying GCP Data
GCP Policy Packs
Services
K8s
Querying Kubernetes Data
Services
Docs powered by archbee 

AuthRoleDefinition

15min

Note: if you are running CloudGraph locally you can view the interactive, automatically generated documentation in either GraphQL Playground or Altair by clicking the docs button on the right-hand side of the screen. After reading the below information we highly suggest you use one of these tools to test your queries as they will autocomplete fields for you and let you know if your queries are valid before you even submit them.

Overview

You can currently query the following attribute on an Authorization Role Definition

GraphQL
|
query {
  queryazureAuthRoleDefinition{
    id
    name
    type
    region
    subscriptionId
    roleName
    description
    roleType
    permissions{
      id
      actions
      notActions
      dataActions
      notDataActions
    }
    assignableScopes
  }
}


Filtering

Get data for a single Authorization Role Definition key that you know the ID for:

GraphQL
|
query {
  getazureAuthRoleDefinition(id: "12345") {
    id
    # Other fields here...
  }
}


Get data for all of the Authorization Role Definitions in a certain Azure subscription:

GraphQL
|
query {
  queryazureAuthRoleDefinition(filter: { subscriptionId: { eq: "12345" } }) {
    id
    # Other fields and connections here...
  }
}

# Note that in addition to "subscriptionId" you can
# Filter based on any of the following attributes:

# id
# name
# type
# region
# subscriptionId
# roleName
# description
# roleType

# And the following Dgraph filters can also be applied:

# has
# and
# or
# not
# regexp (regular expressions)

# fulltext filters

# alloftext
# anyoftext


Get data for all of the Authorization Role Definitions that are NOT in a certain Azure subscription:

GraphQL
|
query {
  queryazureAuthRoleDefinition(filter: { not: { subscriptionId: { eq: "12345" } } }) {
    id
    # Other fields and connections here...
  }
}


Advanced Filtering

Get data for all of the Authorization Role Definitions that have assignable scopes:

GraphQL
|
query {
  queryazureAuthRoleDefinition(filter: { has: assignableScopes }) {
    id
    # Other fields and connections here...
  }
}

# Note that in addition to "assignableScopes" you can filter
# Using "has" based on any of the following attributes:

# name
# type
# region
# subscriptionId
# roleName
# description
# roleType
# permissions


Ordering

You can order the results you get back either asc or desc depending on your preference:

GraphQL
|
query {
  queryazureAuthRoleDefinition(order: { desc: roleName }) {
    id
    # Other fields and connections here...
  }
}

# Note that in addition to "roleName" you can filter
# Using "asc" or "desc" based on any of the following attributes:

# id
# name
# type
# region
# subscriptionId
# description
# roleType


Only select and return the first two Azure Authorization Role Definitions that are found:

GraphQL
|
query {
  queryazureAuthRoleDefinition(first: 2, order: { desc: name }) {
    id
    # Other fields and connections here...
  }
}


Only select and return the first two Authorization Role Definitions that are found, but offset by one so keys two & three are returned:

GraphQL
|
query {
  queryazureAuthRoleDefinition(first: 2, order: { desc: name }, offset: 1) {
    id
    # Other fields and connections here...
  }
}


Aggregation

Count the number of Authorization Role Definitions across all scanned Azure subscriptions:

GraphQL
|
query {
  aggregateazureAuthRoleDefinition {
    count
    # Other fields and connections here...
  }
}

# Note that in addition to "count" you can request the
# Following min and max values based on attributes of your Authorization Role Definition:

# idMin
# idMax
# nameMin
# nameMax
# typeMin
# typeMax
# regionMin
# regionMax
# subscriptionIdMin
# subscriptionIdMax
# roleNameMin
# roleNameMax
# descriptionMin
# descriptionMax
# roleTypeMin
# roleTypeMax


Count the number of Authorization Role Definitions in a single account. Note that you can apply all of the same filters that are listed above to aggregate queries:

GraphQL
|
query {
  aggregateazureAuthRoleDefinition(filter: { subscriptionId: { eq: "12345" } }) {
    count
    # Other fields and connections here...
  }
}


Examples

Find all of the Authorization Role Definitions that are in the eastus region across all your accounts:

GraphQL
|
query {
  queryazureAuthRoleDefinition(filter: { region: { eq: "eastus" } }) {
    id
    # Other fields and connections here...
  }
}


Kitchen Sink

Putting it all together; get all data for all Authorization Role Definitions across all regions for all scanned Azure subscriptions in a single query:

GraphQL
|
query {
  queryazureAuthRoleDefinition {
    id
    name
    type
    region
    subscriptionId
    roleName
    description
    roleType
    permissions{
      id
      actions
      notActions
      dataActions
      notDataActions
    }
    assignableScopes
  }
}


References

Dgraph documentation on querying

Azure RBAC Documentation

Updated 03 Mar 2023
Did this page help you?
Yes
No
PREVIOUS
AuthRoleAssignment
NEXT
Azure Cosmos DB
Docs powered by archbee 
TABLE OF CONTENTS
Overview
Filtering
Advanced Filtering
Ordering
Aggregation
Examples
Kitchen Sink
References