Skip to content

Microsoft Entra Permissions Management (CloudKnox) Executor

Category: Identity and Access Script: cloudknox.py Integration: REST API (Microsoft Graph, OAuth2) Faraday Plugin: Raw JSON Website: https://learn.microsoft.com/en-us/entra/permissions-management/

Description

Imports cloud authorization systems (AWS accounts, Azure subscriptions and GCP projects) and their permission risk findings from Microsoft Entra Permissions Management (formerly CloudKnox) into Faraday.

Prerequisites

  • A Microsoft Entra Permissions Management tenant
  • An Azure AD app registration (service principal) with the PermissionsManagement.Read.All application permission and admin consent
  • The tenant ID, client ID and client secret of that app registration
  • Python requests module available to the agent

Configuration

Environment Variables (Setup)

Variable Required Description
AZURE_TENANT_ID Yes Azure AD tenant (directory) ID
AZURE_CLIENT_ID Yes Application (client) ID of the app registration
AZURE_CLIENT_SECRET Yes Client secret of the app registration
CK_PAGES No Maximum number of pages to read from each list (default: 5, maximum: 50)

These variables are also accepted as execution arguments, so a single run can override them.

Execution Arguments

Parameter Type Mandatory Description
CK_AUTHSYSTEM_ID string No ID of a single authorization system (AWS account, Azure subscription or GCP project) to import. Leave blank to import all of them.
CK_RISK_LEVEL string No Only import findings with exactly this risk level: low, medium, high or critical. Leave blank for all levels. Unrecognized values are ignored.

YAML Configuration Example

executors:
  cloudknox:
    repo_executor: cloudknox.py
    max_size: 65536
    varenvs:
      AZURE_TENANT_ID: "<tenant_id>"
      AZURE_CLIENT_ID: "<client_id>"
      AZURE_CLIENT_SECRET: "<client_secret>"
    params:
      CK_AUTHSYSTEM_ID:
        mandatory: false
        type: string
        base: string
      CK_RISK_LEVEL:
        mandatory: false
        type: string
        base: string

How It Works

  1. Requests a token from https://login.microsoftonline.com/{AZURE_TENANT_ID}/oauth2/v2.0/token using the client credentials flow with the Microsoft Graph scope
  2. Reads authorization systems from GET https://graph.microsoft.com/beta/permissionManagement/authorizationSystems, following @odata.nextLink
  3. Reads findings from .../permissionManagement/findings (or from .../authorizationSystems/{id}/findings when CK_AUTHSYSTEM_ID is set), filtered by CK_RISK_LEVEL
  4. Creates a host and an [IDENTITY] inventory vulnerability (severity info) for each authorization system
  5. Creates a host and a vulnerability for each finding, with severity taken from its riskLevel (low, medium, high, critical)

Notes

  • Authorization systems and findings are not tied to IP addresses, so every host uses IP 0.0.0.0.
  • The run stops if the credentials are missing or the token request fails.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor.