{ "swagger": "2.0", "info": { "title": "Microsoft Defender for Cloud", "version": "2023-11-15", "description": "API spec for Microsoft.Security (Microsoft Defender for Cloud) resource provider", "x-typespec-generated": [ { "emitter": "@azure-tools/typespec-autorest" } ] }, "schemes": [ "https" ], "host": "management.azure.com", "produces": [ "application/json" ], "consumes": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "description": "Azure Active Directory OAuth2 Flow.", "flow": "implicit", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "scopes": { "user_impersonation": "impersonate your user account" } } }, "tags": [ { "name": "D4APICollection" }, { "name": "APIMConfig" }, { "name": "OnboardToD4API" }, { "name": "OffboardFromD4API" }, { "name": "D4APICollectionList" } ], "paths": { "/subscriptions/{subscriptionId}/providers/Microsoft.Security/apiCollections": { "get": { "operationId": "APICollections_ListBySubscription", "tags": [ "D4APICollectionList" ], "summary": "Gets a list of API collections within a subscription", "description": "Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/ApiCollectionList" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Gets a list of API collections within a subscription that have been onboarded to Microsoft Defender for APIs": { "$ref": "./examples/ApiCollections/APICollections_ListBySubscription_example.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections": { "get": { "operationId": "APICollections_ListByAzureApiManagementService", "tags": [ "D4APICollectionList", "APIMConfig" ], "summary": "Gets a list of onboarded Azure API Management APIs", "description": "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.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "serviceName", "in": "path", "description": "The name of the API Management service.", "required": true, "type": "string", "minLength": 1, "maxLength": 50, "pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$" } ], "responses": { "200": { "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/ApiCollectionList" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Gets a list of Azure API Management APIs that have been onboarded to Microsoft Defender for APIs": { "$ref": "./examples/ApiCollections/APICollections_ListByAzureApiManagementService_example.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiId}": { "get": { "operationId": "APICollections_GetByAzureApiManagementService", "tags": [ "D4APICollection", "APIMConfig" ], "summary": "Gets an onboarded Azure API Management API", "description": "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.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "serviceName", "in": "path", "description": "The name of the API Management service.", "required": true, "type": "string", "minLength": 1, "maxLength": 50, "pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$" }, { "name": "apiId", "in": "path", "description": "API 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": true, "type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[^*#&+:<>?]+$" } ], "responses": { "200": { "description": "Azure operation completed successfully.", "schema": { "$ref": "#/definitions/ApiCollection" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs": { "$ref": "./examples/ApiCollections/APICollections_GetByAzureApiManagementService_example.json" } } }, "put": { "operationId": "APICollections_OnboardAzureApiManagementApi", "tags": [ "OnboardToD4API", "APIMConfig" ], "summary": "Onboard an Azure API Management API to Microsoft Defender for APIs", "description": "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": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "serviceName", "in": "path", "description": "The name of the API Management service.", "required": true, "type": "string", "minLength": 1, "maxLength": 50, "pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$" }, { "name": "apiId", "in": "path", "description": "API 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": true, "type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[^*#&+:<>?]+$" } ], "responses": { "200": { "description": "Resource 'ApiCollection' update operation succeeded", "schema": { "$ref": "#/definitions/ApiCollection" } }, "201": { "description": "Resource 'ApiCollection' create operation succeeded", "schema": { "$ref": "#/definitions/ApiCollection" }, "headers": { "Location": { "type": "string", "description": "The Location header contains the URL where the status of the long running operation can be checked." }, "Retry-After": { "type": "integer", "format": "int32", "description": "The Retry-After header can indicate how long the client should wait before polling the operation status." } } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Onboard an Azure API Management API to Microsoft Defender for APIs": { "$ref": "./examples/ApiCollections/APICollections_OnboardAzureApiManagementApi_example.json" } }, "x-ms-long-running-operation-options": { "final-state-via": "location", "final-state-schema": "#/definitions/ApiCollection" }, "x-ms-long-running-operation": true }, "delete": { "operationId": "APICollections_OffboardAzureApiManagementApi", "tags": [ "OffboardFromD4API", "APIMConfig" ], "summary": "Offboard an Azure API Management API from Microsoft Defender for APIs", "description": "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.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" }, { "name": "serviceName", "in": "path", "description": "The name of the API Management service.", "required": true, "type": "string", "minLength": 1, "maxLength": 50, "pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$" }, { "name": "apiId", "in": "path", "description": "API 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": true, "type": "string", "minLength": 1, "maxLength": 256, "pattern": "^[^*#&+:<>?]+$" } ], "responses": { "200": { "description": "Resource deleted successfully." }, "204": { "description": "Resource does not exist." }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Offboard an Azure API Management API from Microsoft Defender for APIs": { "$ref": "./examples/ApiCollections/APICollections_OffboardAzureApiManagementApi_example.json" } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/apiCollections": { "get": { "operationId": "APICollections_ListByResourceGroup", "tags": [ "D4APICollectionList" ], "summary": "Gets a list of API collections within a resource group", "description": "Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/SubscriptionIdParameter" }, { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/parameters/ResourceGroupNameParameter" } ], "responses": { "200": { "description": "The request has succeeded.", "schema": { "$ref": "#/definitions/ApiCollectionList" } }, "default": { "description": "An unexpected error response.", "schema": { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, "x-ms-examples": { "Gets a list of API collections within a resource group that have been onboarded to Microsoft Defender for APIs": { "$ref": "./examples/ApiCollections/APICollections_ListByResourceGroup_example.json" } }, "x-ms-pageable": { "nextLinkName": "nextLink" } } } }, "definitions": { "ApiCollection": { "type": "object", "description": "An API collection as represented by Microsoft Defender for APIs.", "properties": { "properties": { "$ref": "#/definitions/ApiCollectionProperties", "description": "Describes the properties of an API collection.", "x-ms-client-flatten": true } }, "allOf": [ { "$ref": "../../../../../../common-types/resource-management/v5/types.json#/definitions/ProxyResource" } ] }, "ApiCollectionList": { "type": "object", "description": "Page of a list of API collections as represented by Microsoft Defender for APIs.", "properties": { "value": { "type": "array", "description": "API collections in this page.", "items": { "$ref": "#/definitions/ApiCollection" }, "readOnly": true }, "nextLink": { "type": "string", "description": "The URI to fetch the next page.", "readOnly": true } } }, "ApiCollectionProperties": { "type": "object", "description": "Describes the properties of an API collection.", "properties": { "provisioningState": { "$ref": "#/definitions/Common.ProvisioningState", "description": "Gets the provisioning state of the API collection.", "readOnly": true }, "displayName": { "type": "string", "description": "The display name of the API collection.", "readOnly": true }, "discoveredVia": { "type": "string", "format": "arm-id", "description": "The resource Id of the resource from where this API collection was discovered.", "readOnly": true, "x-ms-arm-id-details": { "allowedResources": [ { "type": "Microsoft.ApiManagement/service" } ] } }, "baseUrl": { "type": "string", "format": "uri", "description": "The base URI for this API collection. All endpoints of this API collection extend this base URI.", "readOnly": true }, "numberOfApiEndpoints": { "type": "integer", "format": "int64", "description": "The number of API endpoints discovered in this API collection.", "readOnly": true }, "numberOfInactiveApiEndpoints": { "type": "integer", "format": "int64", "description": "The number of API endpoints in this API collection that have not received any API traffic in the last 30 days.", "readOnly": true }, "numberOfUnauthenticatedApiEndpoints": { "type": "integer", "format": "int64", "description": "The number of API endpoints in this API collection that are unauthenticated.", "readOnly": true }, "numberOfExternalApiEndpoints": { "type": "integer", "format": "int64", "description": "The number of API endpoints in this API collection for which API traffic from the internet was observed.", "readOnly": true }, "numberOfApiEndpointsWithSensitiveDataExposed": { "type": "integer", "format": "int64", "description": "The number of API endpoints in this API collection which are exposing sensitive data in their requests and/or responses.", "readOnly": true }, "sensitivityLabel": { "type": "string", "description": "The highest priority sensitivity label from Microsoft Purview in this API collection.", "readOnly": true } } }, "Common.ProvisioningState": { "type": "string", "description": "The current provisioning state of the resource. Indicates the status of the last operation performed on the resource.", "enum": [ "Succeeded", "Creating", "Updating", "Deleting", "Failed", "Canceled", "InProgress" ], "x-ms-enum": { "name": "ProvisioningState", "modelAsString": true, "values": [ { "name": "Succeeded", "value": "Succeeded", "description": "The resource has been successfully provisioned and is ready for use." }, { "name": "Creating", "value": "Creating", "description": "The resource is being created. This is a transitional state." }, { "name": "Updating", "value": "Updating", "description": "The resource is being updated. This is a transitional state." }, { "name": "Deleting", "value": "Deleting", "description": "The resource is being deleted. This is a transitional state." }, { "name": "Failed", "value": "Failed", "description": "The last operation on the resource failed. Check the error details for more information." }, { "name": "Canceled", "value": "Canceled", "description": "The operation was canceled before completion." }, { "name": "InProgress", "value": "InProgress", "description": "InProgress" } ] } } }, "parameters": {} }