Permissions

Query permissions across all identities

Programmatically perform flexible and granular queries across all cloud identities to quickly surface problems of interest related to granted permissions.

📘

Note

This query parallels the Permissions Query feature available in the Tenable One Cloud Exposure Console. See Query Permissions in the Tenable Cloud Exposure User Guide to learn more about the feature, including sample use cases and more information about available filters.

Sample Query

The following sample query searches for all identities:

  • with either the 3rd party or Inactive labels applied to them in Tenable.
  • with accessible resources that have the Public label applied to them in Tenable.
  • where the scope of the resource that the identity has access to is All resources (ANY), meaning that a wildcard (*) is used to cover all resources for the specific service.

For each of these identities, the sample query asks to return information about:

  • the cloud provider
  • any labels applied to the identity in Tenable
  • the name of the identity
  • the account that the identity belongs to
query {
  PermissionIdentities(
    filter: {
      IdentityLabels: ["No MFA", "Inactive"],
      ResourceLabels: "Public",
      ActionScopes: ANY
    }) {
    nodes {
      Identity {
        Provider
        Labels
        Name
        AccountId
      }
    }
  }
}

Sample Response

{
  "data": {
    "PermissionIdentities": {
      "nodes": [
        {
          "Identity": {
            "CloudProvider": "AWS",
            "Labels": [
              "Admin",
              "Inactive"
            ],
            "Name": "b365fa64-9de5-4a00-88b6-b1ebbd760f79",
            "AccountId": "123456789012"
          }
        },
        {
          "Identity": {
            "CloudProvider": "AWS",
            "Labels": [
              "Inactive",
              "Trusted Service"
            ],
            "Name": "36cccdd4-8192-4dee-8465-fb6e3f4330d1",
            "AccountId": "123456789012"
          }
        }
      ]
    }
  }
}

Query AWS Federated Permissions

Programmatically perform granular queries to see users federated from other IdPs and granted IAM roles to access AWS services. This can help you better understand your overall, cross-cloud security posture, and remove unneeded roles or role assignments.

📘

Note

This feature parallels the AWS Federated Permissionss feature available in the Cloud Exposure Console.

Sample Query

The following sample query searches for unused identities, meaning those identities which were either never assumed, or not seen during the analysis period. For each of these identities, the sample query asks to return information about, for example:

  • How the user is federated into AWS.
  • Whether the role was assigned directly to the user, or via a group.
  • When the role was last assumed by the user.
  • The name of the federated user, the name of the assigned AWS IAM role, and the name of the group/s that grants the role to the user.
query{
  AwsFederationPermissions(filter:{Unused:true}){
    nodes {
            Id
			FederationType
			DirectAssignment
			AssumeTime
            Unused
        User{,Id,Name,CloudProvider,CustomFields,Labels,SyncTime,Tags{Key,Value},AccountId}
        Role{,Id,Name,CloudProvider,CustomFields,Labels,SyncTime,Tags{Key,Value},AccountId,Arn,CreationTime,CreatorIdentity{Id,Name},CreatorOriginator{Id,Name},Region,Stack{Name},Policies{Name},LastActivityTime,AccessLevel,PolicyDocument}
        Groups{Id,Name,CloudProvider,CustomFields,Labels,SyncTime,Tags{Key,Value},AccountId}
    }
  }
}

Sample Response

