-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[Hub Generated] Review request for Microsoft.Security to add version preview/2023-05-01-preview #24090
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
Closed
talco773
wants to merge
34
commits into
main
from
talco773-security-Microsoft.Security-2023-05-01-preview
Closed
[Hub Generated] Review request for Microsoft.Security to add version preview/2023-05-01-preview #24090
Changes from all 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 0e96c13
Updates readme
talco773 5735af2
Updates API version in new specs and examples
talco773 f9b990e
alligned to new design
6edd6a7
added custom recommendations examples
c3f60cf
added security assignments exemples
f5d01f9
update readme
143c2ac
fixed names
971d5ce
fixed names
832d615
small fixes
ab352db
small fixes
050c34e
small fixes
6275e49
fixed readme
0a3d067
avocado fixes
efee89c
spell check fixes
91f0328
ModelValidation fixes
50ddb9e
validation fixes
c7f5d62
addressed comments
4366e51
resolved conflicts
b6a1384
update examples
40dae32
update examples
ede6cab
update examples
6979305
prettier
c89cc00
remove parent scope
97afdaa
changed to v2 clouderror
b2e3b8f
changed to v2 clouderror
c302103
fix parameters order
c0239ba
fixed conflicts
a60d9e7
fix delete
cbc3456
fixed parameters versions
dd3fdee
fixed parameters versions
3a7de2d
update standard type
65369ca
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
0d6fa56
change back default tag
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
380 changes: 380 additions & 0 deletions
380
.../resource-manager/Microsoft.Security/preview/2023-05-01-preview/customRecommedations.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,380 @@ | ||
{ | ||
"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": { | ||
talco773 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"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-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/Scope" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"schema": { | ||
"$ref": "#/definitions/CustomRecommendationsList" | ||
} | ||
}, | ||
"default": { | ||
"description": "Error response describing why the operation failed", | ||
"schema": { | ||
"$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" | ||
} | ||
} | ||
}, | ||
"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-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" | ||
}, | ||
{ | ||
"$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-types/resource-management/v5/types.json#/definitions/ErrorResponse" | ||
} | ||
} | ||
} | ||
}, | ||
"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-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" | ||
}, | ||
{ | ||
"$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-types/resource-management/v5/types.json#/definitions/ErrorResponse" | ||
} | ||
} | ||
} | ||
}, | ||
"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-types/resource-management/v5/types.json#/parameters/ApiVersionParameter" | ||
}, | ||
{ | ||
"$ref": "#/parameters/Scope" | ||
}, | ||
{ | ||
"$ref": "#/parameters/customRecommendationName" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
ms-zhenhua marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"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-types/resource-management/v5/types.json#/definitions/ErrorResponse" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"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" | ||
talco773 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
] | ||
}, | ||
"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": { | ||
talco773 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"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" | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...w/examples/CustomRecommendations/DeleteByManagementGroupCustomRecommendation_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,11 @@ | ||
{ | ||
"parameters": { | ||
"api-version": "2023-05-01-preview", | ||
"scope": "providers/Microsoft.Management/managementGroups/contoso", | ||
"customRecommendationName": "ad9a8e26-29d9-4829-bb30-e597a58cdbb8" | ||
}, | ||
"responses": { | ||
"200": {}, | ||
"204": {} | ||
} | ||
} |
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.
There was a problem hiding this comment.
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.