Skip to main content

api_collections

Creates, updates, deletes, gets or lists an api_collections resource.

Overview

Nameapi_collections
TypeResource
Idazure.security.api_collections

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
baseUrlstringThe base URI for this API collection. All endpoints of this API collection extend this base URI.
discoveredViastringThe resource Id of the resource from where this API collection was discovered.
displayNamestringThe display name of the API collection.
numberOfApiEndpointsintegerThe number of API endpoints discovered in this API collection.
numberOfApiEndpointsWithSensitiveDataExposedintegerThe number of API endpoints in this API collection which are exposing sensitive data in their requests and/or responses.
numberOfExternalApiEndpointsintegerThe number of API endpoints in this API collection for which API traffic from the internet was observed.
numberOfInactiveApiEndpointsintegerThe number of API endpoints in this API collection that have not received any API traffic in the last 30 days.
numberOfUnauthenticatedApiEndpointsintegerThe number of API endpoints in this API collection that are unauthenticated.
provisioningStatestringGets the provisioning state of the API collection. Known values are: "Succeeded", "Creating", "Updating", "Deleting", "Failed", "Canceled", and "InProgress". (Succeeded, Creating, Updating, Deleting, Failed, Canceled, InProgress)
sensitivityLabelstringThe highest priority sensitivity label from Microsoft Purview in this API collection.
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_by_azure_api_management_serviceselectresource_group_name, service_name, api_id, subscription_idGets an onboarded Azure API Management API. Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected.
list_by_azure_api_management_serviceselectresource_group_name, service_name, subscription_idGets a list of onboarded Azure API Management APIs. Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs. If an Azure API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected.
list_by_resource_groupselectresource_group_name, subscription_idGets a list of API collections within a resource group. Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs.
list_by_subscriptionselectsubscription_idGets a list of API collections within a subscription. Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs.
offboard_azure_api_management_apideleteresource_group_name, service_name, api_id, subscription_idOffboard an Azure API Management API from Microsoft Defender for APIs. Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the operations within the Azure API Management API for intrusive behaviors.
onboard_azure_api_management_apiexecresource_group_name, service_name, api_id, subscription_idOnboard an Azure API Management API to Microsoft Defender for APIs. Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_idstringAPI revision identifier. Must be unique in the API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. Required.
resource_group_namestringThe name of the resource group. The name is case insensitive. Required.
service_namestringThe name of the API Management service. Required.
subscription_idstring

SELECT examples

Gets an onboarded Azure API Management API. Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. If an Azure API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the operations within the Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected.

SELECT
id,
name,
baseUrl,
discoveredVia,
displayName,
numberOfApiEndpoints,
numberOfApiEndpointsWithSensitiveDataExposed,
numberOfExternalApiEndpoints,
numberOfInactiveApiEndpoints,
numberOfUnauthenticatedApiEndpoints,
provisioningState,
sensitivityLabel,
systemData,
type
FROM azure.security.api_collections
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND service_name = '{{ service_name }}' -- required
AND api_id = '{{ api_id }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

DELETE examples

Offboard an Azure API Management API from Microsoft Defender for APIs. Offboard an Azure API Management API from Microsoft Defender for APIs. The system will stop monitoring the operations within the Azure API Management API for intrusive behaviors.

DELETE FROM azure.security.api_collections
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND service_name = '{{ service_name }}' --required
AND api_id = '{{ api_id }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Onboard an Azure API Management API to Microsoft Defender for APIs. Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start monitoring the operations within the Azure Management API for intrusive behaviors and provide alerts for attacks that have been detected.

EXEC azure.security.api_collections.onboard_azure_api_management_api 
@resource_group_name='{{ resource_group_name }}' --required,
@service_name='{{ service_name }}' --required,
@api_id='{{ api_id }}' --required,
@subscription_id='{{ subscription_id }}' --required
;