{
  "data": {
    "AwsFederationPermissions": {
      "nodes": [
        {
          "Id": "3af490ba09-fe80ac5b-c36c-4778-a39e-226a4b3d31d3/AROALBCG7DB3APU4CMW3O",
          "FederationType": "AwsIdentityCenter",
          "DirectAssignment": true,
          "AssumeTime": "2025-07-05T00:00:00.000Z",
          "Unused": true,
          "User": {
            "Id": "3af490ba09-fe80ac5b-c36c-4778-a39e-226a4b3d31d3",
            "Name": "47fc5d3a-5b97-463d-83cb-dba7fa813b77",
            "CloudProvider": "AWS",
            "CustomFields": {
              "Environment": [
                "Org1Account1"
              ],
              "Owner": [
                "[email protected]"
              ]
            },
            "Labels": [],
            "SyncTime": "2026-06-06T06:07:42.479Z",
            "Tags": [],
            "AccountId": "444455556666"
          },
          "Role": {
            "Id": "AROALBCG7DB3APU4CMW3O",
            "Name": "AWSReservedSSO_SupportUser_251d6b57d9e6df29",
            "CloudProvider": "AWS",
            "CustomFields": {
              "Environment": [
                "Org1Account3"
              ],
              "Owner": [
                "[email protected]"
              ]
            },
            "Labels": [
              "PII",
              "Sensitive Data",
              "PCI"
            ],
            "SyncTime": "2026-06-06T06:21:55.234Z",
            "Tags": [],
            "AccountId": "444455556666",
            "Arn": "arn:aws:iam::444455556666:role/aws-reserved/sso.amazonaws.com/us-east-2/AWSReservedSSO_SupportUser_251d6b57d9e6df29",
            "CreationTime": "2025-06-08T08:41:41.000Z",
            "CreatorIdentity": null,
            "CreatorOriginator": null,
            "Region": null,
            "Stack": null,
            "Policies": [
              {
                "Name": "SupportUser"
              }
            ],
            "LastActivityTime": null,
            "AccessLevel": "Internal",
            "PolicyDocument": {
              "Version": "2012-10-17",
              "Statement": [
                {
                  "Effect": "Allow",
                  "Principal": {
                    "Federated": "arn:aws:iam::444455556666:saml-provider/AWSSSO_e532c446d178fb37_DO_NOT_DELETE"
                  },
                  "Action": [
                    "sts:AssumeRoleWithSAML",
                    "sts:TagSession"
                  ],
                  "Condition": {
                    "StringEquals": {
                      "SAML:aud": "https://signin.aws.amazon.com/saml"
                    }
                  }
                }
              ]
            }
          },
          "Groups": []
        }
      ]
    }
  }
}

List permission data for specific resources/identities

Programmatically extract permission data across multiple resources in Cloud Exposure. For a given query, the API returns the following information for each identity connected to the specified resource/s:

  • Action — The policy/role/permission used by the identity to perform specific activities.
  • Category — The activity category that reflects the behavior pattern of the action.
  • Excessive — Whether the permission is considered excessive by Tenable.

List permission data for AWS resources/identities

To identify relevant IdentityIds or ResourceIds to be used when querying permissions, first use the AwsResources query to fetch a list of identities or resources. The example below shows a query which fetches all AWS IAM roles according to a given ARN.

List AWS identities or resources

{
  AwsPermissions(
    filter: {
      AccessLevels:Internal
      ResourceIds:["68522"]
    })
  {
        nodes{
            Identity {
              Id,
              Name
            }
          AccessLevel
        }
    }
}

Sample response

{
  "data": {
    "AwsPermissions": {
      "nodes": [
        {
          "Identity": {
            "Id": "d119e74c-e552-4772-84e7-80d8f9805a64",
            "Name": "0bba49dd-850e-4881-89a3-163c6e3e3bd1"
          },
          "AccessLevel": "Internal"
                }
      ]
    }
  }
}

List permission data for specific AWS identities

Use the value/s of the "Id" field from the AwsResources query response to populate the IdentityIds field in the AwsPermissions query. The example below shows a query that lists all AWS S3 buckets that a specific IAM role has DeleteObject permissions on.

# TODO: Replace placeholder with the relevant IAM role ID/s.

