LoginSignup
2
3

More than 5 years have passed since last update.

Azure VM拡張機能のAntimalwareスケジュールスキャン設定を変更する

Last updated at Posted at 2018-10-05

Azure Virtual Machinesの拡張機能でAntimalwareを有効にしたあとにスケジュールスキャン設定を変更する方法です。
OS上の実体はWindows Defenderが動作しています。

拡張機能インストール

  • 拡張機能から「Microsoft Antimalware」を選択します。ここはVM作成と同時にインストールしてもよいです。
    image.png

  • 色々設定入れれますが、とりあえずここはデフォルトのままでいきます。
    image.png

  • 拡張機能がインストールされればOKです。
    image.png

現在の設定を確認する

$ az vm extension show --name "IaaSAntimalware" --resource-group [Your Resource Group] --vm-name [Your VM Name]
  • 抜粋してますが、結果が以下のようにJSONで返ってきます。
・・・
  "settings": {
    "AntimalwareEnabled": true,
    "Exclusions": {
      "Extensions": "",
      "Paths": "",
      "Processes": ""
    },
    "RealtimeProtectionEnabled": "true",
    "ScheduledScanSettings": {
      "day": "7",
      "isEnabled": "false",
      "scanType": "Quick",
      "time": "120"
    }
・・・
  • ScheduledScanSettingsのisEnabledがfalseになっているので、スケジュールスキャンが無効になっていることが分かります。

設定を変更する

今回は「クイックスキャンを毎日AM4:00に実行する」という定義に変えてみます。

  • 設定ファイルをJSONで作成します。
$ cd clouddrive
$ mkdir antimalware
$ cd antimalware
$ vi settings.json
  • 以下の設定を記述します。
{
        "AntimalwareEnabled": true,
        "Exclusions": {
                "Extensions": "",
                "Paths": "",
                "Processes": ""
        },
        "RealtimeProtectionEnabled": "true",
        "ScheduledScanSettings": {
                "day": "0",
                "isEnabled": "true",
                "scanType": "Quick",
                "time": "240"
        }
}

dayの数値は、0~7までで、毎日/日曜日~土曜日の順に数値で指定します。
timeは0時を起点に何分プラスするかで計算します。240だとAM4:00になります。

  • 作成した設定ファイルを指定してコマンドを実行します。
$ az vm extension set --name "IaaSAntimalware" --publisher "Microsoft.Azure.Security" --resource-group [Your Resource Group] --vm-name [Your VM Name] --settings settings.json

補足:タスクスケジューラーにスキャンタスクが存在しない?

Windowsタスクスケジューラーに「Windows Defender Scheduled Scan」タスクが存在しない場合は、「IaaSAntimalware拡張機能が有効になっているが、スケジュールスキャンが無効になっている」場合が考えられるので、拡張機能の設定を確認してみてください。
image.png

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3