msticpy.auth.cloud_mappings module

Azure Cloud Mappings.

class msticpy.auth.cloud_mappings.AzureCloudConfig(cloud: Optional[str] = None, tenant_id: Optional[str] = None)

Bases: object

Azure Cloud configuration.

Initialize AzureCloudConfig from cloud or configuration.

Parameters
  • cloud (str, optional) – The cloud to retrieve configuration for. If not supplied, the cloud ID is read from configuration. If this is not available, it defaults to ‘global’.

  • tenant_id (str, optional) – The tenant to authenticate against. If not supplied, the tenant ID is read from configuration, or the default tenant for the identity.

property cloud_names: List[str]

Return a list of current cloud names.

property endpoint: Dict[str, str]

Get a dict of all the endpoints for an Azure cloud.

Returns

A dictionary of endpoints for the cloud.

Return type

dict

Raises

MsticpyAzureConfigError – If the cloud name is not valid.

property endpoints: msrestazure.azure_cloud.CloudEndpoints

Get the CloudEndpoints class for an Azure cloud.

Returns

A CloudEndpoints class for the cloud.

Return type

azure_cloud.CloudEndpoints

Raises

MsticpyAzureConfigError – If the cloud name is not valid.

static resolve_cloud_alias(alias) Optional[str]

Return match of cloud alias or name.

property suffix: msrestazure.azure_cloud.CloudSuffixes

Get a dict of all the suffixes for an Azure cloud.

Returns

A dictionary of suffixes for the cloud.

Return type

dict

Raises

MsticpyAzureConfigError – If the cloud name is not valid.

property suffixes: msrestazure.azure_cloud.CloudSuffixes

Get CloudSuffixes class an Azure cloud.

Returns

A CloudSuffixes class for the cloud.

Return type

azure_cloud.CloudSuffixes

Raises

MsticpyAzureConfigError – If the cloud name is not valid.

property token_uri: str

Return the resource manager token URI.

msticpy.auth.cloud_mappings.create_cloud_ep_dict(endpoint: str) dict

Return lookup dict for cloud endpoints.

Parameters

endpoint (str) – The name of the endpoint to retrieve for each cloud.

Returns

A dictionary of cloud names and endpoints.

Return type

dict

msticpy.auth.cloud_mappings.create_cloud_suf_dict(suffix: str) dict

Get all the suffixes for a specific service in a cloud.

Parameters

suffix (str) – The name of the suffix to get details for.

Returns

A dictionary of cloud names and suffixes.

Return type

dict

msticpy.auth.cloud_mappings.default_auth_methods() List[str]

Get the default (all) authentication options.

msticpy.auth.cloud_mappings.get_all_endpoints(cloud: str) msrestazure.azure_cloud.CloudEndpoints

Get a list of all the endpoints for an Azure cloud.

Parameters

cloud (str) – The name of the Azure cloud to get endpoints for.

Returns

A dictionary of endpoints for the cloud.

Return type

dict

Raises

MsticpyAzureConfigError – If the cloud name is not valid.

msticpy.auth.cloud_mappings.get_all_suffixes(cloud: str) msrestazure.azure_cloud.CloudSuffixes

Get a list of all the suffixes for an Azure cloud.

Parameters

cloud (str) – The name of the Azure cloud to get suffixes for.

Returns

A dictionary of suffixes for the cloud.

Return type

dict

Raises

MsticpyAzureConfigError – If the cloud name is not valid.

msticpy.auth.cloud_mappings.get_azure_config_value(key, default)

Get a config value from Azure section.

msticpy.auth.cloud_mappings.get_defender_endpoint(cloud: str) str

Get the URI of the applicable Defender for Endpoint API.

msticpy.auth.cloud_mappings.get_m365d_endpoint(cloud: str) str

Get the URI of the applicable Defender for Endpoint API.