Gallery › Guest Configuration › Azure built-in policies
[Deprecated]: Deploy prerequisites to audit Windows VMs configurations in 'Windows Components'
Converted Policy DeployIfNotExists Mode Indexed Version 1.2.0-deprecated Deprecated
This policy creates a Guest Configuration assignment to audit Windows virtual machines with non-compliant settings in Group Policy category: 'Windows Components'. It also creates a system-assigned managed identity and deploys the VM extension for Guest Configuration. This policy should only be used along with its corresponding audit policy in an initiative. For more information on Guest Configuration policies, please visit https://aka.ms/gcpol
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
{
"properties": {
"displayName": "[Deprecated]: Deploy prerequisites to audit Windows VMs configurations in 'Windows Components'",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "This policy creates a Guest Configuration assignment to audit Windows virtual machines with non-compliant settings in Group Policy category: 'Windows Components'. It also creates a system-assigned managed identity and deploys the VM extension for Guest Configuration. This policy should only be used along with its corresponding audit policy in an initiative. For more information on Guest Configuration policies, please visit https://aka.ms/gcpol",
"metadata": {
"version": "1.2.0-deprecated",
"category": "Guest Configuration",
"requiredProviders": [
"Microsoft.GuestConfiguration"
],
"deprecated": true
},
"version": "1.2.0",
"parameters": {
"SendFileSamplesWhenFurtherAnalysisIsRequired": {
"type": "string",
"metadata": {
"displayName": "Send file samples when further analysis is required",
"description": "Specifies whether and how Windows Defender will submit samples of suspected malware to Microsoft for further analysis when opt-in for MAPS telemetry is set."
},
"defaultValue": "1"
},
"AllowIndexingOfEncryptedFiles": {
"type": "string",
"metadata": {
"displayName": "Allow indexing of encrypted files",
"description": "Specifies whether encrypted items are allowed to be indexed."
},
"defaultValue": "0"
},
"AllowTelemetry": {
"type": "string",
"metadata": {
"displayName": "Allow Telemetry",
"description": "Specifies configuration of the amount of diagnostic and usage data reported to Microsoft. The data is transmitted securely and sensitive data is not sent."
},
"defaultValue": "2"
},
"AllowUnencryptedTraffic": {
"type": "string",
"metadata": {
"displayName": "Allow unencrypted traffic",
"description": "Specifies whether the Windows Remote Management (WinRM) service sends and receives unencrypted messages over the network."
},
"defaultValue": "0"
},
"AlwaysInstallWithElevatedPrivileges": {
"type": "string",
"metadata": {
"displayName": "Always install with elevated privileges",
"description": "Specifies whether Windows Installer should use system permissions when it installs any program on the system."
},
"defaultValue": "0"
},
"AlwaysPromptForPasswordUponConnection": {
"type": "string",
"metadata": {
"displayName": "Always prompt for password upon connection",
"description": "Specifies whether Terminal Services/Remote Desktop Connection always prompts the client computer for a password upon connection."
},
"defaultValue": "1"
},
"ApplicationSpecifyTheMaximumLogFileSizeKB": {
"type": "string",
"metadata": {
"displayName": "Application: Specify the maximum log file size (KB)",
"description": "Specifies the maximum size for the Application event log in kilobytes."
},
"defaultValue": "32768"
},
"AutomaticallySendMemoryDumpsForOSgeneratedErrorReports": {
"type": "string",
"metadata": {
"displayName": "Automatically send memory dumps for OS-generated error reports",
"description": "Specifies if memory dumps in support of OS-generated error reports can be sent to Microsoft automatically."
},
"defaultValue": "1"
},
"ConfigureDefaultConsent": {
"type": "string",
"metadata": {
"displayName": "Configure Default consent",
"description": "Specifies setting of the default consent handling for error reports sent to Microsoft."
},
"defaultValue": "4"
},
"ConfigureWindowsSmartScreen": {
"type": "string",
"metadata": {
"displayName": "Configure Windows SmartScreen",
"description": "Specifies how to manage the behavior of Windows SmartScreen. Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. Some information is sent to Microsoft about files and programs run on PCs with this feature enabled."
},
"defaultValue": "1"
},
"DisallowDigestAuthentication": {
"type": "string",
"metadata": {
"displayName": "Disallow Digest authentication",
"description": "Specifies whether the Windows Remote Management (WinRM) client will not use Digest authentication."
},
"defaultValue": "0"
},
"DisallowWinRMFromStoringRunAsCredentials": {
"type": "string",
"metadata": {
"displayName": "Disallow WinRM from storing RunAs credentials",
"description": "Specifies whether the Windows Remote Management (WinRM) service will not allow RunAs credentials to be stored for any plug-ins."
},
"defaultValue": "1"
},
"DoNotAllowPasswordsToBeSaved": {
"type": "string",
"metadata": {
"displayName": "Do not allow passwords to be saved",
"description": "Specifies whether to prevent Remote Desktop Services - Terminal Services clients from saving passwords on a computer."
},
"defaultValue": "1"
},
"SecuritySpecifyTheMaximumLogFileSizeKB": {
"type": "string",
"metadata": {
"displayName": "Security: Specify the maximum log file size (KB)",
"description": "Specifies the maximum size for the Security event log in kilobytes."
},
"defaultValue": "196608"
},
"SetClientConnectionEncryptionLevel": {
"type": "string",
"metadata": {
"displayName": "Set client connection encryption level",
"description": "Specifies whether to require the use of a specific encryption level to secure communications between client computers and RD Session Host servers during Remote Desktop Protocol (RDP) connections. This policy only applies when you are using native RDP encryption."
},
"defaultValue": "3"
},
"SetTheDefaultBehaviorForAutoRun": {
"type": "string",
"metadata": {
"displayName": "Set the default behavior for AutoRun",
"description": "Specifies the default behavior for Autorun commands. Autorun commands are generally stored in autorun.inf files. They often launch the installation program or other routines."
},
"defaultValue": "1"
},
"SetupSpecifyTheMaximumLogFileSizeKB": {
"type": "string",
"metadata": {
"displayName": "Setup: Specify the maximum log file size (KB)",
"description": "Specifies the maximum size for the Setup event log in kilobytes."
},
"defaultValue": "32768"
},
"SystemSpecifyTheMaximumLogFileSizeKB": {
"type": "string",
"metadata": {
"displayName": "System: Specify the maximum log file size (KB)",
"description": "Specifies the maximum size for the System event log in kilobytes."
},
"defaultValue": "32768"
},
"TurnOffDataExecutionPreventionForExplorer": {
"type": "string",
"metadata": {
"displayName": "Turn off Data Execution Prevention for Explorer",
"description": "Specifies whether to turn off Data Execution Prevention for Windows File Explorer. Disabling data execution prevention can allow certain legacy plug-in applications to function without terminating Explorer."
},
"defaultValue": "0"
},
"SpecifyTheIntervalToCheckForDefinitionUpdates": {
"type": "string",
"metadata": {
"displayName": "Specify the interval to check for definition updates",
"description": "Specifies an interval at which to check for Windows Defender definition updates. The time value is represented as the number of hours between update checks."
},
"defaultValue": "8"
}
},
"policyRule": {
"if": {
"anyOf": [
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.Compute/virtualMachines"
},
{
"anyOf": [
{
"field": "Microsoft.Compute/imagePublisher",
"in": [
"esri",
"incredibuild",
"MicrosoftDynamicsAX",
"MicrosoftSharepoint",
"MicrosoftVisualStudio",
"MicrosoftWindowsDesktop",
"MicrosoftWindowsServerHPCPack"
]
},
{
"allOf": [
{
"field": "Microsoft.Compute/imagePublisher",
"equals": "MicrosoftWindowsServer"
},
{
"field": "Microsoft.Compute/imageSKU",
"notLike": "2008*"
}
]
},
{
"allOf": [
{
"field": "Microsoft.Compute/imagePublisher",
"equals": "MicrosoftSQLServer"
},
{
"field": "Microsoft.Compute/imageOffer",
"notLike": "SQL2008*"
}
]
},
{
"allOf": [
{
"field": "Microsoft.Compute/imagePublisher",
"equals": "microsoft-dsvm"
},
{
"field": "Microsoft.Compute/imageOffer",
"equals": "dsvm-windows"
}
]
},
{
"allOf": [
{
"field": "Microsoft.Compute/imagePublisher",
"equals": "microsoft-ads"
},
{
"field": "Microsoft.Compute/imageOffer",
"in": [
"standard-data-science-vm",
"windows-data-science-vm"
]
}
]
},
{
"allOf": [
{
"field": "Microsoft.Compute/imagePublisher",
"equals": "batch"
},
{
"field": "Microsoft.Compute/imageOffer",
"equals": "rendering-windows2016"
}
]
},
{
"allOf": [
{
"field": "Microsoft.Compute/imagePublisher",
"equals": "center-for-internet-security-inc"
},
{
"field": "Microsoft.Compute/imageOffer",
"like": "cis-windows-server-201*"
}
]
},
{
"allOf": [
{
"field": "Microsoft.Compute/imagePublisher",
"equals": "pivotal"
},
{
"field": "Microsoft.Compute/imageOffer",
"like": "bosh-windows-server*"
}
]
},
{
"allOf": [
{
"field": "Microsoft.Compute/imagePublisher",
"equals": "cloud-infrastructure-services"
},
{
"field": "Microsoft.Compute/imageOffer",
"like": "ad*"
}
]
},
{
"allOf": [
{
"anyOf": [
{
"field": "Microsoft.Compute/virtualMachines/osProfile.windowsConfiguration",
"exists": "true"
},
{
"field": "Microsoft.Compute/virtualMachines/storageProfile.osDisk.osType",
"like": "Windows*"
}
]
},
{
"anyOf": [
{
"field": "Microsoft.Compute/imageSKU",
"exists": "false"
},
{
"allOf": [
{
"field": "Microsoft.Compute/imageSKU",
"notLike": "2008*"
},
{
"field": "Microsoft.Compute/imageOffer",
"notLike": "SQL2008*"
}
]
}
]
}
]
}
]
}
]
},
{
"allOf": [
{
"field": "type",
"equals": "Microsoft.HybridCompute/machines"
},
{
"field": "Microsoft.HybridCompute/imageOffer",
"like": "windows*"
}
]
}
]
},
"then": {
"effect": "deployIfNotExists",
"details": {
"roleDefinitionIds": [
"/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c"
],
"type": "Microsoft.GuestConfiguration/guestConfigurationAssignments",
"name": "AzureBaseline_WindowsComponents",
"existenceCondition": {
"field": "Microsoft.GuestConfiguration/guestConfigurationAssignments/parameterHash",
"equals": "[base64(concat('Send file samples when further analysis is required;ExpectedValue', '=', parameters('SendFileSamplesWhenFurtherAnalysisIsRequired'), ',', 'Allow indexing of encrypted files;ExpectedValue', '=', parameters('AllowIndexingOfEncryptedFiles'), ',', 'Allow Telemetry;ExpectedValue', '=', parameters('AllowTelemetry'), ',', 'Allow unencrypted traffic;ExpectedValue', '=', parameters('AllowUnencryptedTraffic'), ',', 'Always install with elevated privileges;ExpectedValue', '=', parameters('AlwaysInstallWithElevatedPrivileges'), ',', 'Always prompt for password upon connection;ExpectedValue', '=', parameters('AlwaysPromptForPasswordUponConnection'), ',', 'Application: Specify the maximum log file size (KB);ExpectedValue', '=', parameters('ApplicationSpecifyTheMaximumLogFileSizeKB'), ',', 'Automatically send memory dumps for OS-generated error reports;ExpectedValue', '=', parameters('AutomaticallySendMemoryDumpsForOSgeneratedErrorReports'), ',', 'Configure Default consent;ExpectedValue', '=', parameters('ConfigureDefaultConsent'), ',', 'Configure Windows SmartScreen;ExpectedValue', '=', parameters('ConfigureWindowsSmartScreen'), ',', 'Disallow Digest authentication;ExpectedValue', '=', parameters('DisallowDigestAuthentication'), ',', 'Disallow WinRM from storing RunAs credentials;ExpectedValue', '=', parameters('DisallowWinRMFromStoringRunAsCredentials'), ',', 'Do not allow passwords to be saved;ExpectedValue', '=', parameters('DoNotAllowPasswordsToBeSaved'), ',', 'Security: Specify the maximum log file size (KB);ExpectedValue', '=', parameters('SecuritySpecifyTheMaximumLogFileSizeKB'), ',', 'Set client connection encryption level;ExpectedValue', '=', parameters('SetClientConnectionEncryptionLevel'), ',', 'Set the default behavior for AutoRun;ExpectedValue', '=', parameters('SetTheDefaultBehaviorForAutoRun'), ',', 'Setup: Specify the maximum log file size (KB);ExpectedValue', '=', parameters('SetupSpecifyTheMaximumLogFileSizeKB'), ',', 'System: Specify the maximum log file size (KB);ExpectedValue', '=', parameters('SystemSpecifyTheMaximumLogFileSizeKB'), ',', 'Turn off Data Execution Prevention for Explorer;ExpectedValue', '=', parameters('TurnOffDataExecutionPreventionForExplorer'), ',', 'Specify the interval to check for definition updates;ExpectedValue', '=', parameters('SpecifyTheIntervalToCheckForDefinitionUpdates')))]"
},
"deployment": {
"properties": {
"mode": "incremental",
"parameters": {
"vmName": {
"value": "[field('name')]"
},
"location": {
"value": "[field('location')]"
},
"type": {
"value": "[field('type')]"
},
"configurationName": {
"value": "AzureBaseline_WindowsComponents"
},
"SendFileSamplesWhenFurtherAnalysisIsRequired": {
"value": "[parameters('SendFileSamplesWhenFurtherAnalysisIsRequired')]"
},
"AllowIndexingOfEncryptedFiles": {
"value": "[parameters('AllowIndexingOfEncryptedFiles')]"
},
"AllowTelemetry": {
"value": "[parameters('AllowTelemetry')]"
},
"AllowUnencryptedTraffic": {
"value": "[parameters('AllowUnencryptedTraffic')]"
},
"AlwaysInstallWithElevatedPrivileges": {
"value": "[parameters('AlwaysInstallWithElevatedPrivileges')]"
},
"AlwaysPromptForPasswordUponConnection": {
"value": "[parameters('AlwaysPromptForPasswordUponConnection')]"
},
"ApplicationSpecifyTheMaximumLogFileSizeKB": {
"value": "[parameters('ApplicationSpecifyTheMaximumLogFileSizeKB')]"
},
"AutomaticallySendMemoryDumpsForOSgeneratedErrorReports": {
"value": "[parameters('AutomaticallySendMemoryDumpsForOSgeneratedErrorReports')]"
},
"ConfigureDefaultConsent": {
"value": "[parameters('ConfigureDefaultConsent')]"
},
"ConfigureWindowsSmartScreen": {
"value": "[parameters('ConfigureWindowsSmartScreen')]"
},
"DisallowDigestAuthentication": {
"value": "[parameters('DisallowDigestAuthentication')]"
},
"DisallowWinRMFromStoringRunAsCredentials": {
"value": "[parameters('DisallowWinRMFromStoringRunAsCredentials')]"
},
"DoNotAllowPasswordsToBeSaved": {
"value": "[parameters('DoNotAllowPasswordsToBeSaved')]"
},
"SecuritySpecifyTheMaximumLogFileSizeKB": {
"value": "[parameters('SecuritySpecifyTheMaximumLogFileSizeKB')]"
},
"SetClientConnectionEncryptionLevel": {
"value": "[parameters('SetClientConnectionEncryptionLevel')]"
},
"SetTheDefaultBehaviorForAutoRun": {
"value": "[parameters('SetTheDefaultBehaviorForAutoRun')]"
},
"SetupSpecifyTheMaximumLogFileSizeKB": {
"value": "[parameters('SetupSpecifyTheMaximumLogFileSizeKB')]"
},
"SystemSpecifyTheMaximumLogFileSizeKB": {
"value": "[parameters('SystemSpecifyTheMaximumLogFileSizeKB')]"
},
"TurnOffDataExecutionPreventionForExplorer": {
"value": "[parameters('TurnOffDataExecutionPreventionForExplorer')]"
},
"SpecifyTheIntervalToCheckForDefinitionUpdates": {
"value": "[parameters('SpecifyTheIntervalToCheckForDefinitionUpdates')]"
}
},
"template": {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmName": {
"type": "string"
},
"location": {
"type": "string"
},
"type": {
"type": "string"
},
"configurationName": {
"type": "string"
},
"SendFileSamplesWhenFurtherAnalysisIsRequired": {
"type": "string"
},
"AllowIndexingOfEncryptedFiles": {
"type": "string"
},
"AllowTelemetry": {
"type": "string"
},
"AllowUnencryptedTraffic": {
"type": "string"
},
"AlwaysInstallWithElevatedPrivileges": {
"type": "string"
},
"AlwaysPromptForPasswordUponConnection": {
"type": "string"
},
"ApplicationSpecifyTheMaximumLogFileSizeKB": {
"type": "string"
},
"AutomaticallySendMemoryDumpsForOSgeneratedErrorReports": {
"type": "string"
},
"ConfigureDefaultConsent": {
"type": "string"
},
"ConfigureWindowsSmartScreen": {
"type": "string"
},
"DisallowDigestAuthentication": {
"type": "string"
},
"DisallowWinRMFromStoringRunAsCredentials": {
"type": "string"
},
"DoNotAllowPasswordsToBeSaved": {
"type": "string"
},
"SecuritySpecifyTheMaximumLogFileSizeKB": {
"type": "string"
},
"SetClientConnectionEncryptionLevel": {
"type": "string"
},
"SetTheDefaultBehaviorForAutoRun": {
"type": "string"
},
"SetupSpecifyTheMaximumLogFileSizeKB": {
"type": "string"
},
"SystemSpecifyTheMaximumLogFileSizeKB": {
"type": "string"
},
"TurnOffDataExecutionPreventionForExplorer": {
"type": "string"
},
"SpecifyTheIntervalToCheckForDefinitionUpdates": {
"type": "string"
}
},
"resources": [
{
"condition": "[equals(toLower(parameters('type')), toLower('microsoft.hybridcompute/machines'))]",
"apiVersion": "2018-11-20",
"type": "Microsoft.HybridCompute/machines/providers/guestConfigurationAssignments",
"name": "[concat(parameters('vmName'), '/Microsoft.GuestConfiguration/', parameters('configurationName'))]",
"location": "[parameters('location')]",
"properties": {
"guestConfiguration": {
"name": "[parameters('configurationName')]",
"version": "1.*",
"configurationParameter": [
{
"name": "Send file samples when further analysis is required;ExpectedValue",
"value": "[parameters('SendFileSamplesWhenFurtherAnalysisIsRequired')]"
},
{
"name": "Allow indexing of encrypted files;ExpectedValue",
"value": "[parameters('AllowIndexingOfEncryptedFiles')]"
},
{
"name": "Allow Telemetry;ExpectedValue",
"value": "[parameters('AllowTelemetry')]"
},
{
"name": "Allow unencrypted traffic;ExpectedValue",
"value": "[parameters('AllowUnencryptedTraffic')]"
},
{
"name": "Always install with elevated privileges;ExpectedValue",
"value": "[parameters('AlwaysInstallWithElevatedPrivileges')]"
},
{
"name": "Always prompt for password upon connection;ExpectedValue",
"value": "[parameters('AlwaysPromptForPasswordUponConnection')]"
},
{
"name": "Application: Specify the maximum log file size (KB);ExpectedValue",
"value": "[parameters('ApplicationSpecifyTheMaximumLogFileSizeKB')]"
},
{
"name": "Automatically send memory dumps for OS-generated error reports;ExpectedValue",
"value": "[parameters('AutomaticallySendMemoryDumpsForOSgeneratedErrorReports')]"
},
{
"name": "Configure Default consent;ExpectedValue",
"value": "[parameters('ConfigureDefaultConsent')]"
},
{
"name": "Configure Windows SmartScreen;ExpectedValue",
"value": "[parameters('ConfigureWindowsSmartScreen')]"
},
{
"name": "Disallow Digest authentication;ExpectedValue",
"value": "[parameters('DisallowDigestAuthentication')]"
},
{
"name": "Disallow WinRM from storing RunAs credentials;ExpectedValue",
"value": "[parameters('DisallowWinRMFromStoringRunAsCredentials')]"
},
{
"name": "Do not allow passwords to be saved;ExpectedValue",
"value": "[parameters('DoNotAllowPasswordsToBeSaved')]"
},
{
"name": "Security: Specify the maximum log file size (KB);ExpectedValue",
"value": "[parameters('SecuritySpecifyTheMaximumLogFileSizeKB')]"
},
{
"name": "Set client connection encryption level;ExpectedValue",
"value": "[parameters('SetClientConnectionEncryptionLevel')]"
},
{
"name": "Set the default behavior for AutoRun;ExpectedValue",
"value": "[parameters('SetTheDefaultBehaviorForAutoRun')]"
},
{
"name": "Setup: Specify the maximum log file size (KB);ExpectedValue",
"value": "[parameters('SetupSpecifyTheMaximumLogFileSizeKB')]"
},
{
"name": "System: Specify the maximum log file size (KB);ExpectedValue",
"value": "[parameters('SystemSpecifyTheMaximumLogFileSizeKB')]"
},
{
"name": "Turn off Data Execution Prevention for Explorer;ExpectedValue",
"value": "[parameters('TurnOffDataExecutionPreventionForExplorer')]"
},
{
"name": "Specify the interval to check for definition updates;ExpectedValue",
"value": "[parameters('SpecifyTheIntervalToCheckForDefinitionUpdates')]"
}
]
}
}
},
{
"condition": "[equals(toLower(parameters('type')), toLower('Microsoft.Compute/virtualMachines'))]",
"apiVersion": "2018-11-20",
"type": "Microsoft.Compute/virtualMachines/providers/guestConfigurationAssignments",
"name": "[concat(parameters('vmName'), '/Microsoft.GuestConfiguration/', parameters('configurationName'))]",
"location": "[parameters('location')]",
"properties": {
"guestConfiguration": {
"name": "[parameters('configurationName')]",
"version": "1.*",
"configurationParameter": [
{
"name": "Send file samples when further analysis is required;ExpectedValue",
"value": "[parameters('SendFileSamplesWhenFurtherAnalysisIsRequired')]"
},
{
"name": "Allow indexing of encrypted files;ExpectedValue",
"value": "[parameters('AllowIndexingOfEncryptedFiles')]"
},
{
"name": "Allow Telemetry;ExpectedValue",
"value": "[parameters('AllowTelemetry')]"
},
{
"name": "Allow unencrypted traffic;ExpectedValue",
"value": "[parameters('AllowUnencryptedTraffic')]"
},
{
"name": "Always install with elevated privileges;ExpectedValue",
"value": "[parameters('AlwaysInstallWithElevatedPrivileges')]"
},
{
"name": "Always prompt for password upon connection;ExpectedValue",
"value": "[parameters('AlwaysPromptForPasswordUponConnection')]"
},
{
"name": "Application: Specify the maximum log file size (KB);ExpectedValue",
"value": "[parameters('ApplicationSpecifyTheMaximumLogFileSizeKB')]"
},
{
"name": "Automatically send memory dumps for OS-generated error reports;ExpectedValue",
"value": "[parameters('AutomaticallySendMemoryDumpsForOSgeneratedErrorReports')]"
},
{
"name": "Configure Default consent;ExpectedValue",
"value": "[parameters('ConfigureDefaultConsent')]"
},
{
"name": "Configure Windows SmartScreen;ExpectedValue",
"value": "[parameters('ConfigureWindowsSmartScreen')]"
},
{
"name": "Disallow Digest authentication;ExpectedValue",
"value": "[parameters('DisallowDigestAuthentication')]"
},
{
"name": "Disallow WinRM from storing RunAs credentials;ExpectedValue",
"value": "[parameters('DisallowWinRMFromStoringRunAsCredentials')]"
},
{
"name": "Do not allow passwords to be saved;ExpectedValue",
"value": "[parameters('DoNotAllowPasswordsToBeSaved')]"
},
{
"name": "Security: Specify the maximum log file size (KB);ExpectedValue",
"value": "[parameters('SecuritySpecifyTheMaximumLogFileSizeKB')]"
},
{
"name": "Set client connection encryption level;ExpectedValue",
"value": "[parameters('SetClientConnectionEncryptionLevel')]"
},
{
"name": "Set the default behavior for AutoRun;ExpectedValue",
"value": "[parameters('SetTheDefaultBehaviorForAutoRun')]"
},
{
"name": "Setup: Specify the maximum log file size (KB);ExpectedValue",
"value": "[parameters('SetupSpecifyTheMaximumLogFileSizeKB')]"
},
{
"name": "System: Specify the maximum log file size (KB);ExpectedValue",
"value": "[parameters('SystemSpecifyTheMaximumLogFileSizeKB')]"
},
{
"name": "Turn off Data Execution Prevention for Explorer;ExpectedValue",
"value": "[parameters('TurnOffDataExecutionPreventionForExplorer')]"
},
{
"name": "Specify the interval to check for definition updates;ExpectedValue",
"value": "[parameters('SpecifyTheIntervalToCheckForDefinitionUpdates')]"
}
]
}
}
},
{
"condition": "[equals(toLower(parameters('type')), toLower('Microsoft.Compute/virtualMachines'))]",
"apiVersion": "2019-07-01",
"type": "Microsoft.Compute/virtualMachines",
"identity": {
"type": "SystemAssigned"
},
"name": "[parameters('vmName')]",
"location": "[parameters('location')]"
},
{
"condition": "[equals(toLower(parameters('type')), toLower('Microsoft.Compute/virtualMachines'))]",
"apiVersion": "2019-07-01",
"name": "[concat(parameters('vmName'), '/AzurePolicyforWindows')]",
"type": "Microsoft.Compute/virtualMachines/extensions",
"location": "[parameters('location')]",
"properties": {
"publisher": "Microsoft.GuestConfiguration",
"type": "ConfigurationforWindows",
"typeHandlerVersion": "1.1",
"autoUpgradeMinorVersion": true,
"settings": {},
"protectedSettings": {}
},
"dependsOn": [
"[concat('Microsoft.Compute/virtualMachines/',parameters('vmName'),'/providers/Microsoft.GuestConfiguration/guestConfigurationAssignments/',parameters('configurationName'))]"
]
}
]
}
}
}
}
}
},
"versions": [
"1.2.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/7040a231-fb65-4412-8c0a-b365f4866c24",
"name": "7040a231-fb65-4412-8c0a-b365f4866c24"
}# Converted from WindowsComponents_DINE.json by ConvertTo-Bylaw.
Policy '7040a231-fb65-4412-8c0a-b365f4866c24' {
Properties @{
DisplayName = '[Deprecated]: Deploy prerequisites to audit Windows VMs configurations in ''Windows Components'''
Description = 'This policy creates a Guest Configuration assignment to audit Windows virtual machines with non-compliant settings in Group Policy category: ''Windows Components''. It also creates a system-assigned managed identity and deploys the VM extension for Guest Configuration. This policy should only be used along with its corresponding audit policy in an initiative. For more information on Guest Configuration policies, please visit https://aka.ms/gcpol'
Version = '1.2.0-deprecated'
Category = 'Guest Configuration'
Deprecated = $true
PolicyVersion = '1.2.0'
Mode = 'Indexed'
Metadata = [ordered]@{ requiredProviders = @('Microsoft.GuestConfiguration') }
}
Parameter SendFileSamplesWhenFurtherAnalysisIsRequired @{
Type = 'string'
Default = '1'
DisplayName = 'Send file samples when further analysis is required'
Description = 'Specifies whether and how Windows Defender will submit samples of suspected malware to Microsoft for further analysis when opt-in for MAPS telemetry is set.'
JsonName = 'SendFileSamplesWhenFurtherAnalysisIsRequired'
}
Parameter AllowIndexingOfEncryptedFiles @{
Type = 'string'
Default = '0'
DisplayName = 'Allow indexing of encrypted files'
Description = 'Specifies whether encrypted items are allowed to be indexed.'
JsonName = 'AllowIndexingOfEncryptedFiles'
}
Parameter AllowTelemetry @{
Type = 'string'
Default = '2'
DisplayName = 'Allow Telemetry'
Description = 'Specifies configuration of the amount of diagnostic and usage data reported to Microsoft. The data is transmitted securely and sensitive data is not sent.'
JsonName = 'AllowTelemetry'
}
Parameter AllowUnencryptedTraffic @{
Type = 'string'
Default = '0'
DisplayName = 'Allow unencrypted traffic'
Description = 'Specifies whether the Windows Remote Management (WinRM) service sends and receives unencrypted messages over the network.'
JsonName = 'AllowUnencryptedTraffic'
}
Parameter AlwaysInstallWithElevatedPrivileges @{
Type = 'string'
Default = '0'
DisplayName = 'Always install with elevated privileges'
Description = 'Specifies whether Windows Installer should use system permissions when it installs any program on the system.'
JsonName = 'AlwaysInstallWithElevatedPrivileges'
}
Parameter AlwaysPromptForPasswordUponConnection @{
Type = 'string'
Default = '1'
DisplayName = 'Always prompt for password upon connection'
Description = 'Specifies whether Terminal Services/Remote Desktop Connection always prompts the client computer for a password upon connection.'
JsonName = 'AlwaysPromptForPasswordUponConnection'
}
Parameter ApplicationSpecifyTheMaximumLogFileSizeKB @{
Type = 'string'
Default = '32768'
DisplayName = 'Application: Specify the maximum log file size (KB)'
Description = 'Specifies the maximum size for the Application event log in kilobytes.'
JsonName = 'ApplicationSpecifyTheMaximumLogFileSizeKB'
}
Parameter AutomaticallySendMemoryDumpsForOSgeneratedErrorReports @{
Type = 'string'
Default = '1'
DisplayName = 'Automatically send memory dumps for OS-generated error reports'
Description = 'Specifies if memory dumps in support of OS-generated error reports can be sent to Microsoft automatically.'
JsonName = 'AutomaticallySendMemoryDumpsForOSgeneratedErrorReports'
}
Parameter ConfigureDefaultConsent @{
Type = 'string'
Default = '4'
DisplayName = 'Configure Default consent'
Description = 'Specifies setting of the default consent handling for error reports sent to Microsoft.'
JsonName = 'ConfigureDefaultConsent'
}
Parameter ConfigureWindowsSmartScreen @{
Type = 'string'
Default = '1'
DisplayName = 'Configure Windows SmartScreen'
Description = 'Specifies how to manage the behavior of Windows SmartScreen. Windows SmartScreen helps keep PCs safer by warning users before running unrecognized programs downloaded from the Internet. Some information is sent to Microsoft about files and programs run on PCs with this feature enabled.'
JsonName = 'ConfigureWindowsSmartScreen'
}
Parameter DisallowDigestAuthentication @{
Type = 'string'
Default = '0'
DisplayName = 'Disallow Digest authentication'
Description = 'Specifies whether the Windows Remote Management (WinRM) client will not use Digest authentication.'
JsonName = 'DisallowDigestAuthentication'
}
Parameter DisallowWinRMFromStoringRunAsCredentials @{
Type = 'string'
Default = '1'
DisplayName = 'Disallow WinRM from storing RunAs credentials'
Description = 'Specifies whether the Windows Remote Management (WinRM) service will not allow RunAs credentials to be stored for any plug-ins.'
JsonName = 'DisallowWinRMFromStoringRunAsCredentials'
}
Parameter DoNotAllowPasswordsToBeSaved @{
Type = 'string'
Default = '1'
DisplayName = 'Do not allow passwords to be saved'
Description = 'Specifies whether to prevent Remote Desktop Services - Terminal Services clients from saving passwords on a computer.'
JsonName = 'DoNotAllowPasswordsToBeSaved'
}
Parameter SecuritySpecifyTheMaximumLogFileSizeKB @{
Type = 'string'
Default = '196608'
DisplayName = 'Security: Specify the maximum log file size (KB)'
Description = 'Specifies the maximum size for the Security event log in kilobytes.'
JsonName = 'SecuritySpecifyTheMaximumLogFileSizeKB'
}
Parameter SetClientConnectionEncryptionLevel @{
Type = 'string'
Default = '3'
DisplayName = 'Set client connection encryption level'
Description = 'Specifies whether to require the use of a specific encryption level to secure communications between client computers and RD Session Host servers during Remote Desktop Protocol (RDP) connections. This policy only applies when you are using native RDP encryption.'
JsonName = 'SetClientConnectionEncryptionLevel'
}
Parameter SetTheDefaultBehaviorForAutoRun @{
Type = 'string'
Default = '1'
DisplayName = 'Set the default behavior for AutoRun'
Description = 'Specifies the default behavior for Autorun commands. Autorun commands are generally stored in autorun.inf files. They often launch the installation program or other routines.'
JsonName = 'SetTheDefaultBehaviorForAutoRun'
}
Parameter SetupSpecifyTheMaximumLogFileSizeKB @{
Type = 'string'
Default = '32768'
DisplayName = 'Setup: Specify the maximum log file size (KB)'
Description = 'Specifies the maximum size for the Setup event log in kilobytes.'
JsonName = 'SetupSpecifyTheMaximumLogFileSizeKB'
}
Parameter SystemSpecifyTheMaximumLogFileSizeKB @{
Type = 'string'
Default = '32768'
DisplayName = 'System: Specify the maximum log file size (KB)'
Description = 'Specifies the maximum size for the System event log in kilobytes.'
JsonName = 'SystemSpecifyTheMaximumLogFileSizeKB'
}
Parameter TurnOffDataExecutionPreventionForExplorer @{
Type = 'string'
Default = '0'
DisplayName = 'Turn off Data Execution Prevention for Explorer'
Description = 'Specifies whether to turn off Data Execution Prevention for Windows File Explorer. Disabling data execution prevention can allow certain legacy plug-in applications to function without terminating Explorer.'
JsonName = 'TurnOffDataExecutionPreventionForExplorer'
}
Parameter SpecifyTheIntervalToCheckForDefinitionUpdates @{
Type = 'string'
Default = '8'
DisplayName = 'Specify the interval to check for definition updates'
Description = 'Specifies an interval at which to check for Windows Defender definition updates. The time value is represented as the number of hours between update checks.'
JsonName = 'SpecifyTheIntervalToCheckForDefinitionUpdates'
}
Resource * {
Require 'type, imagePublisher, imageSKU and 3 more are as required' {
AnyOf {
Field type | Must -Not -Be 'Microsoft.Compute/virtualMachines' -IfPresent
AllOf {
Field 'Microsoft.Compute/imagePublisher' | Must -Not -BeIn @('esri', 'incredibuild', 'MicrosoftDynamicsAX', 'MicrosoftSharepoint', 'MicrosoftVisualStudio', 'MicrosoftWindowsDesktop', 'MicrosoftWindowsServerHPCPack') -IfPresent
AnyOf {
Field 'Microsoft.Compute/imagePublisher' | Must -Not -Be 'MicrosoftWindowsServer' -IfPresent
Field 'Microsoft.Compute/imageSKU' | Must -BeLike '2008*'
}
AnyOf {
Field 'Microsoft.Compute/imagePublisher' | Must -Not -Be 'MicrosoftSQLServer' -IfPresent
Field 'Microsoft.Compute/imageOffer' | Must -BeLike 'SQL2008*'
}
AnyOf {
Field 'Microsoft.Compute/imagePublisher' | Must -Not -Be 'microsoft-dsvm' -IfPresent
Field 'Microsoft.Compute/imageOffer' | Must -Not -Be 'dsvm-windows' -IfPresent
}
AnyOf {
Field 'Microsoft.Compute/imagePublisher' | Must -Not -Be 'microsoft-ads' -IfPresent
Field 'Microsoft.Compute/imageOffer' | Must -Not -BeIn @('standard-data-science-vm', 'windows-data-science-vm') -IfPresent
}
AnyOf {
Field 'Microsoft.Compute/imagePublisher' | Must -Not -Be 'batch' -IfPresent
Field 'Microsoft.Compute/imageOffer' | Must -Not -Be 'rendering-windows2016' -IfPresent
}
AnyOf {
Field 'Microsoft.Compute/imagePublisher' | Must -Not -Be 'center-for-internet-security-inc' -IfPresent
Field 'Microsoft.Compute/imageOffer' | Must -Not -BeLike 'cis-windows-server-201*' -IfPresent
}
AnyOf {
Field 'Microsoft.Compute/imagePublisher' | Must -Not -Be 'pivotal' -IfPresent
Field 'Microsoft.Compute/imageOffer' | Must -Not -BeLike 'bosh-windows-server*' -IfPresent
}
AnyOf {
Field 'Microsoft.Compute/imagePublisher' | Must -Not -Be 'cloud-infrastructure-services' -IfPresent
Field 'Microsoft.Compute/imageOffer' | Must -Not -BeLike 'ad*' -IfPresent
}
AnyOf {
AllOf {
Field 'Microsoft.Compute/virtualMachines/osProfile.windowsConfiguration' | Must -Not -Exist
Field 'Microsoft.Compute/virtualMachines/storageProfile.osDisk.osType' | Must -Not -BeLike 'Windows*' -IfPresent
}
AllOf {
Field 'Microsoft.Compute/imageSKU' | Must -Exist
AnyOf {
Field 'Microsoft.Compute/imageSKU' | Must -BeLike '2008*'
Field 'Microsoft.Compute/imageOffer' | Must -BeLike 'SQL2008*'
}
}
}
}
}
}
Require 'type and imageOffer are as required' {
AnyOf {
Field type | Must -Not -Be 'Microsoft.HybridCompute/machines' -IfPresent
Field 'Microsoft.HybridCompute/imageOffer' | Must -Not -BeLike 'windows*' -IfPresent
}
}
}
DeployIfNotExists 'Microsoft.GuestConfiguration/guestConfigurationAssignments' -Role 'Contributor' -Name 'AzureBaseline_WindowsComponents' {
Require 'parameterHash is as required' {
Field parameterHash | Must -Be (Arm '[base64(concat(''Send file samples when further analysis is required;ExpectedValue'', ''='', parameters(''SendFileSamplesWhenFurtherAnalysisIsRequired''), '','', ''Allow indexing of encrypted files;ExpectedValue'', ''='', parameters(''AllowIndexingOfEncryptedFiles''), '','', ''Allow Telemetry;ExpectedValue'', ''='', parameters(''AllowTelemetry''), '','', ''Allow unencrypted traffic;ExpectedValue'', ''='', parameters(''AllowUnencryptedTraffic''), '','', ''Always install with elevated privileges;ExpectedValue'', ''='', parameters(''AlwaysInstallWithElevatedPrivileges''), '','', ''Always prompt for password upon connection;ExpectedValue'', ''='', parameters(''AlwaysPromptForPasswordUponConnection''), '','', ''Application: Specify the maximum log file size (KB);ExpectedValue'', ''='', parameters(''ApplicationSpecifyTheMaximumLogFileSizeKB''), '','', ''Automatically send memory dumps for OS-generated error reports;ExpectedValue'', ''='', parameters(''AutomaticallySendMemoryDumpsForOSgeneratedErrorReports''), '','', ''Configure Default consent;ExpectedValue'', ''='', parameters(''ConfigureDefaultConsent''), '','', ''Configure Windows SmartScreen;ExpectedValue'', ''='', parameters(''ConfigureWindowsSmartScreen''), '','', ''Disallow Digest authentication;ExpectedValue'', ''='', parameters(''DisallowDigestAuthentication''), '','', ''Disallow WinRM from storing RunAs credentials;ExpectedValue'', ''='', parameters(''DisallowWinRMFromStoringRunAsCredentials''), '','', ''Do not allow passwords to be saved;ExpectedValue'', ''='', parameters(''DoNotAllowPasswordsToBeSaved''), '','', ''Security: Specify the maximum log file size (KB);ExpectedValue'', ''='', parameters(''SecuritySpecifyTheMaximumLogFileSizeKB''), '','', ''Set client connection encryption level;ExpectedValue'', ''='', parameters(''SetClientConnectionEncryptionLevel''), '','', ''Set the default behavior for AutoRun;ExpectedValue'', ''='', parameters(''SetTheDefaultBehaviorForAutoRun''), '','', ''Setup: Specify the maximum log file size (KB);ExpectedValue'', ''='', parameters(''SetupSpecifyTheMaximumLogFileSizeKB''), '','', ''System: Specify the maximum log file size (KB);ExpectedValue'', ''='', parameters(''SystemSpecifyTheMaximumLogFileSizeKB''), '','', ''Turn off Data Execution Prevention for Explorer;ExpectedValue'', ''='', parameters(''TurnOffDataExecutionPreventionForExplorer''), '','', ''Specify the interval to check for definition updates;ExpectedValue'', ''='', parameters(''SpecifyTheIntervalToCheckForDefinitionUpdates'')))]')
}
Deployment -TemplateFile './templates/7040a231-fb65-4412-8c0a-b365f4866c24.json' -Parameters ([ordered]@{
vmName = (Arm '[field(''name'')]')
location = (Arm '[field(''location'')]')
type = (Arm '[field(''type'')]')
configurationName = 'AzureBaseline_WindowsComponents'
SendFileSamplesWhenFurtherAnalysisIsRequired = (Param SendFileSamplesWhenFurtherAnalysisIsRequired)
AllowIndexingOfEncryptedFiles = (Param AllowIndexingOfEncryptedFiles)
AllowTelemetry = (Param AllowTelemetry)
AllowUnencryptedTraffic = (Param AllowUnencryptedTraffic)
AlwaysInstallWithElevatedPrivileges = (Param AlwaysInstallWithElevatedPrivileges)
AlwaysPromptForPasswordUponConnection = (Param AlwaysPromptForPasswordUponConnection)
ApplicationSpecifyTheMaximumLogFileSizeKB = (Param ApplicationSpecifyTheMaximumLogFileSizeKB)
AutomaticallySendMemoryDumpsForOSgeneratedErrorReports = (Param AutomaticallySendMemoryDumpsForOSgeneratedErrorReports)
ConfigureDefaultConsent = (Param ConfigureDefaultConsent)
ConfigureWindowsSmartScreen = (Param ConfigureWindowsSmartScreen)
DisallowDigestAuthentication = (Param DisallowDigestAuthentication)
DisallowWinRMFromStoringRunAsCredentials = (Param DisallowWinRMFromStoringRunAsCredentials)
DoNotAllowPasswordsToBeSaved = (Param DoNotAllowPasswordsToBeSaved)
SecuritySpecifyTheMaximumLogFileSizeKB = (Param SecuritySpecifyTheMaximumLogFileSizeKB)
SetClientConnectionEncryptionLevel = (Param SetClientConnectionEncryptionLevel)
SetTheDefaultBehaviorForAutoRun = (Param SetTheDefaultBehaviorForAutoRun)
SetupSpecifyTheMaximumLogFileSizeKB = (Param SetupSpecifyTheMaximumLogFileSizeKB)
SystemSpecifyTheMaximumLogFileSizeKB = (Param SystemSpecifyTheMaximumLogFileSizeKB)
TurnOffDataExecutionPreventionForExplorer = (Param TurnOffDataExecutionPreventionForExplorer)
SpecifyTheIntervalToCheckForDefinitionUpdates = (Param SpecifyTheIntervalToCheckForDefinitionUpdates)
})
}
}Its deployment templates are written beside it:
templates/7040a231-fb65-4412-8c0a-b365f4866c24.json
Source: built-in-policies/policyDefinitions/Guest Configuration/WindowsComponents_DINE.json in Azure/azure-policy, under the MIT licence.
Bylaw