Skip to content
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

Add ProtectionMode to Microsoft.Security applicationWhitelistings #7243

Merged
merged 8 commits into from
Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
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
Expand Up @@ -211,6 +211,9 @@
"enforcementMode": {
"$ref": "#/definitions/EnforcementMode"
},
"protectionMode": {
"$ref": "#/definitions/ProtectionMode"
},
"configurationStatus": {
"$ref": "#/definitions/ConfigurationStatus"
},
Expand All @@ -236,8 +239,13 @@
"description": "The altered data of the recommended VM/server group policy",
"properties": {
"enforcementMode": {
"description": "The enforcement mode of the group. Can also be defined per collection type by using ProtectionMode",
"$ref": "#/definitions/EnforcementMode"
},
"protectionMode": {
"description": "The protection mode of the group per collection type. Can also be defined for all collection types by using EnforcementMode",
"$ref": "#/definitions/ProtectionMode"
},
"vmRecommendations": {
"$ref": "#/definitions/VmRecommendations"
},
Expand Down Expand Up @@ -265,6 +273,24 @@
"Enforce"
]
},
"ProtectionMode": {
"type": "object",
"description": "The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for Linux.",
"properties": {
"Exe": {
"$ref": "#/definitions/EnforcementMode"
},
"Msi": {
"$ref": "#/definitions/EnforcementMode"
},
"Script": {
"$ref": "#/definitions/EnforcementMode"
},
"Executable": {
"$ref": "#/definitions/EnforcementMode"
}
}
},
Copy link
Member

Choose a reason for hiding this comment

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

This seems to represent a mapping from file type (enum) to protection mode which seems like an enum also. Generally, using additionalProperties is discouraged because it makes APIs harder to use. In you case, you could model each file type as an optional property in this object and let the value be a protection mode enum type. This option would preserve the current shape of the object over the wire.

Another option would be to model this as an array of objects with 2 properties: file type and protection mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@majastrz , Done

Copy link
Member

Choose a reason for hiding this comment

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

There are few potential new ARM errors, property names should be camel case. See this report https://dev.azure.com/azure-sdk/public/_build/results?buildId=114422&view=logs

