Skip to content
Closed
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
bcb35b5
Adds base for updating Microsoft.Security from version preview/2023-0…
talco773 May 7, 2023
0e96c13
Updates readme
talco773 May 7, 2023
5735af2
Updates API version in new specs and examples
talco773 May 7, 2023
f9b990e
alligned to new design
May 22, 2023
6edd6a7
added custom recommendations examples
May 22, 2023
c3f60cf
added security assignments exemples
May 22, 2023
f5d01f9
update readme
May 22, 2023
143c2ac
fixed names
May 22, 2023
971d5ce
fixed names
May 22, 2023
832d615
small fixes
May 22, 2023
ab352db
small fixes
May 22, 2023
050c34e
small fixes
May 22, 2023
6275e49
fixed readme
May 22, 2023
0a3d067
avocado fixes
May 22, 2023
efee89c
spell check fixes
May 22, 2023
91f0328
ModelValidation fixes
May 22, 2023
50ddb9e
validation fixes
May 22, 2023
c7f5d62
addressed comments
May 29, 2023
4366e51
resolved conflicts
May 29, 2023
b6a1384
update examples
May 29, 2023
40dae32
update examples
May 29, 2023
ede6cab
update examples
May 29, 2023
6979305
prettier
May 30, 2023
c89cc00
remove parent scope
May 31, 2023
97afdaa
changed to v2 clouderror
Jun 7, 2023
b2e3b8f
changed to v2 clouderror
Jun 7, 2023
c302103
fix parameters order
Jun 7, 2023
c0239ba
fixed conflicts
Jun 8, 2023
a60d9e7
fix delete
Jun 8, 2023
cbc3456
fixed parameters versions
Jun 8, 2023
dd3fdee
fixed parameters versions
Jun 8, 2023
3a7de2d
update standard type
Jun 8, 2023
65369ca
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
Jul 11, 2023
0d6fa56
change back default tag
Jul 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,384 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check, as your PR is labeled with "NewApiVersionRequired", which means that adding new API paths to an existing API Version are breaking changes.

Please add these changes to a new Preview API Version,or get a breaking changes approval from Azure Breaking Changes Reviewers [email protected] and ARM can review the changes afterwards. Once you have the approval, please remove the "ARMChangesRequested" label from the PR to make the PR visible to the ARM reviewers.

