Skip to content

Commit 697d0fc

Browse files
authored
Add Swagger for Defender for Storage new on-demand malware scan API (Azure#30786)
* Copy files from preview/2022-12-01-preview Copied the files in a separate commit. This allows reviewers to easily diff subsequent changes against the previous spec. * Update version to preview/2024-10-01-preview Updated the API version from preview/2022-12-01-preview to preview/2024-10-01-preview. * Added tag for 2024-10-01-preview in readme file * Add Swagger for Defender for Storage new on-demand malware scan API * Update api-version in examples * Run prettier on swagger files * Fix defintions * Fix BlobsScanSummary definition * Remove scanRequestTime (will be removed from API) * Camel casing * Add get to malwareScanStatus operation name * Remove extra underscore from operation ids * Fix MalwareScanStatus top level properties * Fix examples to match properties * Extract MalwareScanStatusProperties * Remove resource reference * Remove scanId from Cancel and remove get from ScanStatus path * Change the API structure to include a collection of scans * Add 'malware' to cancel operation name * Copy operations API to new api version * Add opeations example * Limit example size * run prettier * Move example to correct folder * modify example * Add opeartions file to readme * Use common types for operation results
1 parent 1ceae65 commit 697d0fc

File tree

9 files changed

+780
-1
lines changed

9 files changed

+780
-1
lines changed

specification/security/resource-manager/Microsoft.Security/preview/2024-10-01-preview/defenderForStorageSettings.json

Lines changed: 476 additions & 0 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"parameters": {
3+
"api-version": "2024-10-01-preview",
4+
"resourceId": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount",
5+
"settingName": "current",
6+
"scanId": "latest"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"properties": {
12+
"scanId": "3fd3c1be-dbff-4d6e-985f-43f9ec1b1146",
13+
"scanStatus": "Canceling",
14+
"scanStatusMessage": "The scan request is being canceled upon user request"
15+
}
16+
}
17+
}
18+
}
19+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"parameters": {
3+
"api-version": "2024-10-01-preview",
4+
"resourceId": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount",
5+
"settingName": "current"
6+
},
7+
"responses": {
8+
"200": {
9+
"body": {
10+
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/defenderForStorageSettings/current",
11+
"name": "current",
12+
"type": "Microsoft.Security/defenderForStorageSettings",
13+
"properties": {
14+
"isEnabled": true,
15+
"malwareScanning": {
16+
"onUpload": {
17+
"isEnabled": true,
18+
"capGBPerMonth": -1
19+
},
20+
"scanResultsEventGridTopicResourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic"
21+
},
22+
"sensitiveDataDiscovery": {
23+
"isEnabled": false
24+
},
25+
"overrideSubscriptionLevelSettings": true
26+
}
27+
}
28+
}
29+
}
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"parameters": {
3+
"api-version": "2024-10-01-preview",
4+
"resourceId": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount",
5+
"settingName": "current",
6+
"scanId": "latest"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"properties": {
12+
"scanId": "0ce362c5-87a5-4030-ba6a-109566cd7b3d",
13+
"scanStatus": "Completed",
14+
"scanStartTime": "2024-09-12T12:20:14.6364816Z",
15+
"scanEndTime": "2024-09-12T12:21:17.5648386Z",
16+
"scanSummary": {
17+
"blobs": {
18+
"totalBlobsScanned": 40,
19+
"maliciousBlobsCount": 10,
20+
"skippedBlobsCount": 0,
21+
"scannedBlobsInGB": 0.019550956785678864
22+
},
23+
"estimatedScanCostUSD": 0.0029326435178518295
24+
}
25+
}
26+
}
27+
}
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
{
2+
"parameters": {
3+
"api-version": "2024-10-01-preview",
4+
"resourceId": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount",
5+
"settingName": "current",
6+
"defenderForStorageSetting": {
7+
"properties": {
8+
"isEnabled": true,
9+
"malwareScanning": {
10+
"onUpload": {
11+
"isEnabled": true,
12+
"capGBPerMonth": -1
13+
},
14+
"scanResultsEventGridTopicResourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic"
15+
},
16+
"sensitiveDataDiscovery": {
17+
"isEnabled": true
18+
},
19+
"overrideSubscriptionLevelSettings": true
20+
}
21+
}
22+
},
23+
"responses": {
24+
"200": {
25+
"body": {
26+
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/defenderForStorageSettings/current",
27+
"type": "Microsoft.Security/defenderForStorageSettings",
28+
"name": "current",
29+
"properties": {
30+
"isEnabled": true,
31+
"malwareScanning": {
32+
"onUpload": {
33+
"isEnabled": true,
34+
"capGBPerMonth": -1
35+
},
36+
"scanResultsEventGridTopicResourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic",
37+
"operationStatus": {
38+
"code": "Succeeded"
39+
}
40+
},
41+
"sensitiveDataDiscovery": {
42+
"isEnabled": true,
43+
"operationStatus": {
44+
"code": "Succeeded"
45+
}
46+
},
47+
"overrideSubscriptionLevelSettings": true
48+
}
49+
}
50+
},
51+
"201": {
52+
"body": {
53+
"id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/defenderForStorageSettings/current",
54+
"type": "Microsoft.Security/defenderForStorageSettings",
55+
"name": "current",
56+
"properties": {
57+
"isEnabled": true,
58+
"malwareScanning": {
59+
"onUpload": {
60+
"isEnabled": false,
61+
"capGBPerMonth": -1
62+
},
63+
"operationStatus": {
64+
"code": "UnknownError",
65+
"message": "Failed to setup data scanner."
66+
}
67+
},
68+
"sensitiveDataDiscovery": {
69+
"isEnabled": false,
70+
"operationStatus": {
71+
"code": "UnknownError",
72+
"message": "Failed to setup data scanner."
73+
}
74+
},
75+
"overrideSubscriptionLevelSettings": true
76+
}
77+
}
78+
}
79+
}
80+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"parameters": {
3+
"api-version": "2024-10-01-preview",
4+
"resourceId": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount",
5+
"settingName": "current"
6+
},
7+
"responses": {
8+
"200": {
9+
"body": {
10+
"properties": {
11+
"scanId": "fc831479-412f-4bc2-8333-a8edda751a80",
12+
"scanStatus": "Queued",
13+
"scanStatusMessage": "The scan request has been queued for scanning"
14+
}
15+
}
16+
}
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"parameters": {
3+
"api-version": "2024-10-01-preview"
4+
},
5+
"responses": {
6+
"200": {
7+
"body": {
8+
"value": [
9+
{
10+
"name": "Microsoft.Security/defenderforstoragesettings/read",
11+
"display": {
12+
"provider": "Microsoft Security",
13+
"resource": "DefenderForStorageSettings",
14+
"operation": "Get defenderForStorageSettings",
15+
"description": "Gets the defenderforstoragesettings for the scope"
16+
},
17+
"origin": "user"
18+
},
19+
{
20+
"name": "Microsoft.Security/defenderforstoragesettings/write",
21+
"display": {
22+
"provider": "Microsoft Security",
23+
"resource": "DefenderForStorageSettings",
24+
"operation": "Update defenderForStorageSettings",
25+
"description": "Creates or updates the defenderforstoragesettings for the scope"
26+
},
27+
"origin": "user"
28+
},
29+
{
30+
"name": "Microsoft.Security/defenderforstoragesettings/delete",
31+
"display": {
32+
"provider": "Microsoft Security",
33+
"resource": "DefenderForStorageSettings",
34+
"operation": "Delete defenderForStorageSettings",
35+
"description": "Deletes the defenderforstoragesettings for the scope"
36+
},
37+
"origin": "user"
38+
}
39+
]
40+
}
41+
}
42+
}
43+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "Microsoft Defender for Cloud",
5+
"description": "API spec for Microsoft.Security (Microsoft Defender for Cloud) resource provider",
6+
"version": "2024-10-01-preview"
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"consumes": [
13+
"application/json"
14+
],
15+
"produces": [
16+
"application/json"
17+
],
18+
"security": [
19+
{
20+
"azure_auth": [
21+
"user_impersonation"
22+
]
23+
}
24+
],
25+
"securityDefinitions": {
26+
"azure_auth": {
27+
"type": "oauth2",
28+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
29+
"flow": "implicit",
30+
"description": "Azure Active Directory OAuth2 Flow",
31+
"scopes": {
32+
"user_impersonation": "impersonate your user account"
33+
}
34+
}
35+
},
36+
"paths": {
37+
"/providers/Microsoft.Security/operations": {
38+
"get": {
39+
"x-ms-examples": {
40+
"List the operations for the Microsoft.Security (Microsoft Defender for Cloud) resource provider": {
41+
"$ref": "./examples/Operations/ListOperations_example.json"
42+
}
43+
},
44+
"tags": [
45+
"Operations"
46+
],
47+
"description": "Exposes all available operations for discovery purposes.",
48+
"operationId": "Operations_List",
49+
"parameters": [
50+
{
51+
"$ref": "../../../../../common-types/resource-management/v6/types.json#/parameters/ApiVersionParameter"
52+
}
53+
],
54+
"responses": {
55+
"200": {
56+
"description": "OK",
57+
"schema": {
58+
"$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/OperationListResult"
59+
}
60+
},
61+
"default": {
62+
"description": "Error response describing why the operation failed.",
63+
"schema": {
64+
"$ref": "../../../../../common-types/resource-management/v6/types.json#/definitions/ErrorResponse"
65+
}
66+
}
67+
},
68+
"x-ms-pageable": {
69+
"nextLinkName": "nextLink"
70+
}
71+
}
72+
}
73+
}
74+
}

specification/security/resource-manager/readme.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,23 @@ These are the global settings for the Security API.
9999
title: SecurityCenter
100100
description: API spec for Microsoft.Security (Azure Security Center) resource provider
101101
openapi-type: arm
102-
tag: package-composite-v3
102+
tag: package-preview-2024-10
103103
```
104104
105105
### Composite packages
106106
107107
The following packages may be composed from multiple api-versions.
108108
109+
### Tag: package-preview-2024-10
110+
111+
These settings apply only when `--tag=package-preview-2024-10` is specified on the command line.
112+
113+
```yaml $(tag) == 'package-preview-2024-10'
114+
input-file:
115+
- Microsoft.Security/preview/2024-10-01-preview/defenderForStorageSettings.json
116+
- Microsoft.Security/preview/2024-10-01-preview/operations.json
117+
```
118+
109119
### Tag: package-2024-08
110120

111121
These settings apply only when `--tag=package-2024-08` is specified on the command line.

0 commit comments

Comments
 (0)