-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathoption-50-antiMalware.tf
53 lines (47 loc) · 1.79 KB
/
option-50-antiMalware.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
Example:
antimalware" {
RealtimeProtectionEnabled = "true"
ScheduledScanSettingsIsEnabled = "false"
ScheduledScanSettingsDay = "7"
ScheduledScanSettingsTime = "120"
ScheduledScanSettingsScanType = "Quick"
ExclusionsExtensions = ""
ExclusionsPaths = ""
ExclusionsProcesses = ""
}
*/
variable "antimalware" {
description = "Should the VM run antimalware"
default = null
}
resource "azurerm_virtual_machine_extension" "IaaSAntimalware" {
count = var.antimalware == null ? 0 : 1
name = "IaaSAntimalware"
depends_on = [azurerm_virtual_machine_extension.MicrosoftMonitoringAgent]
location = var.location
resource_group_name = var.resource_group_name
virtual_machine_name = azurerm_virtual_machine.VM.name
publisher = "Microsoft.Azure.Security"
type = "IaaSAntimalware"
type_handler_version = "1.5"
auto_upgrade_minor_version = true
settings = <<SETTINGS
{
"AntimalwareEnabled": true,
"RealtimeProtectionEnabled": "${var.antimalware.RealtimeProtectionEnabled}",
"ScheduledScanSettings": {
"isEnabled": "${var.antimalware.ScheduledScanSettingsIsEnabled}",
"day": "${var.antimalware.ScheduledScanSettingsDay}",
"time": "${var.antimalware.ScheduledScanSettingsTime}",
"scanType": "${var.antimalware.ScheduledScanSettingsScanType}"
},
"Exclusions": {
"Extensions": "${var.antimalware.ExclusionsExtensions}",
"Paths": "${var.antimalware.ExclusionsPaths}",
"Processes": "${var.antimalware.ExclusionsProcesses}"
}
}
SETTINGS
tags = var.tags
}