"RecommendationStatus": {
"type": "string",
"description": "The recommendation status of the VM/server group or VM/server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
"properties": {
"recommendationStatus": "Recommended",
"enforcementMode": "Audit",
"protectionMode": {
"Exe": "Audit",
"Msi": "Audit",
"Script": "None"
},
"vmRecommendations": [
{
"configurationStatus": "Configured",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"properties": {
"recommendationStatus": "Recommended",
"enforcementMode": "Audit",
"protectionMode": {
"Exe": "Audit",
"Msi": "Audit",
"Script": "None"
},
"vmRecommendations": [
{
"configurationStatus": "Configured",
Expand Down Expand Up @@ -124,6 +129,11 @@
"properties": {
"recommendationStatus": "Recommended",
"enforcementMode": "Audit",
"protectionMode": {
"Exe": "Audit",
"Msi": "None",
"Script": "None"
},
"vmRecommendations": [
{
"configurationStatus": "Configured",
Expand Down Expand Up @@ -169,6 +179,11 @@
"properties": {
"recommendationStatus": "Recommended",
"enforcementMode": "Audit",
"protectionMode": {
"Exe": "Audit",
"Msi": "None",
"Script": "None"
},
"vmRecommendations": [
{
"configurationStatus": "Configured",
Expand Down Expand Up @@ -313,123 +328,6 @@
"sourceSystem": "Azure_AppLocker"
}
},
{
"id": "/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/providers/Microsoft.Security/locations/centralus/applicationWhitelistings/GROUP2-RE",
"name": "GROUP2-RE",
"type": "Microsoft.Security/applicationWhitelistings",
"location": "centralus",
"properties": {
"recommendationStatus": "Recommended",
"enforcementMode": "Audit",
"vmRecommendations": [
{
"configurationStatus": "Configured",
"resourceId": "/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourcegroups/matanjittest/providers/microsoft.compute/virtualmachines/matansourcejit",
"recommendationAction": "Recommended"
},
{
"configurationStatus": "Configured",
"resourceId": "/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourcegroups/erelh-dsc/providers/microsoft.compute/virtualmachines/erelh-14010",
"recommendationAction": "Recommended"
},
{
"configurationStatus": "Configured",
"resourceId": "/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16091",
"recommendationAction": "Recommended"
}
],
"pathRecommendations": [
{
"path": "[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0",
"type": "PublisherSignature",
"publisherInfo": {
"publisherName": "O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US",
"productName": "*",
"binaryName": "*",
"version": "0.0.0.0"
},
"common": true,
"action": "Recommended",
"usernames": [
{
"username": "Everyone",
"recommendationAction": "Recommended"
}
],
"userSids": [
"S-1-1-0"
],
"fileType": "Exe",
"configurationStatus": "Configured"
},
{
"path": "C:\\bla.exe",
"type": "File",
"common": true,
"action": "Add",
"usernames": [
{
"username": "Everyone",
"recommendationAction": "Recommended"
}
],
"userSids": [
"S-1-1-0"
],
"fileType": "Exe",
"configurationStatus": "Configured"
}
],
"configurationStatus": "Configured",
"issues": [],
"sourceSystem": "Azure_AppLocker"
}
},
{
"id": "/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/providers/Microsoft.Security/locations/westeurope/applicationWhitelistings/BENJITGROUP13",
"name": "BENJITGROUP13",
"type": "Microsoft.Security/applicationWhitelistings",
"location": "westeurope",
"properties": {
"recommendationStatus": "Recommended",
"enforcementMode": "Audit",
"vmRecommendations": [
{
"configurationStatus": "Configured",
"resourceId": "/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourcegroups/bengr-jit-test/providers/microsoft.compute/virtualmachines/bengr-jit-test3",
"recommendationAction": "Recommended"
}
],
"pathRecommendations": [
{
"path": "[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0",
"type": "PublisherSignature",
"publisherInfo": {
"publisherName": "O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US",
"productName": "*",
"binaryName": "*",
"version": "0.0.0.0"
},
"common": true,
"action": "Recommended",
"usernames": [
{
"username": "Everyone",
"recommendationAction": "Recommended"
}
],
"userSids": [
"S-1-1-0"
],
"fileType": "Exe",
"configurationStatus": "Configured"
}
],
"configurationStatus": "Configured",
"issues": [],
"sourceSystem": "Azure_AppLocker"
}
},
{
"id": "/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/providers/Microsoft.Security/locations/westeurope/applicationWhitelistings/GROUP1",
"name": "GROUP1",
Expand All @@ -438,6 +336,9 @@
"properties": {
"recommendationStatus": "Recommended",
"enforcementMode": "Audit",
"protectionMode": {
"Executable": "Audit"
},
"vmRecommendations": [
{
"configurationStatus": "Configured",
Expand Down Expand Up @@ -1110,51 +1011,6 @@
],
"sourceSystem": "Azure_AuditD"
}
},
{
"id": "/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/providers/Microsoft.Security/locations/westeurope/applicationWhitelistings/GROUP2",
"name": "GROUP2",
"type": "Microsoft.Security/applicationWhitelistings",
"location": "westeurope",
"properties": {
"recommendationStatus": "Recommended",
"enforcementMode": "Audit",
"vmRecommendations": [
{
"configurationStatus": "Configured",
"resourceId": "/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourcegroups/bengr-jit-test/providers/microsoft.compute/virtualmachines/bengr-jit-test1",
"recommendationAction": "Recommended"
}
],
"pathRecommendations": [
{
"path": "[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0",
"type": "PublisherSignature",
"publisherInfo": {
"publisherName": "O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US",
"productName": "*",
"binaryName": "*",
"version": "0.0.0.0"
},
"common": true,
"action": "Recommended",
"usernames": [
{
"username": "Everyone",
"recommendationAction": "Recommended"
}
],
"userSids": [
"S-1-1-0"
],
"fileType": "Exe",
"configurationStatus": "Configured"
}
],
"configurationStatus": "Configured",
"issues": [],
"sourceSystem": "Azure_AppLocker"
}
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"name": "ERELGROUP1",
"properties": {
"enforcementMode": "Audit",
"protectionMode": {
"Exe": "Audit",
"Msi": "None",
"Script": "None"
},
"vmRecommendations": [
{
"configurationStatus": "Configured",
Expand Down Expand Up @@ -112,6 +117,11 @@
"properties": {
"recommendationStatus": "Recommended",
"enforcementMode": "Audit",
"protectionMode": {
"Exe": "Audit",
"Msi": "None",
"Script": "None"
},
"vmRecommendations": [
{
"resourceId": "/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16090",
Expand Down