-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Introducing new API for Azure Security Center Settings #3511
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 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d54953d
Add new API for Azure Security Center Settings
tomer-weinberger 1efe8f5
Changed SettingsPUT API to receive parameter and not definition.
tomer-weinberger 41e9a4f
- changed settings parameter name in example and in security paramete…
tomer-weinberger caeaaa8
changes settings to setting in Settings API
tomer-weinberger ee991b7
settings kind to setting kind in settings CSM API
tomer-weinberger 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
20 changes: 20 additions & 0 deletions
20
...r/Microsoft.Security/preview/2017-08-01-preview/examples/Settings/GetSetting_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,20 @@ | ||
| { | ||
| "parameters": { | ||
| "api-version": "2017-08-01-preview", | ||
| "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", | ||
| "settingName": "MCAS" | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "body": { | ||
| "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", | ||
| "name": "MCAS", | ||
| "kind": "DataExportSettings", | ||
| "type": "Microsoft.Security/settings", | ||
| "properties": { | ||
| "enabled": true | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
32 changes: 32 additions & 0 deletions
32
.../Microsoft.Security/preview/2017-08-01-preview/examples/Settings/GetSettings_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,32 @@ | ||
| { | ||
| "parameters": { | ||
| "api-version": "2017-08-01-preview", | ||
| "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23" | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "body": { | ||
| "value": [ | ||
| { | ||
| "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", | ||
| "name": "MCAS", | ||
| "kind": "DataExportSettings", | ||
| "type": "Microsoft.Security/settings", | ||
| "properties": { | ||
| "enabled": true | ||
| } | ||
| }, | ||
| { | ||
| "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/WDATP", | ||
| "name": "WDATP", | ||
| "kind": "DataExportSettings", | ||
| "type": "Microsoft.Security/settings", | ||
| "properties": { | ||
| "enabled": false | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } |
29 changes: 29 additions & 0 deletions
29
...icrosoft.Security/preview/2017-08-01-preview/examples/Settings/UpdateSetting_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,29 @@ | ||
| { | ||
| "parameters": { | ||
| "api-version": "2017-08-01-preview", | ||
| "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", | ||
| "settingName": "MCAS", | ||
| "settings": { | ||
| "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", | ||
| "name": "MCAS", | ||
| "kind": "DataExportSettings", | ||
| "type": "Microsoft.Security/settings", | ||
| "properties": { | ||
| "enabled": true | ||
| } | ||
| } | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "body": { | ||
| "id": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS", | ||
| "name": "MCAS", | ||
| "kind": "DataExportSettings", | ||
| "type": "Microsoft.Security/settings", | ||
| "properties": { | ||
| "enabled": true | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
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 |
|---|---|---|
|
|
@@ -727,6 +727,124 @@ | |
| } | ||
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings": { | ||
| "get": { | ||
| "x-ms-examples": { | ||
| "Get settings of subscription": { | ||
| "$ref": "./examples/Settings/GetSettings_example.json" | ||
| } | ||
| }, | ||
| "tags": [ | ||
| "Settings" | ||
| ], | ||
| "description": "Settings about different configurations in security center", | ||
| "operationId": "Settings_List", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "#/parameters/ApiVersion" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/SubscriptionId" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "OK", | ||
| "schema": { | ||
| "$ref": "#/definitions/SettingsList" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Error response describing why the operation failed.", | ||
| "schema": { | ||
| "$ref": "#/definitions/CloudError" | ||
| } | ||
| } | ||
| }, | ||
| "x-ms-pageable": { | ||
| "nextLinkName": "nextLink" | ||
| } | ||
| } | ||
| }, | ||
| "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}": { | ||
| "get": { | ||
| "x-ms-examples": { | ||
| "Get a setting on subscription": { | ||
| "$ref": "./examples/Settings/GetSetting_example.json" | ||
| } | ||
| }, | ||
| "tags": [ | ||
| "Settings" | ||
| ], | ||
| "description": "Settings of different configurations in security center", | ||
| "operationId": "Settings_Get", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "#/parameters/ApiVersion" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/SubscriptionId" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/SettingName" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "OK", | ||
| "schema": { | ||
| "$ref": "#/definitions/Settings" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Error response describing why the operation failed.", | ||
| "schema": { | ||
| "$ref": "#/definitions/CloudError" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "put": { | ||
| "x-ms-examples": { | ||
| "Update a setting for subscription": { | ||
| "$ref": "./examples/Settings/UpdateSetting_example.json" | ||
| } | ||
| }, | ||
| "tags": [ | ||
| "Settings" | ||
| ], | ||
| "description": "updating settings about different configurations in security center", | ||
| "operationId": "Settings_Update", | ||
| "parameters": [ | ||
| { | ||
| "$ref": "#/parameters/ApiVersion" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/SubscriptionId" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/SettingName" | ||
| }, | ||
| { | ||
| "$ref": "#/parameters/Settings" | ||
| } | ||
| ], | ||
| "responses": { | ||
| "200": { | ||
| "description": "OK", | ||
| "schema": { | ||
| "$ref": "#/definitions/Settings" | ||
| } | ||
| }, | ||
| "default": { | ||
| "description": "Error response describing why the operation failed.", | ||
| "schema": { | ||
| "$ref": "#/definitions/CloudError" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "definitions": { | ||
|
|
@@ -781,6 +899,16 @@ | |
| }, | ||
| "x-ms-azure-resource": true | ||
| }, | ||
| "Kind": { | ||
| "type": "object", | ||
| "description": "Describes an Azure resource with kind", | ||
| "properties": { | ||
| "kind": { | ||
| "type": "string", | ||
| "description": "Kind of the resource" | ||
| } | ||
| } | ||
| }, | ||
| "SecurityContactList": { | ||
| "type": "object", | ||
| "description": "List of security contacts response", | ||
|
|
@@ -1118,6 +1246,90 @@ | |
| "description": "The size (%) of the segment." | ||
| } | ||
| } | ||
| }, | ||
| "SettingsList": { | ||
| "type": "object", | ||
| "description": "Subscription settings list.", | ||
| "properties": { | ||
| "value": { | ||
| "type": "array", | ||
| "description": "The settings list.", | ||
| "items": { | ||
| "$ref": "#/definitions/Settings" | ||
| } | ||
| }, | ||
| "nextLink": { | ||
| "readOnly": true, | ||
| "type": "string", | ||
| "description": "The URI to fetch the next page." | ||
| } | ||
| } | ||
| }, | ||
| "Settings": { | ||
| "type": "object", | ||
| "description": "Represents a security setting in Azure Security Center.", | ||
| "discriminator": "kind", | ||
| "properties": {}, | ||
| "allOf": [ | ||
| { | ||
| "$ref": "#/definitions/Resource" | ||
| }, | ||
| { | ||
| "$ref": "#/definitions/SettingsKind" | ||
| } | ||
| ] | ||
| }, | ||
| "DataExportSettings": { | ||
| "type": "object", | ||
| "description": "Represents a data export setting", | ||
| "x-ms-discriminator-value": "DataExportSettings", | ||
| "properties": { | ||
| "properties": { | ||
| "x-ms-client-flatten": true, | ||
| "description": "Data export setting data", | ||
| "$ref": "#/definitions/DataExportSettingsProperties" | ||
| } | ||
| }, | ||
| "allOf": [ | ||
| { | ||
| "$ref": "#/definitions/Settings" | ||
| } | ||
| ] | ||
| }, | ||
| "SettingsKind": { | ||
| "type": "object", | ||
| "description": "The kind of the security settings", | ||
| "properties": { | ||
| "kind": { | ||
| "type": "string", | ||
| "description": "the kind of the settings string", | ||
| "enum": [ | ||
| "DataExportSettings" | ||
| ], | ||
| "x-ms-enum": { | ||
| "name": "SettingsKind", | ||
| "modelAsString": true, | ||
| "values": [ | ||
| { | ||
| "value": "DataExportSettings" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
can also be DataExport since you are in the context of a setting
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changes all single settings to setting |
||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "DataExportSettingsProperties": { | ||
| "type": "object", | ||
| "description": "The data export settings properties", | ||
| "properties": { | ||
| "enabled": { | ||
| "type": "boolean", | ||
| "description": "Is the data export setting is enabled" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "enabled" | ||
| ] | ||
| } | ||
| }, | ||
| "parameters": { | ||
|
|
@@ -1210,6 +1422,28 @@ | |
| }, | ||
| "x-ms-parameter-location": "method" | ||
| }, | ||
| "SettingName": { | ||
| "name": "settingName", | ||
| "in": "path", | ||
| "required": true, | ||
| "type": "string", | ||
| "description": "Name of setting", | ||
| "enum": [ | ||
| "MCAS", | ||
| "WDATP" | ||
| ], | ||
| "x-ms-parameter-location": "method" | ||
| }, | ||
| "Settings": { | ||
| "name": "settings", | ||
| "in": "body", | ||
| "required": true, | ||
| "description": "Settings object", | ||
| "schema": { | ||
| "$ref": "#/definitions/Settings" | ||
| }, | ||
| "x-ms-parameter-location": "method" | ||
| }, | ||
| "AutoProvisioningSettingName": { | ||
| "name": "settingName", | ||
| "in": "path", | ||
|
|
||
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.
Setting
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.
Changes all single settings to setting