query {
  AwsPermissions(
    filter: {
        IdentityIds: ["<IAM_ROLE_ID>"]
        ResourceTypes:[AwsS3Bucket]
        Actions: ["s3:DeleteObject"]
    })
  {
    nodes {
       Identity {
        Name
      }
      Permissions {
        Action
        Category
        Excessive
      }
      Resource {
        Name
        ... on AwsResource{
           Arn
        }
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Sample response

{
  "data": {
    "AwsPermissions": {
      "nodes": [
        {
          "Identity": {
            "Name": "111122223333"
          },
          "Permissions": [
            {
              "Action": "s3:DeleteObject",
              "Category": "InfrastructureModifications",
              "Excessive": true
            }
          ],
          "Resource": {
            "Name": "111122223333",
            "Arn": "arn:aws:s3:::68bd0ffb63"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": "MQ=="
      }
    }
  }
}

List permission data for specific AWS resources

Use the value/s of the "Id" field from the AwsResources query response to populate the ResourceIds field in the AwsPermissions query. The example below shows a query that lists all IAM Users that have Data Read permissions to the specified resource id.

# TODO: Replace placeholder with the relevant resource ID/s.

query {
  AwsPermissions(
    filter: {
        ResourceIds: ["<Resource ID>"]
        IdentityTypes:[AwsIamUser]
        ActionCategories:[DataRead]
    })
  {
    nodes {
       Identity {
        Name
      }
      Permissions {
        Action
        Category
        Excessive
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Sample response

{
  "data": {
    "AwsPermissions": {
      "nodes": [
        {
          "Identity": {
            "Name": "111122223333"
          },
          "Permissions": [
            {
              "Action": "s3:ListBucket",
              "Category": "DataAccess",
              "Excessive": true
            },
            {
              "Action": "s3:ListBucketVersions",
              "Category": "DataAccess",
              "Excessive": true
            },
            {
              "Action": "s3:GetObject",
              "Category": "DataAccess",
              "Excessive": true
            },
            {
              "Action": "s3:GetObjectVersion",
              "Category": "DataAccess",
              "Excessive": true
            }
          ]
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": "MQ=="
      }
    }
  }
}

List permission data for Azure resources/identities

To identify relevant IdentityIds or ResourceIds to be used when querying permissions, first use either the AzureAdEntities query or the AzureResources query to fetch a list of identities or resources, respectively.

List Azure identities

The example below shows a query which fetches all Azure Active Directory users using the AzureAdEntities query.

{
  AzurePermissions(
    filter: {
      AccessLevels:Internal
      ResourceIds: ["73901"]
    }, first: 5)
  {
        nodes{
            Identity {
              Id,
              Name
            }
          AccessLevel
        }
    }
}

Sample response

{
  "data": {
    "AzurePermissions": {
      "nodes": [
        {
          "Identity": {
            "Id": "994535a5-2294-4250-890c-e50b061aa182",
            "Name": "47fc5d3a-5b97-463d-83cb-dba7fa813b77"
          },
          "AccessLevel": "Internal"
         }
      ]
    }
  }
}

List Azure resources

The example below shows a query which fetches all Azure storage accounts, using the AzureResources query.

{
  AzureResources(filter: {Types: [AzureStorageStorageAccount]}) {
    nodes{
        Name,
        Id
    }
  }
}

Sample response

{
  "data": {
    "AzureResources": {
      "nodes": [
        {
          "Name": "123456789012",
          "Id": "b7cb1582-ed55-4d2a-83f8-2469d1e72ec2"
        }
      ]
    }
  }
}

List permission data for specific Azure identities

Use the value/s of the "Id" field from the AzureAdEntities query response to populate the IdentityIds field in the AzurePermissions query. The example below shows a query that lists all storage accounts that a specific identity can perform the delete action on.

query {
  AzurePermissions(
    filter: {
        IdentityIds: ["86822750595622575849"]
        ResourceTypes:[AzureStorageStorageAccount]
        Actions:["Microsoft.Storage/storageAccounts/blobServices/containers/blobs/delete"]
    })
  {
    nodes {
      Identity {
        Name
      }
      Permissions
      {
        Action
        Category
        Excessive
      }
      Resource {
        Name
        ... on AzureResource{
           Id
        }
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Sample response

{
  "data": {
    "AzurePermissions": {
      "nodes": [
        {
          "Identity": {
            "Name": "2f052d6e-37b0-4fb1-88e2-a165af1698d9"
          },
          "Permissions": [
            {
              "Action": "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/delete",
              "Category": "DataAccess",
              "Excessive": true
            }
          ],
          "Resource": {
            "Name": "2f052d6e-37b0-4fb1-88e2-a165af1698d9",
            "Id": "/subscriptions/71e1f3bd-a223-481c-b479-6559a0c9dd7a/resourceGroups/example-rg/providers/Microsoft.Storage/storageAccounts/examplestorage1"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": "Mzc="
      }
    }
  }
}

List permission data for specific Azure resources

Use the value/s of the "Id" field from the AzureResources query response to populate the ResourceIds field in the AzurePermissions query. The example below shows a query that lists all service principals with Data Read permissions to a specific resource.

query {
  AzurePermissions(
    filter: {
        ResourceIds: ["855869954202714543"]
        IdentityTypes: [AzureAdApplicationServicePrincipal]
        ActionCategories: [DataRead]
    })
  {
    nodes {
      Identity {
        Name
      }
      Permissions
      {
        Action
        Category
        Excessive
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}

Sample response

{
  "data": {
    "AzurePermissions": {
      "nodes": [
        {
          "Identity": {
            "Name": "example-group-1"
          },
          "Permissions": [
            {
              "Action": "Microsoft.Storage/storageAccounts/listkeys/action",
              "Category": "DataAccess",
              "Excessive": true
            }
          ]
        },
        {
          "Identity": {
            "Name": "example-group-2"
          },
          "Permissions": [
            {
              "Action": "Microsoft.Storage/storageAccounts/listkeys/action",
              "Category": "DataAccess",
              "Excessive": true
            }
          ]
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": "NQ=="
      }
    }
  }
}

List permission data for GCP resources/identities

To identify relevant IdentityIds or ResourceIds to be used when querying permissions, first use either the GoogleWorkspaceEntities or GcpResources query, to fetch a list of identities or resources, respectively.

List GCP Workspace users

The example below shows a query which fetches all Google Workspace users, using the GoogleWorkspaceEntities query.

{
  GcpPermissions(
    filter: {
      AccessLevels:Internal
      ResourceIds:["96203"]
    }, first: 5)
  {
        nodes{
            Identity {
              Id,
              Name
            }
          AccessLevel
        }
    }
}

Sample response

{
  "data": {
    "GcpPermissions": {
      "nodes": [
        {
          "Identity": {
            "Id": "d119e74c-e552-4772-84e7-80d8f9805a64",
            "Name": "93e28c1b-a7f3-442f-859a-189e71732c05"
          },
          "AccessLevel": "Internal"
        }
      ]
    }
  }
}

List GCP resources

The example below shows a query which fetches all GCP compute disks, using the GcpResources query.

{
  GcpResources(filter: {Types: [GcpComputeDisk]}) {
    nodes{
      Name,
      Id
    }
  }
}

Sample response

{
  "data": {
    "GcpResources": {
      "nodes": [
        {
          "Name": "123456789012",
          "Id": "b7cb1582-ed55-4d2a-83f8-2469d1e72ec2"
        }
      ]
    }
  }
}

List permission data for specific GCP identities

Use the value/s of the "Id" field from the GoogleWorkspaceEntities query response to populate the IdentityIds field in the GcpPermissions query. The example below shows a query that lists all compute disks that a specific identity can perform the delete action on.

query {
  GcpPermissions(
    filter: {
      IdentityIds: ["User/14322fcaca"]
      ResourceTypes: [GcpComputeDisk]
      Actions: ["compute.disks.delete"]
    })
  {
    nodes {
      Identity{
        Name
        Id
      }
      Permissions{
        Action
        Category
        Excessive
      }
      Resource{
        Name
        Id
      }
    }
  }
}

Sample response

{
  "data": {
    "GcpPermissions": {
      "nodes": [
        {
          "Identity": {
            "Name": "0bba49dd-850e-4881-89a3-163c6e3e3bd1",
            "Id": "c1fcda79-b856-4113-88d0-7c11051e50e2"
          },
          "Permissions": [
            {
              "Action": "compute.disks.delete",
              "Category": "InfrastructureModifications",
              "Excessive": true
            }
          ],
          "Resource": {
            "Name": "a6e118da-6476-47e6-8878-d006557dbded",
            "Id": "//compute.googleapis.com/projects/example/zones/us-central1-a/disks/gke-example"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": "Mzc="
      }
    }
  }
}

List permission data for specific GCP resources

Use the value/s of the "Id" field from the GcpResources query response to populate the ResourceIds field in the GcpPermissions query. The example below shows a query that lists all Google Workspace users with Data Read permissions to a specific resource.

query {
  GcpPermissions(
    filter: {
      ResourceIds: ["/92792572ad"]
      IdentityTypes: [GoogleWorkspaceUser]
      ActionCategories: [DataRead]
    })
  {
    nodes {
      Identity{
        Name
        Id
      }
      Permissions{
        Action
        Category
        Excessive
      }
      Resource{
        Name
        Id
      }
    }
  }
}

Sample response

{
  "data": {
    "GcpPermissions": {
      "nodes": [
        {
          "Identity": {
            "Name": "example test",
            "Id": "b6b5939f-9481-4a53-8acb-4d57360c7a15"
          },
          "Permissions": [
            {
              "Action": "storage.buckets.setIamPolicy",
              "Category": "PermissionManagement",
              "Excessive": true
            },
            {
              "Action": "storage.objects.setIamPolicy",
              "Category": "PermissionManagement",
              "Excessive": true
            }
          ],
          "Resource": {
            "Name": "4296e04f-7d56-4d19-811e-160c1469cf7d",
            "Id": "//storage.googleapis.com/example"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": false,
        "endCursor": "NQ=="
      }
    }
  }
}

Did this page help you?