Defender for Cloudとのエンドポイント統合のためにエージェントベースのDefenderによって提供される次世代マルウェア対策保護に加えて、Defender for Servers Plan 2 では、エージェントレス スキャン機能の一部としてエージェントレスマルウェアスキャンが提供されます。
この記事では、エージェントレス マルウェア スキャンが期待どおりに動作していることを確認するテスト アラートを作成する方法について説明します。
前提条件
- サーバー プラン 2 のDefenderがオンになっています。
- プランでエージェントレス スキャンが有効になっています。
Linux 用のテスト ファイルを作成する
以下の手順でLinuxのVM上でテストファイルを作成し、エージェントレスマルウェアスキャンアラートを発動してください。
VM でターミナル ウィンドウを開きます。
以下のスクリプトを実行して、アンチウイルステスト文字列を含むテストファイルを作成・検証します。
# test string TEST_STRING='$$89-barbados-dublin-damascus-notice-pulled-natural-31$$' # File to be created FILE_PATH="/tmp/virus_test_file.txt" # Write the test string to the file echo -n $TEST_STRING > $FILE_PATH # Check if the file was created and contains the correct string if [ -f "$FILE_PATH" ]; then if grep -Fq "$TEST_STRING" "$FILE_PATH"; then echo "Virus test file created and validated successfully." else echo "Virus test file does not contain the correct string." fi else echo "Failed to create virus test file." fi
アラート MDC_Test_File malware was detected (Agentless)は、Defender for Cloudアラート ページと Defender XDR ポータルに 24 時間以内に表示されます。
テキスト ドキュメントを使用してWindowsのテスト ファイルを作成する
以下の手順を使って、エージェントレスマルウェアスキャンのテストアラートをトリガーするWindowsテキストファイルを作成します。
VM にテキスト ファイルを作成します。
テキスト
$$89-barbados-dublin-damascus-notice-pulled-natural-31$$をテキスト ファイルに貼り付けます。 テキスト ファイルに余分なスペースや行がないことを確認します。ファイルを保存します。
ファイルを開くと、貼り付けられたテスト文字列が含まれているか確認してください。
アラート MDC_Test_File malware was detected (Agentless)は、Defender for Cloudアラート ページと Defender XDR ポータルに 24 時間以内に表示されます。
PowerShell を使用してWindows用のテスト ファイルを作成する
以下のPowerShell手順を使ってWindowsテストファイルを作成し、マルウェアスキャンテストアラートを生成してください。
VM で PowerShell を開きます。
次のスクリプトを実行します。
# Virus test string
$TEST_STRING = '$$89-barbados-dublin-damascus-notice-pulled-natural-31$$'
# File to be created
$FILE_PATH = "C:\temp\virus_test_file.txt"
# Create "temp" directory if it does not exist
$DIR_PATH = "C:\temp"
if (!(Test-Path -Path $DIR_PATH)) {
New-Item -ItemType Directory -Path $DIR_PATH
}
# Write the test string to the file without a trailing newline
[IO.File]::WriteAllText($FILE_PATH, $TEST_STRING)
# Check if the file was created and contains the correct string
if (Test-Path -Path $FILE_PATH) {
$content = [IO.File]::ReadAllText($FILE_PATH)
if ($content -eq $TEST_STRING) {
Write-Host "Test file created and validated successfully."
} else {
Write-Host "Test file does not contain the correct string."
}
} else {
Write-Host "Failed to create test file."
}
アラート MDC_Test_File malware was detected (Agentless)は、Defender for Cloudアラート ページと Defender XDR ポータルに 24 時間以内に表示されます。