このページでは、Virtual Machine Threat Detection を設定して使用し、Amazon Elastic Compute Cloud(EC2)VM の永続ディスクでマルウェアをスキャンする方法について説明します。
AWS 用の VM Threat Detection を有効にするには、AWS プラットフォームで AWS IAM ロールを作成し、Security Command Center で AWS 用 VM Threat Detection を有効にして、AWS に CloudFormation テンプレートをデプロイする必要があります。
始める前に
AWS で使用する VM Threat Detection を有効にするには、特定の IAM 権限が必要です。また、Security Command Center が AWS に接続されている必要があります。
ロールと権限
AWS 用 VM Threat Detection の設定を完了するには、Google Cloud と AWS の両方で必要な権限を持つロールが付与されている必要があります。
Google Cloud ロール
Make sure that you have the following role or roles on the organization: Security Center Admin Editor (roles/securitycenter.adminEditor)
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the organization.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
[IAM] に移動 - 組織を選択します。
- [ アクセスを許可] をクリックします。
-
[新しいプリンシパル] フィールドに、ユーザー ID を入力します。 これは通常、Google アカウントのメールアドレスです。
- [ロールを選択] リストでロールを選択します。
- 追加のロールを付与するには、 [別のロールを追加] をクリックして各ロールを追加します。
- [保存] をクリックします。
AWS のロール
Amazon Web Services(AWS)では、スキャンを有効にするために必要な AWS アカウントを AWS 管理ユーザーが作成する必要があります。このロールは、AWS に CloudFormation テンプレートをインストールするときに割り当てます。
AWS で VM Threat Detection のロールを作成するには、AWS サービス用のロールを作成する(コンソール)の手順に沿って操作します。
次の点にご注意ください。
- [サービスまたはユースケース] で [lambda] を選択します。
- 次の権限ポリシーを追加します。
AmazonSSMManagedInstanceCoreAWSLambdaBasicExecutionRoleAWSLambdaVPCAccessExecutionRole
- AWS ロールの権限ポリシーを作成します。
- AWS と VM Threat Detection の脆弱性評価のロールポリシーの手順に沿って、権限ポリシーを変更してコピーします。
- AWS の JSON エディタにポリシーを入力します。
信頼関係の場合は、既存のステートメント配列に次の JSON エントリを追加します。
{ "Version": "2012-10-17", "Statement": [ { "Sid": "Statement1 or replace with a unique statementId", "Effect": "Allow", "Principal": { "Service": "cloudformation.amazonaws.com" }, "Action": "sts:AssumeRole" } ] }
Security Command Center が AWS に接続されていることを確認する
VM Threat Detection は、AWS コネクタの作成時に Cloud Asset Inventory が維持する AWS リソースのインベントリにアクセスする必要があります。
接続がまだ確立されていない場合は、AWS 用の VM Threat Detection を有効にするときに、接続を設定する必要があります。
接続を設定するには、AWS コネクタを作成します。
Security Command Center で AWS 用 VM Threat Detection を有効にする
AWS 用 VM Threat Detection は、 Google Cloud で組織レベルで有効にする必要があります。
コンソール
Google Cloud コンソールで、Virtual Machine Threat Detection の [サービスの有効化] ページに移動します。
組織を選択します。
[Amazon Web Services] タブをクリックします。
[サービスの有効化] セクションの [ステータス] フィールドで、[有効] を選択します。
[AWS コネクタ] セクションで、ステータスに「AWS コネクタが追加されている」と表示されていることを確認します。
ステータスに「AWS コネクタが追加されていない」と表示された場合は、[AWS コネクタを追加] をクリックします。次のステップに進む前に、AWS に接続して構成データとリソースデータの収集を行うの手順を完了します。
gcloud
gcloud scc manage services update コマンドは、Security Command Center のサービスまたはモジュールの状態を更新します。
後述のコマンドデータを使用する前に、次のように置き換えます。
ORGANIZATION_ID: 組織の一意の数値識別子-
NEW_STATE: AWS 用 VM Threat Detection を有効にする場合はENABLED、AWS 用 VM Threat Detection を無効にする場合はDISABLED
gcloud scc manage services update コマンドを実行します。
Linux、macOS、Cloud Shell
gcloud scc manage services update vm-threat-detection-aws \ --organization=ORGANIZATION_ID \ --enablement-state=NEW_STATE
Windows(PowerShell)
gcloud scc manage services update vm-threat-detection-aws ` --organization=ORGANIZATION_ID ` --enablement-state=NEW_STATE
Windows(cmd.exe)
gcloud scc manage services update vm-threat-detection-aws ^ --organization=ORGANIZATION_ID ^ --enablement-state=NEW_STATE
次のようなレスポンスが返されます。
effectiveEnablementState: ENABLED intendedEnablementState: ENABLED modules: MALWARE_DISK_SCAN_YARA_AWS: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED name: organizations/1234567890/locations/global/securityCenterServices/vm-threat-detection-aws updateTime: '2025-03-21T18:45:52.033110465Z'
REST
Security Command Center Management API の organizations.locations.securityCenterServices.patch メソッドは、Security Command Center サービスまたはモジュールの状態を更新します。
リクエストのデータを使用する前に、次のように置き換えます。
-
QUOTA_PROJECT: 課金と割り当てのトラッキングに使用するプロジェクト ID ORGANIZATION_ID: 組織の一意の数値識別子-
NEW_STATE: AWS 用 VM Threat Detection を有効にする場合はENABLED、AWS 用 VM Threat Detection を無効にする場合はDISABLED
HTTP メソッドと URL:
PATCH https://securitycentermanagement.googleapis.com/v1/organizations/ORGANIZATION_ID/locations/global/securityCenterServices/vm-threat-detection-aws?updateMask=intendedEnablementState
リクエストの本文(JSON):
{ "intendedEnablementState": "NEW_STATE" } リクエストを送信するには、次のいずれかのオプションを展開します。
次のような JSON レスポンスが返されます。
{ "name": "organizations/1234567890/locations/global/securityCenterServices/vm-threat-detection-aws", "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED", "modules": { "MALWARE_DISK_SCAN_YARA_AWS": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" } }, "updateTime": "2025-03-21T18:45:52.033110465Z" } AWS の脆弱性評価サービスをすでに有効にしており、その機能の一部として CloudFormation テンプレートをデプロイしている場合は、AWS 用 VM Threat Detection の設定は完了しています。
それ以外の場合は、6 時間待ってから、次のタスク(CloudFormation テンプレートのダウンロード)を実行します。
CloudFormation テンプレートをダウンロードする
このタスクは、AWS で VM Threat Detection を有効にする少なくとも 6 時間後に実行します。
Google Cloud コンソールで、Virtual Machine Threat Detection の [サービスの有効化] ページに移動します。
組織を選択します。
[Amazon Web Services] タブをクリックします。
[CloudFormation テンプレートのデプロイ] セクションで、[CloudFormation テンプレートをダウンロード] をクリックします。JSON テンプレートがワークステーションにダウンロードされます。スキャンする必要のある各 AWS アカウントにテンプレートをデプロイする必要があります。
AWS CloudFormation テンプレートをデプロイする
AWS コネクタを作成してから少なくとも 6 時間経過したら、CloudFormation テンプレートをデプロイします。
CloudFormation テンプレートをデプロイする方法の詳細については、AWS ドキュメントの CloudFormation コンソールからスタックを作成するをご覧ください。
次の点に注意してください。 * CloudFormation テンプレートをアップロードしたら、一意のスタック名を入力します。テンプレート内の他のパラメータは変更しないでください。* スタック オプションの [Permissions] で、前に作成した AWS ロールを選択します。* CloudFormation テンプレートをデプロイした後、スタックの実行が開始されるまでに数分かかります。
デプロイのステータスが AWS コンソールに表示されます。CloudFormation テンプレートのデプロイが失敗した場合は、トラブルシューティングをご覧ください。
スキャンの開始後に脅威が検出されると、対応する検出結果が生成され、 Google Cloud コンソールの Security Command Center の [検出結果] ページに表示されます。詳細については、Google Cloud コンソールで検出結果を確認するをご覧ください。
モジュールを管理する
このセクションでは、モジュールを有効または無効にする方法と、モジュールの設定を表示する方法について説明します。
モジュールを有効または無効にする
モジュールを有効または無効にした後、変更が反映されるまでに 1 時間ほどかかることがあります。
すべての VM Threat Detection の脅威の検出結果と、それらを生成するモジュールについては、脅威の検出結果をご覧ください。
コンソール
Google Cloud コンソールでは、組織レベルで VM Threat Detection モジュールを有効または無効にできます。
Google Cloud コンソールで、[モジュール] ページに移動します。
組織を選択します。
[モジュール] タブの [ステータス] 列で、有効または無効にするモジュールの現在のステータスを選択し、次のいずれかを選択します。
- 有効: モジュールを有効にします。
- 無効: モジュールを無効にします。
gcloud
gcloud scc manage services update コマンドは、Security Command Center のサービスまたはモジュールの状態を更新します。
後述のコマンドデータを使用する前に、次のように置き換えます。
ORGANIZATION_ID: 組織の一意の数値識別子-
MODULE_NAME: 有効または無効にするモジュールの名前(例:MALWARE_DISK_SCAN_YARA_AWS)。有効な値は、AWS をサポートする脅威の検出結果のモジュールのみです。 -
NEW_STATE: モジュールを有効にする場合はENABLED、モジュールを無効にする場合はDISABLED。
次の内容を request.json という名前のファイルに保存します。
{ "MODULE_NAME": { "intendedEnablementState": "NEW_STATE" } }
gcloud scc manage services update コマンドを実行します。
Linux、macOS、Cloud Shell
gcloud scc manage services update vm-threat-detection-aws \ --organization=ORGANIZATION_ID \ --enablement-state=ENABLED \ --module-config-file=request.json
Windows(PowerShell)
gcloud scc manage services update vm-threat-detection-aws ` --organization=ORGANIZATION_ID ` --enablement-state=ENABLED \ --module-config-file=request.json
Windows(cmd.exe)
gcloud scc manage services update vm-threat-detection-aws ^ --organization=ORGANIZATION_ID ^ --enablement-state=ENABLED \ --module-config-file=request.json
次のようなレスポンスが返されます。
effectiveEnablementState: ENABLED intendedEnablementState: ENABLED modules: MALWARE_DISK_SCAN_YARA_AWS: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED name: organizations/1234567890/locations/global/securityCenterServices/vm-threat-detection-aws updateTime: '2025-03-21T18:45:52.033110465Z'
REST
Security Command Center Management API の organizations.locations.securityCenterServices.patch メソッドは、Security Command Center サービスまたはモジュールの状態を更新します。
リクエストのデータを使用する前に、次のように置き換えます。
-
QUOTA_PROJECT: 課金と割り当てのトラッキングに使用するプロジェクト ID ORGANIZATION_ID: 組織の一意の数値識別子-
MODULE_NAME: 有効または無効にするモジュールの名前(例:MALWARE_DISK_SCAN_YARA_AWS)。有効な値は、AWS をサポートする脅威の検出結果のモジュールのみです。 -
NEW_STATE: モジュールを有効にする場合はENABLED、モジュールを無効にする場合はDISABLED。
HTTP メソッドと URL:
PATCH https://securitycentermanagement.googleapis.com/v1/organizations/ORGANIZATION_ID/locations/global/securityCenterServices/vm-threat-detection-aws?updateMask=modules
リクエストの本文(JSON):
{ "modules": { "MODULE_NAME": { "intendedEnablementState": "NEW_STATE" } } } リクエストを送信するには、次のいずれかのオプションを展開します。
次のような JSON レスポンスが返されます。
{ "name": "organizations/1234567890/locations/global/securityCenterServices/vm-threat-detection-aws", "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED", "modules": { "MALWARE_DISK_SCAN_YARA_AWS": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" } }, "updateTime": "2025-03-21T18:45:52.033110465Z" } AWS 用 VM Threat Detection モジュールの設定を表示する
すべての VM Threat Detection の脅威の検出結果と、それらを生成するモジュールについては、脅威の検出結果をご覧ください。
コンソール
Google Cloud コンソールでは、組織レベルで VM Threat Detection モジュールの設定を表示できます。
Google Cloud コンソールで、[モジュール] ページに移動します。
組織を選択します。
gcloud
gcloud scc manage services describe コマンドは、Security Command Center サービスまたはモジュールの状態を取得します。
後述のコマンドデータを使用する前に、次のように置き換えます。
-
ORGANIZATION_ID: 取得する組織の数値識別子
gcloud scc manage services describe コマンドを実行します。
Linux、macOS、Cloud Shell
gcloud scc manage services describe vm-threat-detection-aws \ --organization=ORGANIZATION_ID
Windows(PowerShell)
gcloud scc manage services describe vm-threat-detection-aws ` --organization=ORGANIZATION_ID
Windows(cmd.exe)
gcloud scc manage services describe vm-threat-detection-aws ^ --organization=ORGANIZATION_ID
次のようなレスポンスが返されます。
effectiveEnablementState: ENABLED intendedEnablementState: ENABLED modules: MALWARE_DISK_SCAN_YARA_AWS: effectiveEnablementState: ENABLED intendedEnablementState: ENABLED name: organizations/1234567890/locations/global/securityCenterServices/vm-threat-detection-aws updateTime: '2025-03-21T18:45:52.033110465Z'
REST
Security Command Center Management API の organizations.locations.securityCenterServices.get メソッドは、Security Command Center サービスまたはモジュールの状態を取得します。
リクエストのデータを使用する前に、次のように置き換えます。
-
QUOTA_PROJECT: 課金と割り当てのトラッキングに使用するプロジェクト ID -
ORGANIZATION_ID: 取得する組織の数値識別子
HTTP メソッドと URL:
GET https://securitycentermanagement.googleapis.com/v1/organizations/ORGANIZATION_ID/locations/global/securityCenterServices/vm-threat-detection-aws
リクエストを送信するには、次のいずれかのオプションを展開します。
次のような JSON レスポンスが返されます。
{ "name": "organizations/1234567890/locations/global/securityCenterServices/vm-threat-detection-aws", "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED", "modules": { "MALWARE_DISK_SCAN_YARA_AWS": { "intendedEnablementState": "ENABLED", "effectiveEnablementState": "ENABLED" } }, "updateTime": "2025-03-21T18:45:52.033110465Z" } トラブルシューティング
VM Threat Detection サービスを有効にしてもスキャンが実行されない場合は、次の点を確認してください。
- AWS コネクタが正しく設定されていることを確認します。
- CloudFormation テンプレート スタックが完全にデプロイされていることを確認します。AWS アカウントでのステータスは
CREATION_COMPLETEになります。
次のステップ
- VM Threat Detection の使用方法を学習する。
- Compute Engine の脅威の検出結果に対応する方法を確認する。
- 脅威の検出結果のインデックスを参照する。