"swagger": "2.0",
"info": {
"title": "Microsoft Defender for Cloud",
"description": "API spec for Microsoft.Security (Microsoft Defender for Cloud) resource provider",
"version": "2023-05-01-preview"
},
"host": "management.azure.com",
"schemes": [
"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": {
"/{scope}/providers/Microsoft.Security/customRecommendations": {
"get": {
"x-ms-examples": {
"List custom recommendations by subscription scope": {
"$ref": "./examples/CustomRecommendations/ListBySubscriptionCustomRecommendations_example.json"
},
"List custom recommendations by security connector scope": {
"$ref": "./examples/CustomRecommendations/ListBySecurityConnectorCustomRecommendations_example.json"
},
"List custom recommendations by management group scope": {
"$ref": "./examples/CustomRecommendations/ListByManagementGroupCustomRecommendations_example.json"
}
},
"tags": [
"CustomRecommendations"
],
"description": "Get a list of all relevant custom recommendations over a scope",
"operationId": "CustomRecommendations_List",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
},
{
"$ref": "#/parameters/Scope"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/CustomRecommendationsList"
}
},
"default": {
"description": "Error response describing why the operation failed",
"schema": {
"$ref": "../../../common/v1/types.json#/definitions/CloudError"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}": {
"get": {
"x-ms-examples": {
"Get a custom recommendation over subscription scope": {
"$ref": "./examples/CustomRecommendations/GetBySubscriptionCustomRecommendation_example.json"
},
"Get a custom recommendation over security connector scope": {
"$ref": "./examples/CustomRecommendations/GetBySecurityConnectorCustomRecommendation_example.json"
},
"Get a custom recommendation over management group scope": {
"$ref": "./examples/CustomRecommendations/GetByManagementGroupCustomRecommendation_example.json"
}
},
"tags": [
"CustomRecommendations"
],
"description": "Get a specific custom recommendation for the requested scope by customRecommendationName",
"operationId": "CustomRecommendations_Get",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
},
{
"$ref": "#/parameters/Scope"
},
{
"$ref": "#/parameters/customRecommendationName"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/CustomRecommendation"
}
},
"default": {
"description": "Error response describing why the operation failed",
"schema": {
"$ref": "../../../common/v1/types.json#/definitions/CloudError"
}
}
}
},
"put": {
"x-ms-examples": {
"Create or update custom recommendation over subscription scope": {
"$ref": "./examples/CustomRecommendations/PutBySubscriptionCustomRecommendation_example.json"
},
"Create or update custom recommendation over security connector scope": {
"$ref": "./examples/CustomRecommendations/PutBySecurityConnectorCustomRecommendation_example.json"
},
"Create or update custom recommendation over management group scope": {
"$ref": "./examples/CustomRecommendations/PutByManagementGroupCustomRecommendation_example.json"
}
},
"tags": [
"CustomRecommendations"
],
"description": "Creates or updates a custom recommendation over a given scope",
"operationId": "CustomRecommendations_CreateOrUpdate",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
},
{
"$ref": "#/parameters/Scope"
},
{
"$ref": "#/parameters/customRecommendationName"
},
{
"$ref": "#/parameters/customRecommendationBody"
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/CustomRecommendation"
}
},
"200": {
"description": "OK - Updated",
"schema": {
"$ref": "#/definitions/CustomRecommendation"
}
},
"default": {
"description": "Error response describing why the operation failed",
"schema": {
"$ref": "../../../common/v1/types.json#/definitions/CloudError"
}
}
}
},
"delete": {
"x-ms-examples": {
"Delete a custom recommendation over subscription scope": {
"$ref": "./examples/CustomRecommendations/DeleteBySubscriptionCustomRecommendation_example.json"
},
"Delete a custom recommendation over security connector scope": {
"$ref": "./examples/CustomRecommendations/DeleteBySecurityConnectorCustomRecommendation_example.json"
},
"Delete a custom recommendation over management group scope": {
"$ref": "./examples/CustomRecommendations/DeleteByManagementGroupCustomRecommendation_example.json"
}
},
"tags": [
"CustomRecommendations"
],
"description": "Delete a custom recommendation over a given scope",
"operationId": "CustomRecommendations_Delete",
"parameters": [
{
"$ref": "../../../common/v1/types.json#/parameters/ApiVersion"
},
{
"$ref": "#/parameters/Scope"
},
{
"$ref": "#/parameters/customRecommendationName"
}
],
"responses": {
"200": {
"description": "OK - custom recommendation was deleted"
},
"204": {
"description": "No Content - custom recommendation does not exist"
},
"default": {
"description": "Error response that describes why the operation failed.",
"schema": {
"$ref": "../../../common/v1/types.json#/definitions/CloudError"
}
}
},
"x-ms-long-running-operation": true,
"x-ms-long-running-operation-options": {
"final-state-via": "location"
}
}
}
},
"definitions": {
"CustomRecommendationsList": {
"type": "object",
"description": "A list of Custom Recommendations",
"properties": {
"value": {
"description": "Collection of Custom Recommendations",
"readOnly": true,
"type": "array",
"items": {
"$ref": "#/definitions/CustomRecommendation"
}
},
"nextLink": {
"description": "The link used to get the next page of operations.",
"type": "string"
}
}
},
"CustomRecommendation": {
"type": "object",
"description": "Custom Recommendation",
"properties": {
"properties": {
"x-ms-client-flatten": true,
"description": "describes Custom Recommendation properties.",
"$ref": "#/definitions/CustomRecommendationProperties"
}
},
"allOf": [
{
"$ref": "../../../common/v1/types.json#/definitions/Resource"
}
]
},
"CustomRecommendationProperties": {
"type": "object",
"description": "describes the Custom Recommendation properties",
"properties": {
"query": {
"description": "KQL query representing the Recommendation results required.",
"type": "string"
},
"cloudProviders": {
"description": "List of all standard supported clouds.",
"type": "array",
"items": {
"$ref": "#/definitions/RecommendationSupportedCloud"
}
},
"severity": {
"description": "The severity to relate to the assessments generated by this Recommendation.",
"type": "string",
"enum": [
"High",
"Medium",
"Low"
],
"x-ms-enum": {
"name": "severityEnum",
"modelAsString": true
},
"x-ms-client-default": "Low"
},
"displayName": {
"description": "The display name of the assessments generated by this Recommendation.",
"type": "string"
},
"description": {
"description": "The description to relate to the assessments generated by this Recommendation.",
"type": "string"
},
"remediationDescription": {
"description": "The remediation description to relate to the assessments generated by this Recommendation.",
"type": "string"
},
"assessmentKey": {
"description": "The assessment metadata key used when an assessment is generated for this Recommendation.",
"type": "string",
"readOnly": true
},
"metadata": {
"$ref": "#/definitions/CustomRecommendationMetaData"
}
}
},
"CustomRecommendationMetaData": {
"type": "object",
"description": "The recommendation metadata",
"properties": {
"createdBy": {
"description": "recommendation Created by object id (GUID)",
"type": "string",
"readOnly": true
},
"createdOn": {
"description": "recommendation creation date",
"type": "string",
"format": "date-time",
"readOnly": true
},
"lastUpdatedBy": {
"description": "recommendation last updated by object id (GUID)",
"type": "string",
"readOnly": true
},
"lastUpdatedOn": {
"description": "recommendation last update date",
"type": "string",
"format": "date-time",
"readOnly": true
}
}
},
"RecommendationSupportedCloud": {
"type": "string",
"description": "The cloud that the recommendation is supported on.",
"enum": [
"Azure",
"AWS",
"GCP"
],
"x-ms-enum": {
"name": "RecommendationSupportedClouds",
"modelAsString": true
}
}
},
"parameters": {
"customRecommendationName": {
"name": "customRecommendationName",
"in": "path",
"required": true,
"type": "string",
"pattern": "[{]?[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[}]?$",
"description": "Name of the Custom Recommendation.",
"x-ms-parameter-location": "method"
},
"customRecommendationBody": {
"name": "customRecommendationBody",
"in": "body",
"description": "Custom Recommendation body",
"required": true,
"schema": {
"$ref": "#/definitions/CustomRecommendation"
},
"x-ms-parameter-location": "method"
},
"Scope": {
"name": "scope",
"in": "path",
"required": true,
"type": "string",
"description": "The scope of the custom recommendation. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: 'subscriptions/{subscriptionId}'), or security connector (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'",
"x-ms-parameter-location": "method"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"parameters": {
"api-version": "2023-05-01-preview",
"scope": "providers/Microsoft.Management/managementGroups/contoso",
"customRecommendationName": "ad9a8e26-29d9-4829-bb30-e597a58cdbb8"
},
"responses": {
"200": {},
"204": {}
}
}
Loading