-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Microsoft.Security] Migrate APIs from Microsoft.ApiSecurity RP (currently in private preview) to Microsoft.Security RP #21519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
28eb703
Adds base for updating Microsoft.Security from version stable/2021-06…
aditdalvi b149044
Updates readme
aditdalvi 15a582a
Updates API version in new specs and examples
aditdalvi 044838b
Add apiCollections.json and relevant examples
aditdalvi df55852
Update readme.md
aditdalvi b098a0c
Fix validation errors
aditdalvi d00aa21
Fix validation errors
aditdalvi 8fafb5e
One more fix
aditdalvi a2e2bc9
Switch to full paths
aditdalvi fb1af7c
More validation fixes
aditdalvi be9b20b
Try and fix the SDK errors
aditdalvi 6cdb0f9
Fix avocado error
aditdalvi 2cad077
Remove operations.json from tag = package-preview-2022-11 based on PR…
aditdalvi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1484,6 +1484,7 @@ ODBC | |
oeverify | ||
offboard | ||
offboards | ||
offboarding | ||
officedocument | ||
OLTP | ||
OIDC | ||
|
298 changes: 298 additions & 0 deletions
298
...curity/resource-manager/Microsoft.Security/preview/2022-11-20-preview/apiCollections.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,298 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"title": "Microsoft Defender for Cloud", | ||
"description": "API spec for Microsoft.Security (Microsoft Defender for Cloud) resource provider", | ||
"version": "2022-11-20-preview" | ||
}, | ||
"host": "management.azure.com", | ||
"schemes": [ | ||
aditdalvi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"https" | ||
], | ||
"consumes": [ | ||
"application/json" | ||
], | ||
"produces": [ | ||
"application/json" | ||
], | ||
"security": [ | ||
{ | ||
"azure_auth": [ | ||
"user_impersonation" | ||
] | ||
} | ||
], | ||
"securityDefinitions": { | ||
"azure_auth": { | ||
"type": "oauth2", | ||
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", | ||
"flow": "implicit", | ||
"description": "Azure Active Directory OAuth2 Flow", | ||
"scopes": { | ||
"user_impersonation": "impersonate your user account" | ||
} | ||
} | ||
}, | ||
"paths": { | ||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections": { | ||
"get": { | ||
"x-ms-examples": { | ||
"Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs": { | ||
"$ref": "./examples/ApiCollections/APICollection_List_example.json" | ||
} | ||
}, | ||
"tags": [ | ||
"D4APICollectionList", | ||
"APIMConfig" | ||
], | ||
"description": "Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API Management API is onboarded to 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.", | ||
"summary": "Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs", | ||
"operationId": "APICollection_List", | ||
"parameters": [ | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" | ||
}, | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiManagementServiceNameParameter" | ||
}, | ||
{ | ||
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"$ref": "#/definitions/ApiCollectionResponseList" | ||
} | ||
}, | ||
"default": { | ||
"description": "Error response describing why the operation failed.", | ||
"schema": { | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" | ||
} | ||
} | ||
}, | ||
"x-ms-pageable": { | ||
"nextLinkName": "nextLink" | ||
} | ||
} | ||
}, | ||
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}": { | ||
"get": { | ||
"x-ms-examples": { | ||
"Gets an Azure API Management API if it has been onboarded to Defender for APIs": { | ||
"$ref": "./examples/ApiCollections/APICollection_Get_example.json" | ||
} | ||
}, | ||
"tags": [ | ||
"D4APICollection", | ||
"APIMConfig" | ||
], | ||
"description": "Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API is onboarded to 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.", | ||
"summary": "Gets an Azure API Management API if it has been onboarded to Defender for APIs", | ||
"operationId": "APICollection_Get", | ||
"parameters": [ | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" | ||
}, | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiManagementServiceNameParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiCollectionIdParameter" | ||
}, | ||
{ | ||
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"$ref": "#/definitions/ApiCollectionResponse" | ||
} | ||
}, | ||
"default": { | ||
"description": "Error response describing why the operation failed.", | ||
"schema": { | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" | ||
} | ||
} | ||
} | ||
}, | ||
"put": { | ||
"x-ms-examples": { | ||
"Onboard an Azure API Management API to Defender for APIs": { | ||
"$ref": "./examples/ApiCollections/APICollectionOnboarding_Create_example.json" | ||
} | ||
}, | ||
"tags": [ | ||
"OnboardToD4API", | ||
"APIMConfig" | ||
], | ||
"description": "Onboard an Azure API Management API to 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.", | ||
"summary": "Onboard an Azure API Management API to Defender for APIs", | ||
"operationId": "APICollectionOnboarding_Create", | ||
"parameters": [ | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" | ||
}, | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiManagementServiceNameParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiCollectionIdParameter" | ||
}, | ||
{ | ||
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"$ref": "#/definitions/ApiCollectionResponse" | ||
} | ||
}, | ||
"default": { | ||
"description": "Error response describing why the operation failed.", | ||
"schema": { | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" | ||
} | ||
} | ||
} | ||
}, | ||
"delete": { | ||
"x-ms-examples": { | ||
"Delete a security recommendation task on a resource": { | ||
"$ref": "./examples/ApiCollections/APICollectionOffboarding_Delete_example.json" | ||
} | ||
}, | ||
"tags": [ | ||
"OffboardFromD4API", | ||
"APIMConfig" | ||
], | ||
"description": "Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations within the Azure API Management API for intrusive behaviors.", | ||
"summary": "Offboard an Azure API Management API from Defender for APIs", | ||
"operationId": "APICollectionOffboarding_Delete", | ||
"parameters": [ | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" | ||
}, | ||
{ | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiManagementServiceNameParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/ApiCollectionIdParameter" | ||
}, | ||
{ | ||
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK" | ||
}, | ||
"204": { | ||
"description": "NoContent" | ||
}, | ||
"default": { | ||
"description": "Error response describing why the operation failed.", | ||
"schema": { | ||
"$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"ApiCollectionResponseList": { | ||
"type": "object", | ||
"description": "Page of a list of API collections as represented by Defender for APIs.", | ||
"properties": { | ||
"value": { | ||
"description": "API collections in this page.", | ||
"readOnly": true, | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/ApiCollectionResponse" | ||
} | ||
}, | ||
"nextLink": { | ||
"readOnly": true, | ||
"type": "string", | ||
"description": "The URI to fetch the next page." | ||
} | ||
} | ||
}, | ||
"ApiCollectionResponse": { | ||
"type": "object", | ||
"description": "An API collection as represented by Defender for APIs.", | ||
"properties": { | ||
"properties": { | ||
"x-ms-client-flatten": true, | ||
"$ref": "#/definitions/ApiCollectionProperties" | ||
} | ||
}, | ||
"allOf": [ | ||
{ | ||
"$ref": "../../../common/v1/types.json#/definitions/Resource" | ||
} | ||
] | ||
}, | ||
"ApiCollectionProperties": { | ||
"type": "object", | ||
"description": "Describes the properties of an API collection.", | ||
"properties": { | ||
"displayName": { | ||
"type": "string", | ||
"description": "The display name of the Azure API Management API." | ||
}, | ||
"additionalData": { | ||
"type": "object", | ||
"description": "Additional data regarding the API collection.", | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"parameters": { | ||
"ApiManagementServiceNameParameter": { | ||
"name": "serviceName", | ||
"in": "path", | ||
"required": true, | ||
"type": "string", | ||
"description": "The name of the API Management service.", | ||
"minLength": 1, | ||
"maxLength": 50, | ||
"pattern": "^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$", | ||
"x-ms-parameter-location": "method" | ||
}, | ||
"ApiCollectionIdParameter": { | ||
"name": "apiCollectionId", | ||
"in": "path", | ||
"required": true, | ||
"type": "string", | ||
"description": "A string representing the apiCollections resource within the Microsoft.Security provider namespace. This string matches the Azure API Management API name.", | ||
"minLength": 1, | ||
"maxLength": 256, | ||
"x-ms-parameter-location": "method" | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...w/2022-11-20-preview/examples/ApiCollections/APICollectionOffboarding_Delete_example.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"parameters": { | ||
"subscriptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", | ||
"resourceGroupName": "rg1", | ||
"serviceName": "apimService1", | ||
"apiCollectionId": "echo-api", | ||
"api-version": "2022-11-20-preview" | ||
}, | ||
"responses": { | ||
"200": {}, | ||
"204": {} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ew/2022-11-20-preview/examples/ApiCollections/APICollectionOnboarding_Create_example.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"parameters": { | ||
"subscriptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", | ||
"resourceGroupName": "rg1", | ||
"serviceName": "apimService1", | ||
"apiCollectionId": "echo-api", | ||
"api-version": "2022-11-20-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/providers/Microsoft.Security/apiCollections/echo-api", | ||
"name": "echo-api", | ||
"type": "Microsoft.Security/apiCollections", | ||
"properties": { | ||
"displayName": "echo-api", | ||
"additionalData": { | ||
"apiManagementApiId": "/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...ecurity/preview/2022-11-20-preview/examples/ApiCollections/APICollection_Get_example.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"parameters": { | ||
"subscriptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", | ||
"resourceGroupName": "rg1", | ||
"serviceName": "apimService1", | ||
"apiCollectionId": "echo-api", | ||
"api-version": "2022-11-20-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"id": "/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/providers/Microsoft.Security/apiCollections/echo-api", | ||
"name": "echo-api", | ||
"type": "Microsoft.Security/apiCollections", | ||
"properties": { | ||
"displayName": "echo-api", | ||
"additionalData": { | ||
"apiManagementApiId": "/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...curity/preview/2022-11-20-preview/examples/ApiCollections/APICollection_List_example.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"parameters": { | ||
"subscriptionId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", | ||
"resourceGroupName": "rg1", | ||
"serviceName": "apimService1", | ||
"api-version": "2022-11-20-preview" | ||
}, | ||
"responses": { | ||
"200": { | ||
"body": { | ||
"value": [ | ||
{ | ||
"id": "/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/providers/Microsoft.Security/apiCollections/echo-api", | ||
"name": "echo-api", | ||
"type": "Microsoft.Security/apiCollections", | ||
"properties": { | ||
"displayName": "echo-api", | ||
"additionalData": { | ||
"apiManagementApiId": "/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.