PowerShellでマルウェア対策(antimalware for Azure)を有効にする方法

シェアする

  • このエントリーをはてなブックマークに追加

無償で使用できるMicrosoft Antimalware for Azure を仮想マシン作成時に有効化する手順について紹介します。

※Antimalware for Azureについては、以前紹介したこちらの記事をご確認ください。

PowerShellによるAntimalware導入手順

今回は、Azure上の仮想マシンWindowsServer2008(マシン名:testvm)へPowerShellを用いてAntimalwareを導入します。

1.現在の仮想マシンの状況確認

拡張機能にAntimalwareが存在しないことを確認します。黒字太字部分。

PS C:\WINDOWS\system32> Get-AzureRMVM -ResourceGroupName “testrg” -Name “testvm”

ResourceGroupName : testrg
Id : xxxx
VmId : xxxx
Name : testvm
Type : Microsoft.Compute/virtualMachines
Location : japaneast
Tags : {}
DiagnosticsProfile : {BootDiagnostics}
Extensions : {enablevmaccess, MicrosoftMonitoringAgent} 
HardwareProfile : {VmSize}
NetworkProfile : {NetworkInterfaces}
OSProfile : {ComputerName, AdminUsername, WindowsConfiguration, Secrets}
ProvisioningState : Succeeded
StorageProfile : {ImageReference, OsDisk, DataDisks}
NetworkInterfaceIDs : xxxx

PS C:\WINDOWS\system32>

2.インストール

正常にインストールが完了したことを確認します。

PS C:\WINDOWS\system32> Set-AzureRmVMExtension -ResourceGroupName “testrg” -VMName “testvm” -Name IaaSAntimalware -Publisher Microsoft.Azure.Security -ExtensionType IaaSAntimalware -TypeHandlerVersion 1.3 -SettingString ‘{“AntimalwareEnabled”:true}’ -Location japaneast

RequestId   IsSuccessStatusCode  StatusCode   ReasonPhrase
———   ——————-     ———-    ————
True         OK       OK

PS C:\WINDOWS\system32>

3.有効になったことを確認

拡張機能にIaaSAntimalwareが存在することを確認します。

PS C:\WINDOWS\system32> Get-AzureRMVM -ResourceGroupName “testrg” -Name “testvm”

ResourceGroupName : testrg
Id : xxxx
VmId : xxxx
Name : testvm
Type : Microsoft.Compute/virtualMachines
Location : japaneast
Tags : {}
DiagnosticsProfile : {BootDiagnostics}
Extensions : {enablevmaccess,IaaSAntimalware, MicrosoftMonitoringAgent} 
HardwareProfile : {VmSize}
NetworkProfile : {NetworkInterfaces}
OSProfile : {ComputerName, AdminUsername, WindowsConfiguration, Secrets}
ProvisioningState : Succeeded
StorageProfile : {ImageReference, OsDisk, DataDisks}
NetworkInterfaceIDs : xxxx

PS C:\WINDOWS\system32>

4.リアルタイムスキャン設定

正常に設定変更が完了したことを確認します。

PS C:\WINDOWS\system32>$testconfig = @{
“AntimalwareEnabled” = “true”;
“RealtimeProtectionEnabled” = “true”;
“Exclusions” = @{
“Extensions” = “.exe”;
“Paths”= “C:\TEMP”;
“Processes”= “exp.exe”
};
“ScheduledScanSettings” = @{
‘isEnabled’ = “true”;
“day” = “7”;
“time”= “120”;
“scanType” = “Quick”
}
}PS C:\WINDOWS\system32> Set-AzureRmVMExtension -ResourceGroupName “testrg” -VMName “testvm” -Name IaaSAntimalware -Publisher Microsoft.Azure.Security -ExtensionType IaaSAntimalware -TypeHandlerVersion 1.3 -Settings $testconfig -Location japaneastRequestId   IsSuccessStatusCode  StatusCode   ReasonPhrase
———   ——————-     ———-    ————
True         OK       OK

PS C:\WINDOWS\system32>

スポンサーリンク
スポンサーリンク

シェアする

  • このエントリーをはてなブックマークに追加

フォローする