Security Command Center の検出結果をミュートする

このページでは、検出結果をミュートして、Security Command Center で受け取る検出結果の数を減らす方法について説明します。

検出結果をミュートすると、その検出結果はGoogle Cloud コンソールの検出結果のデフォルト ビューに表示されなくなります。検出結果は手動またはプログラムでミュートできます。また、指定した条件に基づいて既存の検出結果と将来の検出結果を自動的にミュートするフィルタを作成できます。

Security Command Center の検出サービスは、 Google Cloud デプロイメントに関する広範なセキュリティ評価を提供しますが、組織やプロジェクトに適していない検出結果や関連性の低い検出結果が含まれている場合があります。大量の検出結果があると、セキュリティ アナリストが最も重要なリスクを迅速に特定し、修正することも難しくなります。検出結果をミュートすると、分離されているアセットや許容されるビジネス パラメータに含まれるアセットのセキュリティ検出結果を確認し、対応する時間を省くことができます。

検出結果のミュートには、検出機能の無効化に比べていくつかの利点があります。

  • カスタム フィルタを作成して、ミュートする検出結果を微調整できます。
  • ミュートルールを使用して、検出結果を一時的または無期限にミュートできます。
  • 検出結果をミュートしても、基盤となるアセットのスキャンが停止することはありません。検出結果は引き続き生成されますが、表示の設定を行うまで非表示のままになります。

権限

検出結果をミュートするには、組織フォルダプロジェクトで次のいずれかの Identity and Access Management(IAM)ロールが必要です。

  • ミュートルールの表示:
    • セキュリティ センター管理閲覧者roles/securitycenter.adminViewer
    • セキュリティ センター設定閲覧者roles/securitycenter.settingsViewer
    • セキュリティ センターのミュート構成閲覧者roles/securitycenter.muteConfigsViewer
  • ミュートルールの表示、作成、更新、削除:
    • セキュリティ センター管理者roles/securitycenter.admin
    • セキュリティ センター管理編集者roles/securitycenter.adminEditor
    • セキュリティ センター設定編集者roles/securitycenter.settingsEditor
    • セキュリティ センターのミュート構成編集者roles/securitycenter.muteConfigsEditor
  • 検出結果の手動ミュート:
    • セキュリティ センター検出編集者roles/securitycenter.findingsEditor

次の権限の一部またはすべてを含むカスタムロールを作成して付与することもできます。

  • ミュートルールの読み取り権限
    • securitycenter.muteconfigs.get
    • securitycenter.muteconfigs.list
  • ミュートルールの書き込み権限
    • securitycenter.muteconfigs.create
    • securitycenter.muteconfigs.update
    • securitycenter.muteconfigs.delete
  • 検出結果の書き込み権限
    • securitycenter.findings.setMute
    • securitycenter.findings.bulkMuteUpdate

検出結果のミュートは、組織、フォルダ、プロジェクト レベルで付与されたロールに従います。特定のフォルダやプロジェクトの検出結果をミュートし、他のユーザーに付与する権限に基づいて検出結果のミュートを制限できます。たとえば、単一のプロジェクトにアクセスできる場合、そのプロジェクトの結果のみをミュートできます。フォルダへのアクセス権がある場合、そのフォルダ内の任意のサブフォルダまたはプロジェクトを対象とする検出結果をミュートできます。

Security Command Center のロールの詳細については、アクセス制御をご覧ください。

ミュートルールの作成と管理

ミュートルールは、指定した条件に基づいて既存および今後の検出結果を自動的にミュートするフィルタを使用する Security Command Center の構成です。フィルタは、静的または動的ミュートルールを使用して作成できます。

静的ミュートルールは、今後の検出結果を無期限にミュートします。動的ミュートルールは、指定した日付まで一時的に、または検出結果が構成と一致しなくなるまで無期限に、将来および既存の検出結果をミュートします。

ミュートルールのタイプ

Security Command Center は、静的ミュートルールと動的ミュートルールの構成をサポートしています。静的ミュートルールと動的ミュートルールは同時に使用できますが、おすすめしません。同じ検出結果に適用されると、静的ミュートルールは動的ミュートルールをオーバーライドします。その結果、動的ミュートルールが意図したとおりに機能せず、検出結果の管理時に混乱が生じる可能性があります。そのため、1 つのミュートルールのみを使用することをおすすめします。

静的ミュートルールをすでに使用している場合を除き、柔軟性の高い動的ミュートルールのみを使用することをおすすめします。

次の表に、2 つのミュートルール タイプの概要を比較して示します。詳細については、静的ミュートルール動的ミュートルールをご覧ください。

静的ミュートルール 動的ミュートルール
検出結果に対して無期限に対処します。 検出結果に対して、有効期限付きで一時的に、または有効期限が設定されていない場合は無期限に対処できます。
既存の検出結果には適用されません。 既存の検出結果と新しい検出結果に適用されます。
動的ミュートルールよりも優先されます。 優先度が低く、両方のタイプが検出結果に適用される場合は、静的ミュートルールによってオーバーライドされます。

静的ミュートルール

  • 静的ミュートルールは無期限に対処します。検出結果が静的ミュート構成と一致すると、手動で変更するまで、Security Command Center は検出結果の mute プロパティを自動的に MUTED に設定します。
  • Google Cloud コンソールを使用して作成された場合を除き、静的ミュートルールは、既存の検出結果には影響しません。この場合、ルールは既存の検出結果を遡及的にミュートします。それ以外の場合は、ルールが定義された後に新しく作成または更新された検出結果にのみ適用されます。 Google Cloud コンソールを使用せずに、類似した既存の検出結果もミュートする場合は、同じフィルタを使用して検出結果を一括でミュートします。
  • 静的ミュートルールは動的ミュートルールよりも優先されます。したがって、定義済みの静的ミュートルールに一致する新しい検出結果は、定義済みの動的ミュートルールに一致する場合でも、ミュートと見なされます。

動的ミュートルール

  • 動的ミュートルールは、検索結果に対して、有効期限付きで一時的に、または有効期限が設定されていない場合は無期限に対処できます。既存または新しく作成された検出結果が動的ミュート構成と一致すると、Security Command Center は、指定された有効期限まで、または検出結果または構成自体に変更があるまで、検出結果の mute プロパティを自動的に MUTED に設定します。動的ミュートルールが期限切れになると、Security Command Center は検出結果からルールを削除します。検出結果が他の動的ミュートルールと一致しない場合、mute プロパティは自動的に UNDEFINED にリセットされます。
  • 動的ミュートルールは、構成に一致する既存の検出結果と、新しく作成または更新された検出結果に自動的に適用されます。
  • 動的ミュートルールは優先度が低く、両方のタイプが検出結果に適用される場合は、静的ミュートルールによってオーバーライドされます。

動的ミュートルールのみを使用することをおすすめします。検出結果を一時的にミュートして自動的にミュートを解除できるため、動的ミュートルールは静的ミュートルールよりも柔軟性の高いオプションです。

静的ミュートルールを使用して、手動で確認する検出結果の数を減らしていて、動的ミュートルールに移行する場合は、静的ミュートルールから動的ミュートルールに移行するをご覧ください。

ミュートルールの範囲

フィルタを作成する際は、ミュートルールの範囲を考慮してください。

たとえば、Project A の検出結果をミュートするフィルタを作成しても、そのフィルタを Project B の下に作成していると、フィルタが検出結果と一致しない可能性があります。

同様に、データ所在地が有効になっている場合、ミュートルールの適用範囲はミュートルールが作成される Security Command Center のロケーションに限定されます。たとえば、米国us)のロケーションにミュートルールを作成した場合、ミュートルールは EUeu)のロケーションに保存されている検出結果をミュートしません。

フィルタ作成の詳細については、通知のフィルタリングをご覧ください。

ミュートルールの制限事項

ミュートルールは、一部の検出プロパティをサポートしていません。ミュートルールがサポートしていないプロパティのリストについては、ミュートルールでサポートされていない検出プロパティをご覧ください。

ミュートルールは、IAM ロールの範囲に基づいて作成、表示、更新、削除できます。組織レベルのロールでは、組織内のすべてのフォルダとプロジェクトのミュートルールが表示されます。フォルダレベルのロールがある場合は、特定のフォルダと、そのフォルダ内のすべてのサブフォルダとプロジェクトのミュートルールにアクセスして管理できます。プロジェクト レベルのロールの場合は、特定のプロジェクトのミュートルールを管理できます。

Security Command Center Premium では、組織レベル、フォルダレベル、プロジェクト レベルでロールを付与できます。Security Command Center Standard では、組織レベルでのロールの付与のみサポートされています。詳細については、アクセス制御をご覧ください。

データ所在地とミュートルール

データ所在地が有効になっている場合、ミュートルールを定義する構成(muteConfig リソース)はデータ所在地の管理対象であり、選択した Security Command Center のロケーションに保存されます。

Security Command Center の場所の検出結果にミュートルールを適用するには、適用先の検出結果と同じ場所にミュートルールを作成する必要があります。

ミュートルールで使用されるフィルタには、所在地管理の対象となるデータが含まれる可能性があるため、作成する前に正しいロケーションを指定していることを確認してください。Security Command Center では、ミュートルールやストリーミング エクスポートの作成場所は制限されません。

ミュートルールは作成場所にのみ保存され、他のロケーションで表示や編集はできません。

ミュートルールを作成した後に、そのロケーションを変更することはできません。場所を変更するには、ミュートルールを削除して、新しいロケーションで再作成する必要があります。

データ所在地が有効になっている場合に Security Command Center を使用する方法については、Security Command Center のリージョン エンドポイントをご覧ください。

ミュートルールを作成する

1 つの組織で作成できるミュートルールは 1,000 個までです。

動的ミュートルールは静的ミュートルールよりも柔軟性が高いため、ミュートルール構成では動的ミュートルールのみを使用することをおすすめします。ミュートルールのタイプの比較については、ミュートルールのタイプをご覧ください。

ミュートルールを作成するには、使用する方法のタブをクリックします。

コンソール

Google Cloud コンソールを使用してミュートルールを作成するには、サービスティアのタブをクリックします。

スタンダードまたはプレミアム

  1. Google Cloud コンソールで、Security Command Center の [検出結果] ページに移動します。

    [検出結果] に移動

  2. 必要に応じて、 Google Cloud プロジェクトまたは組織を選択します。

  3. [ミュート オプション] をクリックし、[ミュートルールを管理] を選択します。

  4. [ミュートルールを作成する] をクリックします。

  5. ミュートルール ID を入力します。この値は必須です。

  6. 検出結果をミュートする理由を [ミュートルールの説明] に入力します。この値は省略可能ですが、指定することをおすすめします。

  7. [親リソース] の値を確認して、ミュートルールの範囲を確認します。

  8. 有効期限のないミュートルールを作成する場合は、次の手順に進みます。検出結果を一時的にミュートする動的ミュートルールを作成する場合は、次の操作を行います。

    1. [一致する検出結果を一時的にミュートする] チェックボックスをオンにします。
    2. 動的ミュートルールの有効期限を選択または入力します。この値は、ルールが一致する検出結果をミュートする期間を示します。
  9. [検出クエリ] フィールドで [フィルタを追加] をクリックして、クエリ ステートメントを作成します。また、クエリ ステートメントを手動で入力することもできます。

    [フィルタを選択] ダイアログでは、サポートされている検出結果属性と値を選択できます。

    1. 検出属性を選択するか、[検出属性の検索] ボックスに名前を入力します。使用可能なサブ属性のリストが表示されます。
    2. サブ属性を選択します。選択フィールドには、選択したサブ属性、クエリ演算子、サブ属性の 1 つ以上の値を使用してクエリ ステートメントを作成できる場所が表示されます。
    3. パネルで演算子とサブ属性の値を 1 つ以上選択します。クエリ演算子とそれらが使用する関数の詳細については、フィルタの追加メニューのクエリ演算子をご覧ください。
    4. [適用] をクリックします。

      ダイアログが閉じて、クエリが更新されます。

    5. 検出クエリに必要な属性がすべて表示されるまで、この操作を繰り返します。
  10. [一致する検出をプレビュー] をクリックします。クエリに一致する検索結果がテーブルに表示されます。

  11. [保存] をクリックします。

エンタープライズ

  1. Google Cloud コンソールで、Security Command Center の [検出結果] ページに移動します。

    [検出結果] に移動

  2. 必要に応じて、 Google Cloud プロジェクトまたは組織を選択します。
  3. 検出結果を 1 つ以上選択します。
  4. [ミュート オプション] をクリックし、[ミュートルールの表示] を選択します。
  5. [ミュートルールを作成する] をクリックします。
  6. ミュートルール ID を入力します。この値は必須です。
  7. 検出結果をミュートする理由を [ミュートルールの説明] に入力します。この値は省略可能ですが、指定することをおすすめします。
  8. [親リソース] の値を確認して、ミュートルールの範囲を確認します。
  9. 有効期限のないミュートルールを作成する場合は、次の手順に進みます。検出結果を一時的にミュートする動的ミュートルールを作成する場合は、次の操作を行います。
    1. [一致する検出結果を一時的にミュートする] チェックボックスをオンにします。
    2. 動的ミュートルールの有効期限を選択または入力します。この値は、ルールが一致する検出結果をミュートする期間を示します。
  10. [検出クエリ] フィールドで [フィルタを追加] をクリックして、クエリ ステートメントを作成します。また、クエリ ステートメントを手動で入力することもできます。

    [フィルタを選択] ダイアログでは、サポートされている検出結果属性と値を選択できます。

    1. 検出属性を選択するか、[検出属性の検索] ボックスに名前を入力します。使用可能なサブ属性のリストが表示されます。
    2. サブ属性を選択します。選択フィールドには、選択したサブ属性、クエリ演算子、サブ属性の 1 つ以上の値を使用してクエリ ステートメントを作成できる場所が表示されます。
    3. パネルで演算子とサブ属性の値を 1 つ以上選択します。クエリ演算子とそれらが使用する関数の詳細については、フィルタの追加メニューのクエリ演算子をご覧ください。
    4. [適用] をクリックします。

      ダイアログが閉じて、クエリが更新されます。

    5. 検出クエリに必要な属性がすべて表示されるまで、この操作を繰り返します。
  11. [一致する検出をプレビュー] をクリックします。クエリに一致する検索結果がテーブルに表示されます。
  12. [保存] をクリックします。

gcloud

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. ミュートルールを作成するには、gcloud scc muteconfigs create コマンドを実行します。

    gcloud scc muteconfigs create CONFIG_ID \
      --PARENT=PARENT_ID \
      --location=LOCATION \
      --description="RULE_DESCRIPTION" \
      --filter="FILTER" \
      --type=MUTE_TYPE \
      --expiry-time=TIMESTAMP

    次のように置き換えます。

    • CONFIG_ID: ミュートルールの名前。ID には英数字とハイフンを使用し、1 文字から 63 文字までの長さにする必要があります。
    • PARENT: ミュートルールが適用されるリソース階層内の範囲(organizationfolder、または project)。
    • PARENT_ID: 親組織、フォルダ、またはプロジェクトの数値 ID、または親プロジェクトの英数字 ID。
    • LOCATION: ミュートルールを作成する Security Command Center のロケーション。データ所在地が有効になっている場合は、eusaus を使用します。それ以外の場合は、global を使用します。
    • RULE_DESCRIPTION: 1,024 文字以内のミュートルールの説明。
    • FILTER: 検出結果のフィルタを定義する式。たとえば、OPEN_FIREWALL の検出結果をミュートするには、フィルタを FILTER="category=\"OPEN_FIREWALL\"" にします。
    • MUTE_TYPE: 作成するミュートルールのタイプ。有効なミュートルールのタイプは DYNAMICSTATIC です。ミュートルールのタイプは、デフォルトで STATIC に設定されています。作成後にミュートルールのタイプを変更することはできません。
    • TIMESTAMP: 動的ミュートルールを作成する場合にのみ適用されます。動的ミュートルールの有効期限を示す日時文字列。この値は、今後 1 日以上先の日付に設定する必要があります。設定しないと、リクエストは拒否されます。時間形式については、gcloud topic datetimes をご覧ください。動的ミュートルールが期限切れになると、一致したすべての検出結果から削除されます。一致した検出結果に対して動的ミュートルールを無期限に動作させる場合は、このフィールドを省略します。

    レスポンスにはミュートルール ID が含まれます。この ID を使用して、ミュートルールを管理するで説明されているミュートルールを表示、更新、削除できます。

  3. Terraform

    組織のミュートルールを作成します。

    resource "google_scc_v2_organization_mute_config" "default" {
      mute_config_id    = "my-config"
      organization = "123456789"
      location     = "global"
      description  = "My custom Cloud Security Command Center Finding Organization mute Configuration"
      filter = "severity = \"HIGH\""
      type = "STATIC"
    }
    

    フォルダのミュートルールを作成します。

    resource "google_folder" "folder" {
      parent       = "organizations/123456789"
      display_name = "folder-name"
    }
    
    resource "google_scc_v2_folder_mute_config" "default" {
      mute_config_id    = "my-config"
      folder = google_folder.folder.folder_id
      location     = "global"
      description  = "My custom Cloud Security Command Center Finding Folder mute Configuration"
      filter = "severity = \"HIGH\""
      type = "STATIC"
    }
    

    プロジェクトのミュートルールを作成します。

    resource "google_scc_v2_project_mute_config" "default" {
      mute_config_id    = "my-config"
      project = "my-project-name"
      location     = "global"
      description  = "My custom Cloud Security Command Center Finding Project mute Configuration"
      filter = "severity = \"HIGH\""
      type = "STATIC"
    }
    

    Go

    
    import (
    	"context"
    	"fmt"
    	"io"
    
    	securitycenter "cloud.google.com/go/securitycenter/apiv2"
    	"cloud.google.com/go/securitycenter/apiv2/securitycenterpb"
    )
    
    // createMuteRule: Creates a mute configuration under a given scope that will mute
    // all new findings that match a given filter.
    // Existing findings will not be muted.
    func createMuteRule(w io.Writer, parent string, muteConfigId string) error {
    	// parent: Use any one of the following options:
    	//             - organizations/{organization_id}
    	//             - folders/{folder_id}
    	//             - projects/{project_id}
    	// parent := fmt.Sprintf("projects/%s", "your-google-cloud-project-id")
    	// muteConfigId: Set a random id; max of 63 chars.
    	// muteConfigId := "random-mute-id-" + uuid.New().String()
    	ctx := context.Background()
    	client, err := securitycenter.NewClient(ctx)
    	if err != nil {
    		return fmt.Errorf("securitycenter.NewClient: %w", err)
    	}
    	defer client.Close()
    
    	muteConfig := &securitycenterpb.MuteConfig{
    		Description: "Mute low-medium IAM grants excluding 'compute' ",
    		// Set mute rule(s).
    		// To construct mute rules and for supported properties, see:
    		// https://cloud.google.com/security-command-center/docs/how-to-mute-findings#create_mute_rules
    		Filter: "severity=\"LOW\" OR severity=\"MEDIUM\" AND " +
    			"category=\"Persistence: IAM Anomalous Grant\" AND " +
    			"-resource.type:\"compute\"",
    		Type: securitycenterpb.MuteConfig_STATIC,
    	}
    
    	req := &securitycenterpb.CreateMuteConfigRequest{
    		Parent:       parent,
    		MuteConfigId: muteConfigId,
    		MuteConfig:   muteConfig,
    	}
    
    	response, err := client.CreateMuteConfig(ctx, req)
    	if err != nil {
    		return fmt.Errorf("failed to create mute rule: %w", err)
    	}
    	fmt.Fprintf(w, "Mute rule created successfully: %s", response.Name)
    	return nil
    }
    

    Java

    
    import com.google.cloud.securitycenter.v2.LocationName;
    import com.google.cloud.securitycenter.v2.MuteConfig;
    import com.google.cloud.securitycenter.v2.MuteConfig.MuteConfigType;
    import com.google.cloud.securitycenter.v2.SecurityCenterClient;
    import java.io.IOException;
    import java.util.UUID;
    
    public class CreateMuteRule {
    
      public static void main(String[] args) throws IOException {
        // TODO: Replace the following variables.
        // projectId: Google Cloud Project id.
        String projectId = "google-cloud-project-id";
    
        // Specify the location of the mute config.
        String location = "global";
    
        // muteConfigId: Set a random id; max of 63 chars.
        String muteConfigId = "random-mute-id-" + UUID.randomUUID();
    
        createMuteRule(projectId, location, muteConfigId);
      }
    
      // Creates a mute configuration in a project under a given location.
      public static void createMuteRule(String projectId, String location, String muteConfigId)
          throws IOException {
        // Initialize client that will be used to send requests. This client only needs to be created
        // once, and can be reused for multiple requests.
        try (SecurityCenterClient client = SecurityCenterClient.create()) {
    
          MuteConfig muteConfig =
              MuteConfig.newBuilder()
                  .setDescription("Mute low-medium IAM grants excluding 'compute' ")
                  // Set mute rule(s).
                  // To construct mute rules and for supported properties, see:
                  // https://cloud.google.com/security-command-center/docs/how-to-mute-findings#create_mute_rules
                  .setFilter(
                      "severity=\"LOW\" OR severity=\"MEDIUM\" AND "
                          + "category=\"Persistence: IAM Anomalous Grant\" AND "
                          + "-resource.type:\"compute\"")
                  .setType(MuteConfigType.STATIC)
                  .build();
    
          // You can also create mute rules in an organization/ folder.
          // Construct the parameters according to the parent resource.
          //  * Organization -> client.createMuteConfig(OrganizationLocationName.of(...
          //  * Folder -> client.createMuteConfig(FolderLocationName.of(...
          MuteConfig response = client.createMuteConfig(
              LocationName.of(projectId, location), muteConfig, muteConfigId);
          System.out.println("Mute rule created successfully: " + response.getName());
        }
      }
    }

    Python

    def create_mute_rule(parent_path: str, location_id: str, mute_config_id: str) -> Dict:
        """
        Creates a mute configuration under a given scope that will mute
        all new findings that match a given filter.
        Existing findings will NOT BE muted.
        Args:
            parent_path: use any one of the following options:
                         - organizations/{organization_id}
                         - folders/{folder_id}
                         - projects/{project_id}
            location_id: Gcp location id; example: 'global'
            mute_config_id: Set a unique id; max of 63 chars.
        Returns:
            Dict: returns the mute rule details
        """
    
        from google.cloud import securitycenter_v2
    
        client = securitycenter_v2.SecurityCenterClient()
    
        mute_config = securitycenter_v2.MuteConfig()
        mute_config.description = "Mute low-medium IAM grants excluding 'compute' "
        # Set mute rule(s).
        # To construct mute rules and for supported properties, see:
        # https://cloud.google.com/security-command-center/docs/how-to-mute-findings#create_mute_rules
        mute_config.filter = (
            'severity="LOW" OR severity="MEDIUM" AND '
            'category="Persistence: IAM Anomalous Grant" AND '
            '-resource.type:"compute"'
        )
        mute_config.type = "STATIC"
    
        request = securitycenter_v2.CreateMuteConfigRequest()
        request.parent = parent_path + "/locations/" + location_id
        request.mute_config_id = mute_config_id
        request.mute_config = mute_config
    
        mute_config = client.create_mute_config(request=request)
        print(f"Mute rule created successfully: {mute_config.name}")
        return mute_config
    
    

    REST

    Security Command Center API で、muteConfigs.create メソッドを使用してミュートルールを作成できます。リクエストの本文は MuteConfig のインスタンスです。

    POST https://securitycenter.googleapis.com/v2/PARENT/PARENT_ID/locations/LOCATION/muteConfigs?muteConfigId=MUTE_CONFIG_ID -d
    
      {
        "description": "RULE_DESCRIPTION",
        "filter": "FILTER",
        "type": "MUTE_TYPE",
        "expiryTime": "TIMESTAMP"
      }
    

    次のように置き換えます。

    • PARENT: ミュートルールの親リソース(organizationsfolders、または projects
    • PARENT_ID: 親組織、フォルダ、またはプロジェクトの ID
    • LOCATION: ミュートルールを作成する Security Command Center のロケーション。データ所在地が有効になっている場合は、eusaus を使用します。それ以外の場合は、global を使用します。
    • MUTE_CONFIG_ID: ミュートルールの名前(1~63 文字)
    • RULE_DESCRIPTION: ミュートルールの説明(最大: 1,024 文字)
    • FILTER: 検出結果のフィルタを定義する式

      たとえば、OPEN_FIREWALL の検出結果をミュートするには、フィルタを "category=\"OPEN_FIREWALL\"" にします。

    • MUTE_TYPE: 作成するミュートルールのタイプ。有効なミュートルールのタイプは DYNAMICSTATIC です。作成後にミュートルールのタイプを変更することはできません。

    • TIMESTAMP: 動的ミュートルールを作成する場合にのみ適用されます。動的ミュートルールの有効期限を示す日時文字列。この値は、今後 1 日以上先の日付に設定する必要があります。設定しないと、リクエストは拒否されます。時間形式については、gcloud topic datetimes をご覧ください。動的ミュートルールが期限切れになると、一致したすべての検出結果から削除されます。一致した検出結果に対して動的ミュートルールを無期限に動作させる場合は、このフィールドを省略します。

    レスポンスにはミュート構成 ID が含まれます。この ID を使用して、ミュートルールを管理するで説明されているミュートルールを表示、更新、削除できます。

フィルタと完全に一致する新しい検出結果は非表示になり、検出結果の mute 属性は MUTED に設定されます。

ミュートルールでサポートされていない検出プロパティ

ミュートルールは、フィルタ内の検出プロパティをすべてサポートしているわけではありません。次のセクションを開くと、ミュートルールのフィルタでサポートされていないプロパティのリストが表示されます。

サポートされていない検出結果のプロパティ

  • caiResource
  • canonicalName
  • createTime
  • description
  • eventTime
  • externalUri
  • gcpMetadata.folders1
  • libraryPaths
  • mute
  • muteAnnotation
  • muteInfo
  • muteInitiator
  • muteUpdateTime
  • name
  • nextSteps
  • originalProviderId
  • parent
  • processes.binaryPath
  • processes.libraryPaths
  • propertyDataTypes
  • resourceName
  • securityMarks
  • sourceProperties
  • state
  • workflowState
  • 1gcpMetadata.folders プロパティには、ミュート フィルタでサポートされているサブフィールドが含まれています。

ミュートルールを一覧表示する

組織、フォルダ、プロジェクトのミュートルールを一覧表示するには、 Google Cloud コンソール、gcloud CLI、または Security Command Center API を使用します。

特定のスコープのミュートルールを一覧表示できるかどうかは、IAM ロールに付与されている権限によって異なります。

Security Command Center のデータ所在地が有効になっている場合、list コマンドは、Security Command Center のロケーションに制限されます。

ミュートルールを一覧表示するサンプルコードについては、ミュートルールを一覧表示するをご覧ください。

組織、フォルダ、またはプロジェクトのミュートルールを一覧表示するには、使用するプロシージャのタブを使用します。

コンソール

  1. Google Cloud コンソールで、Security Command Center の [設定] ページの [ミュートルール] タブに移動します。

    [ミュートルール] に移動

  2. 必要に応じて、 Google Cloud プロジェクトまたは組織を選択します。

  3. [ミュートルール] セクションに、次のようなアクティブなミュートルールの詳細が表示されます。

    • 名前: ミュートルール ID
    • 親リソース: ミュートルールが存在するリソース
    • 説明: ミュートルールの説明(説明がある場合)
    • 最終更新者: ルールを最後に更新したプリンシパル
    • 最終更新: ルールが最後に更新された日時

gcloud

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. ミュートルールを一覧表示するには、gcloud scc muteconfigs list コマンドを実行します。

    gcloud scc muteconfigs list --PARENT=PARENT_ID \
      --location=LOCATION

    次のように置き換えます。

    • PARENT: 親 organizationfolder、または project(ミュートルールを一覧表示する場合)
    • PARENT_ID: 親組織、フォルダ、またはプロジェクトの ID
    • LOCATION: ミュートルールを一覧表示する Security Command Center のロケーション。データ所在地が有効になっている場合は、eusaus を使用します。それ以外の場合は、global を使用します。
  3. Go

    import (
    	"context"
    	"fmt"
    	"io"
    
    	securitycenter "cloud.google.com/go/securitycenter/apiv2"
    	"cloud.google.com/go/securitycenter/apiv2/securitycenterpb"
    	"google.golang.org/api/iterator"
    )
    
    // listMuteRules lists mute configs at the organization level will return all the configs
    // at the org, folder, and project levels.
    // Similarly, listing configs at folder level will list all the configs
    // at the folder and project levels.
    func listMuteRules(w io.Writer, parent string) error {
    	// Use any one of the following resource paths to list mute configurations:
    	//         - organizations/{organization_id}
    	//         - folders/{folder_id}
    	//         - projects/{project_id}
    	// parent := fmt.Sprintf("projects/%s", "your-google-cloud-project-id")
    	ctx := context.Background()
    	client, err := securitycenter.NewClient(ctx)
    	if err != nil {
    		return fmt.Errorf("securitycenter.NewClient: %w", err)
    	}
    	defer client.Close()
    
    	req := &securitycenterpb.ListMuteConfigsRequest{Parent: parent}
    
    	// List all mute configs present in the resource.
    	it := client.ListMuteConfigs(ctx, req)
    	for {
    		muteconfig, err := it.Next()
    		if err == iterator.Done {
    			break
    		}
    		if err != nil {
    			return fmt.Errorf("it.Next: %w", err)
    		}
    		fmt.Fprintf(w, "Muteconfig Name: %s, ", muteconfig.Name)
    	}
    	return nil
    }
    

    Java

    
    import com.google.cloud.securitycenter.v2.ListMuteConfigsRequest;
    import com.google.cloud.securitycenter.v2.MuteConfig;
    import com.google.cloud.securitycenter.v2.SecurityCenterClient;
    import java.io.IOException;
    
    public class ListMuteRules {
    
      public static void main(String[] args) throws IOException {
        // TODO: Replace variables enclosed within {}
        // projectId: Google Cloud Project id.
        String projectId = "google-cloud-project-id";
    
        // Specify the location to list mute configs.
        String location = "global";
    
        listMuteRules(projectId, location);
      }
    
      // Lists all mute rules present under the resource type in the given location.
      public static void listMuteRules(String projectId, String location) throws IOException {
        // Initialize client that will be used to send requests. This client only needs to be created
        // once, and can be reused for multiple requests.
        try (SecurityCenterClient client = SecurityCenterClient.create()) {
    
          // Parent can also be one of:
          //  * "organizations/{org_id}/locations/{location}"
          //  * "folders/{folder_id}/locations/{location}"
          ListMuteConfigsRequest listMuteConfigsRequest = ListMuteConfigsRequest.newBuilder()
              .setParent(String.format("projects/%s/locations/%s", projectId, location))
              .build();
    
          // List all mute configs present in the resource.
          for (MuteConfig muteConfig : client.listMuteConfigs(listMuteConfigsRequest).iterateAll()) {
            System.out.println(muteConfig.getName());
          }
        }
      }
    }

    Python

    def list_mute_rules(parent: str, location_id: str) -> Dict:
        """
        Listing mute configs at organization level will return all the configs
        at the org, folder and project levels.
        Similarly, listing configs at folder level will list all the configs
        at the folder and project levels.
        Args:
            parent: Use any one of the following resource paths to list mute configurations:
                    - organizations/{organization_id}
                    - folders/{folder_id}
                    - projects/{project_id}
            location_id: Gcp location id; example: 'global'
        Returns:
             Dict: returns the mute rule details
        """
        from google.cloud import securitycenter_v2
    
        client = securitycenter_v2.SecurityCenterClient()
    
        request = securitycenter_v2.ListMuteConfigsRequest()
        request.parent = parent + "/locations/" + location_id
        response = client.list_mute_configs(request)
        # List all Mute Configs present in the resource.
        for mute_config in response:
            print(mute_config.name)
        return response
    
    

    REST

    Security Command Center API で、muteConfigs.list メソッドを使用してミュートルールを一覧表示できます。

    GET https://securitycenter.googleapis.com/v2/PARENT/PARENT_ID/locations/LOCATION/muteConfigs
    

    次のように置き換えます。

    • PARENT: ミュートルールの親リソース(organizationsfolders、または projects
    • PARENT_ID: 親組織、フォルダ、またはプロジェクトの ID
    • LOCATION: ミュートルールを一覧表示する Security Command Center のロケーション。データ所在地が有効になっている場合は、eusaus を使用します。それ以外の場合は、global を使用します。

    レスポンスには、ミュートルールの名前、説明、ミュートの構成 ID が含まれます。

ミュートルールの構成を表示する

ミュートルールの構成は、 Google Cloud コンソール、gcloud CLI、または Security Command Center API を使用して表示できます。

ミュートルールの構成を取得するサンプルコードについては、ミュートルールを表示するをご覧ください。

ミュートルールの構成を表示するには、使用する方法のタブをクリックします。

コンソール

  1. Google Cloud コンソールで、Security Command Center の [設定] ページの [ミュートルール] タブに移動します。

    [ミュートルール] に移動

  2. 必要に応じて、 Google Cloud プロジェクトまたは組織を選択します。

  3. [ミュートルール] セクションにミュートルールの一覧が表示されます。

  4. 表示するルールの名前をクリックします。

    ミュートルールの構成を示すページが表示されます。

gcloud

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. ミュートルールの構成を表示するには、gcloud scc muteconfigs get コマンドを実行します。

    gcloud scc muteconfigs get MUTE_CONFIG_ID \
      --PARENT=PARENT_ID --location=LOCATION

    次のように置き換えます。

    • MUTE_CONFIG_ID: ミュートルールの ID
    • PARENT: ミュートルールの親リソース(organizationfolder、または project
    • PARENT_ID: 組織、フォルダまたはプロジェクトの ID
    • LOCATION: ミュートルールの構成を表示する Security Command Center のロケーション。データ所在地が有効になっている場合は、eusa、または us を使用します。それ以外の場合は、global を使用します。
  3. Go

    import (
    	"context"
    	"fmt"
    	"io"
    
    	securitycenter "cloud.google.com/go/securitycenter/apiv2"
    	"cloud.google.com/go/securitycenter/apiv2/securitycenterpb"
    )
    
    // getMuteRule retrieves a mute configuration given its resource name.
    func getMuteRule(w io.Writer, parent string, muteConfigId string) error {
    	// Use any one of the following resource paths to get mute configuration:
    	//         - organizations/{organization_id}
    	//         - folders/{folder_id}
    	//         - projects/{project_id}
    	// parent := fmt.Sprintf("projects/%s", "your-google-cloud-project-id")
    	//
    	// Name of the mute config to retrieve.
    	// muteConfigId := "mute-config-id"
    	ctx := context.Background()
    	client, err := securitycenter.NewClient(ctx)
    	if err != nil {
    		return fmt.Errorf("securitycenter.NewClient: %w", err)
    	}
    	defer client.Close()
    
    	req := &securitycenterpb.GetMuteConfigRequest{
    		Name: fmt.Sprintf("%s/muteConfigs/%s", parent, muteConfigId),
    	}
    
    	muteconfig, err := client.GetMuteConfig(ctx, req)
    	if err != nil {
    		return fmt.Errorf("Failed to retrieve Muteconfig: %w", err)
    	}
    	fmt.Fprintf(w, "Muteconfig Name: %s ", muteconfig.Name)
    	return nil
    }
    

    Java

    
    import com.google.cloud.securitycenter.v2.MuteConfig;
    import com.google.cloud.securitycenter.v2.MuteConfigName;
    import com.google.cloud.securitycenter.v2.SecurityCenterClient;
    import java.io.IOException;
    
    public class GetMuteRule {
    
      public static void main(String[] args) throws IOException {
        // TODO(Developer): Replace the following variables
        // projectId: Google Cloud Project id.
        String projectId = "google-cloud-project-id";
    
        // Specify the location of the mute config. If the mute config was
        // created with v1 API, it can be accessed with "global".
        String location = "global";
    
        // muteConfigId: Name of the mute config to retrieve.
        String muteConfigId = "mute-config-id";
    
        getMuteRule(projectId, location, muteConfigId);
      }
    
      // Retrieves a mute configuration given its resource name.
      public static MuteConfig getMuteRule(String projectId, String location, String muteConfigId)
          throws IOException {
        // Initialize client that will be used to send requests. This client only needs to be created
        // once, and can be reused for multiple requests.
        try (SecurityCenterClient client = SecurityCenterClient.create()) {
          // Use appropriate `MuteConfigName` methods depending on the parent type.
          //  * organization -> MuteConfigName.ofOrganizationLocationMuteConfigName()
          //  * folder -> MuteConfigName.ofFolderLocationMuteConfigName()
    
          MuteConfigName muteConfigName = MuteConfigName.ofProjectLocationMuteConfigName(projectId,
              location, muteConfigId);
          return client.getMuteConfig(muteConfigName);
        }
      }
    }

    Python

    def get_mute_rule(parent_path: str, location_id: str, mute_config_id: str) -> Dict:
        """
        Retrieves a mute configuration given its resource name.
        Args:
            parent_path: use any one of the following options:
                         - organizations/{organization_id}
                         - folders/{folder_id}
                         - projects/{project_id}
            location_id: Gcp location id; example: 'global'
            mute_config_id: Set a unique id; max of 63 chars.
        Returns:
             Dict: returns the mute rule details
        """
        from google.cloud import securitycenter_v2
    
        client = securitycenter_v2.SecurityCenterClient()
    
        request = securitycenter_v2.GetMuteConfigRequest()
        request.name = (
            parent_path + "/locations/" + location_id + "/muteConfigs/" + mute_config_id
        )
    
        mute_config = client.get_mute_config(request)
        print(f"Retrieved the mute rule: {mute_config.name}")
        return mute_config
    
    

    REST

    Security Command Center API で、muteConfigs.get メソッドを使用してミュートルールを構成します。

    GET https://securitycenter.googleapis.com/v2/PARENT/PARENT_ID/locations/LOCATION/muteConfigs/CONFIG_ID
    

    次のように置き換えます。

    • PARENT: ミュートルールの親リソース(organizationsfolders、または projects
    • PARENT_ID: 組織、フォルダ、プロジェクトの ID
    • LOCATION: ミュートルールの構成を表示する Security Command Center のロケーション。データ所在地が有効になっている場合は、eusa、または us を使用します。それ以外の場合は、global を使用します。
    • CONFIG_ID: ミュートルールの数値 ID

ミュートルールを更新する

Google Cloud コンソール、gcloud CLI、または Security Command Center API を使用して、ミュートルールの説明または検出フィルタを更新できます。

ID、親組織、フォルダ、またはプロジェクト、またはミュートルールのロケーションは変更できません。これらの値を変更するには、新しいミュートルールを作成する必要があります。

以前に検出結果のミュートを解除しても、その検出結果が Google Cloud コンソールで更新されたミュートルールと一致すると、再びミュートされます。詳細については、個々の検出結果のミュートを解除するをご覧ください。

ミュートルールを更新するサンプルコードについては、ミュートルールを更新するをご覧ください。

ミュートルールを更新するには、使用する方法のタブをクリックします。

コンソール

  1. Google Cloud コンソールで、Security Command Center の [設定] ページの [ミュートルール] タブに移動します。

    [ミュートルール] に移動

  2. 変更するミュートルールの親リソースである Google Cloud プロジェクトまたは組織を選択します。

  3. 変更するミュートルールの名前をクリックします。

    適切なプロジェクトまたは組織を選択していない場合は、ミュートルールを変更する権限がないことを示す注が表示されることがあります。

  4. ミュートルールを変更します。

  5. 省略可: フィルタを更新した場合は、[一致する検出結果をプレビュー] をクリックして、更新されたフィルタと一致する検出結果を表示します。新しいクエリに一致する検出結果がテーブルに読み込まれます。

  6. [保存] をクリックします。

gcloud

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. ミュートルールを更新するには、gcloud scc muteconfigs update コマンドを実行します。

    gcloud scc muteconfigs update MUTE_CONFIG_ID \
        --PARENT=PARENT_ID \
        --location=LOCATION \
        --description=RULE_DESCRIPTION \
        --filter=FILTER \
        --type=MUTE_TYPE \
        --expiry-time=TIMESTAMP
    

    次のように置き換えます。

    • MUTE_CONFIG_ID: ミュートルールの ID。
    • PARENT: ミュートルールの親リソース(organizationfolder、または project
    • PARENT_ID: 組織、フォルダ、プロジェクトの ID
    • LOCATION: ミュートルールを更新する Security Command Center のロケーション。データ所在地が有効になっている場合は、eusaus を使用します。それ以外の場合は、global を使用します。
    • RULE_DESCRIPTION: ミュートルールの説明(最大: 1,024 文字)。
    • FILTER: 検出結果のフィルタを定義する式。

      たとえば、OPEN_FIREWALL の検出結果をミュートするには、フィルタを FILTER="category=\"OPEN_FIREWALL\"" にします。

    • MUTE_TYPE: 更新するミュートルールのタイプ。有効なミュートルールのタイプは DYNAMICSTATIC です。作成後にミュートルールのタイプを変更することはできません。

    • TIMESTAMP: 動的ミュートルールを更新する場合にのみ適用されます。動的ミュートルールの有効期限を示す日時文字列。この値は、今後 1 日以上先の日付に設定する必要があります。設定しないと、リクエストは拒否されます。時間形式については、gcloud topic datetimes をご覧ください。動的ミュートルールが期限切れになると、一致したすべての検出結果から削除されます。一致した検出結果に対して動的ミュートルールを無期限に動作させる場合は、このフィールドを省略します。

  3. Go

    
    import (
    	"context"
    	"fmt"
    	"io"
    
    	securitycenter "cloud.google.com/go/securitycenter/apiv2"
    	"cloud.google.com/go/securitycenter/apiv2/securitycenterpb"
    	"google.golang.org/protobuf/types/known/fieldmaskpb"
    )
    
    // updateMuteRule Updates an existing mute configuration.
    // The following can be updated in a mute config: description and filter.
    func updateMuteRule(w io.Writer, muteConfigName string) error {
    	// Specify the name of the mute config to delete.
    	// muteConfigName: Use any one of the following formats:
    	//                 - organizations/{organization}/muteConfigs/{config_id}
    	//                 - folders/{folder}/muteConfigs/{config_id}
    	//                 - projects/{project}/muteConfigs/{config_id}
    	// muteConfigName := fmt.Sprintf("projects/%s/muteConfigs/%s", "project-id", "mute-config")
    	ctx := context.Background()
    	client, err := securitycenter.NewClient(ctx)
    	if err != nil {
    		return fmt.Errorf("securitycenter.NewClient: %w", err)
    	}
    	defer client.Close()
    
    	updateMuteConfig := &securitycenterpb.MuteConfig{
    		Name:        muteConfigName,
    		Description: "Updated mute config description",
    	}
    
    	req := &securitycenterpb.UpdateMuteConfigRequest{
    		MuteConfig: updateMuteConfig,
    		// Set the update mask to specify which properties of the mute config should be
    		// updated.
    		// If empty, all mutable fields will be updated.
    		// Make sure that the mask fields match the properties changed in 'updateMuteConfig'.
    		// For more info on constructing update mask path, see the proto or:
    		// https://cloud.google.com/security-command-center/docs/reference/rest/v1/folders.muteConfigs/patch?hl=en#query-parameters
    		UpdateMask: &fieldmaskpb.FieldMask{
    			Paths: []string{
    				"description",
    			},
    		},
    	}
    
    	response, err := client.UpdateMuteConfig(ctx, req)
    	if err != nil {
    		return fmt.Errorf("mute rule update failed! %w", err)
    	}
    	fmt.Fprintf(w, "Mute rule updated %s", response.Name)
    	return nil
    }
    

    Java

    
    import com.google.cloud.securitycenter.v2.MuteConfig;
    import com.google.cloud.securitycenter.v2.SecurityCenterClient;
    import com.google.cloud.securitycenter.v2.UpdateMuteConfigRequest;
    import com.google.protobuf.FieldMask;
    import java.io.IOException;
    
    public class UpdateMuteRule {
    
      public static void main(String[] args) throws IOException {
        // TODO: Replace the variables within {}
        // projectId: Google Cloud Project id.
        String projectId = "google-cloud-project-id";
    
        // Specify the location of the mute config to update. If the mute config was
        // created with v1 API, it can be accessed with "global".
        String location = "global";
    
        // muteConfigId: Name of the mute config to update.
        String muteConfigId = "mute-config-id";
    
        updateMuteRule(projectId, location, muteConfigId);
      }
    
      // Updates an existing mute configuration.
      // The following can be updated in a mute config: description and filter.
      public static void updateMuteRule(String projectId, String location, String muteConfigId)
          throws IOException {
        // Initialize client that will be used to send requests. This client only needs to be created
        // once, and can be reused for multiple requests.
        try (SecurityCenterClient securityCenterClient = SecurityCenterClient.create()) {
    
          MuteConfig updateMuteConfig =
              MuteConfig.newBuilder()
                  // Construct the name according to the parent type of the mute rule.
                  // Parent can also be one of:
                  //  * "organizations/{org_id}/locations/{location}/muteConfigs/{muteConfig_id}"
                  //  * "folders/{folder_id}/locations/{location}/muteConfigs/{muteConfig_id}"
                  .setName(String.format("projects/%s/locations/%s/muteConfigs/%s", projectId, location,
                      muteConfigId))
                  .setDescription("Updated mute config description")
                  .build();
    
          UpdateMuteConfigRequest updateMuteConfigRequest =
              UpdateMuteConfigRequest.newBuilder()
                  .setMuteConfig(updateMuteConfig)
                  // Make sure that the mask fields match the properties changed in
                  // 'updateMuteConfig' object.
                  // For more info on constructing update mask path, see the proto or:
                  // https://cloud.google.com/security-command-center/docs/reference/rest/v2/folders.muteConfigs/patch?hl=en#query-parameters
                  .setUpdateMask(FieldMask.newBuilder().addPaths("description").build())
                  .build();
    
          MuteConfig response = securityCenterClient.updateMuteConfig(updateMuteConfigRequest);
          System.out.println(response);
        }
      }
    }

    Python

    def update_mute_rule(parent_path: str, location_id: str, mute_config_id: str) -> Dict:
        """
        Updates an existing mute configuration.
        The following can be updated in a mute config: description, and filter/ mute rule.
        Args:
            parent: Use any one of the following resource paths to list mute configurations:
                    - organizations/{organization_id}
                    - folders/{folder_id}
                    - projects/{project_id}
            location_id: Gcp location id; example: 'global'
            mute_config_id: Set a unique id; max of 63 chars.
        Returns:
             Dict: returns the mute rule details
        """
        from google.cloud import securitycenter_v2
        from google.protobuf import field_mask_pb2
    
        client = securitycenter_v2.SecurityCenterClient()
    
        update_mute_config = securitycenter_v2.MuteConfig()
        update_mute_config.name = (
            parent_path + "/locations/" + location_id + "/muteConfigs/" + mute_config_id
        )
        update_mute_config.description = "Updated mute config description"
    
        field_mask = field_mask_pb2.FieldMask(paths=["description"])
    
        request = securitycenter_v2.UpdateMuteConfigRequest()
        request.mute_config = update_mute_config
        # Set the update mask to specify which properties of the Mute Config should be updated.
        # If empty, all mutable fields will be updated.
        # Make sure that the mask fields match the properties changed in 'update_mute_config'.
        # For more info on constructing update mask path, see the proto or:
        # https://cloud.google.com/security-command-center/docs/reference/rest/v1/folders.muteConfigs/patch?hl=en#query-parameters
        request.update_mask = field_mask
    
        mute_config = client.update_mute_config(request)
        print(f"Updated mute rule : {mute_config}")
        return mute_config
    
    

    REST

    Security Command Center API で、muteConfigs.patch メソッドを使用してミュートルールを更新できます。リクエストの本文は MuteConfig のインスタンスです。

    PATCH https://securitycenter.googleapis.com/v2/PARENT/PARENT_ID/locations/LOCATION/muteConfigs/CONFIG_ID
    
      {
        "description": "RULE_DESCRIPTION",
        "filter": "FILTER",
        "type": "MUTE_TYPE",
        "expiryTime": "TIMESTAMP"
      }
    

    次のように置き換えます。

    • PARENT: ミュートルールの親リソース(organizationsfolders、または projects
    • PARENT_ID: 組織、フォルダ、プロジェクトの ID
    • LOCATION: ミュートルールを更新する Security Command Center のロケーション。データ所在地が有効になっている場合は、eusaus を使用します。それ以外の場合は、global を使用します。
    • CONFIG_ID: ミュートルールの数値 ID
    • RULE_DESCRIPTION: ミュートルールの説明(最大: 1,024 文字)
    • FILTER: 検出結果のフィルタを定義する式

      たとえば、OPEN_FIREWALL の検出結果をミュートするには、フィルタを "category=\"OPEN_FIREWALL\"" にします。

    • MUTE_TYPE: 更新するミュートルールのタイプ。有効なミュートルールのタイプは DYNAMICSTATIC です。作成後にミュートルールのタイプを変更することはできません。

    • TIMESTAMP: 動的ミュートルールを更新する場合にのみ適用されます。動的ミュートルールの有効期限を示す日時文字列。この値は、今後 1 日以上先の日付に設定する必要があります。設定しないと、リクエストは拒否されます。時間形式については、gcloud topic datetimes をご覧ください。動的ミュートルールが期限切れになると、一致したすべての検出結果から削除されます。一致した検出結果に対して動的ミュートルールを無期限に動作させる場合は、このフィールドを省略します。

フィルタと完全に一致する新しい検出結果は非表示になり、検出結果の mute 属性は MUTED に設定されます。

ミュートルールを削除する

ミュートルールは、 Google Cloud コンソール、gcloud CLI、または Security Command Center API を使用して削除できます。

ミュートルールを削除する前に、次の点にご注意ください。

  • 削除したミュートルールは復元できません。
  • 静的ミュートルールを削除しても、ミュートされている検出結果のミュートが自動的に解除されることはありません。手動またはプログラムで検出結果のミュートを解除する必要があります。
  • 動的ミュートルールを削除すると、以前に一致したすべての検出結果からルールが自動的に削除され、他のルールと一致しない場合、ミュートが解除されます。
  • 削除されたミュートルールのフィルタと一致する将来の検出結果はミュートの対象となりません。

ミュートルールを削除するサンプルコードについては、ミュートルールを削除するをご覧ください。

ミュートルールを削除するには、使用する方法のタブをクリックします。

コンソール

  1. Google Cloud コンソールで、Security Command Center の [設定] ページの [ミュートルール] タブに移動します。

    [ミュートルール] に移動

  2. 必要に応じて、 Google Cloud プロジェクトまたは組織を選択します。

  3. 削除するミュートルールの名前をクリックします。

  4. [削除] をクリックします。

  5. ダイアログを読み、問題がなければ [削除] をクリックします。

gcloud

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. ミュートルールを削除するには、gcloud scc muteconfigs delete コマンドを実行します。

    gcloud scc muteconfigs delete MUTE_CONFIG_ID \
      --PARENT=PARENT_ID --location=LOCATION

    次のように置き換えます。

    • MUTE_CONFIG_ID: ミュート構成の ID
    • PARENT: ミュートルールの親リソース(organizationfolder、または project
    • PARENT_ID: 組織、フォルダ、プロジェクトの ID
    • LOCATION: ミュートルールを削除する Security Command Center のロケーション。データ所在地が有効になっている場合は、eusaus を使用します。それ以外の場合は、global を使用します。
  3. ミュートルールを削除するリクエストを確定します。

  4. Go

    
    import (
    	"context"
    	"fmt"
    	"io"
    
    	securitycenter "cloud.google.com/go/securitycenter/apiv2"
    	"cloud.google.com/go/securitycenter/apiv2/securitycenterpb"
    )
    
    // deleteMuteRule deletes a mute configuration given its resource name.
    // Note: Previously muted findings are not affected when a mute config is deleted.
    func deleteMuteRule(w io.Writer, parent string, muteConfigId string) error {
    	// parent: Use any one of the following options:
    	//             - organizations/{organization_id}
    	//             - folders/{folder_id}
    	//             - projects/{project_id}
    	// parent := fmt.Sprintf("projects/%s", "your-google-cloud-project-id")
    	//
    	// muteConfigId: Specify the name of the mute config to delete.
    	// muteConfigId := "mute-config-id"
    	ctx := context.Background()
    	client, err := securitycenter.NewClient(ctx)
    	if err != nil {
    		return fmt.Errorf("securitycenter.NewClient: %w", err)
    	}
    	defer client.Close()
    
    	req := &securitycenterpb.DeleteMuteConfigRequest{
    		Name: fmt.Sprintf("%s/muteConfigs/%s", parent, muteConfigId),
    	}
    
    	if err := client.DeleteMuteConfig(ctx, req); err != nil {
    		return fmt.Errorf("failed to delete Muteconfig: %w", err)
    	}
    	fmt.Fprintf(w, "Mute rule deleted successfully: %s", muteConfigId)
    	return nil
    }
    

    Java

    
    import com.google.cloud.securitycenter.v2.MuteConfigName;
    import com.google.cloud.securitycenter.v2.SecurityCenterClient;
    import java.io.IOException;
    
    public class DeleteMuteRule {
    
      public static void main(String[] args) throws IOException {
        // TODO(Developer): Replace the following variables
        // projectId: Google Cloud Project id.
        String projectId = "google-cloud-project-id";
    
        // Specify the location of the mute config. If the mute config was
        // created with v1 API, it can be accessed with "global".
        String location = "global";
    
        // muteConfigId: Specify the name of the mute config to delete.
        String muteConfigId = "mute-config-id";
    
        deleteMuteRule(projectId, location, muteConfigId);
      }
    
      // Deletes a mute configuration given its resource name.
      // Note: Previously muted findings are not affected when a mute config is deleted.
      public static void deleteMuteRule(String projectId, String location, String muteConfigId)
          throws IOException {
        // Initialize client that will be used to send requests. This client only needs to be created
        // once, and can be reused for multiple requests.
        try (SecurityCenterClient client = SecurityCenterClient.create()) {
          // Use appropriate `MuteConfigName` methods depending on the parent type.
          // folder -> MuteConfigName.ofFolderLocationMuteConfigName()
          // organization -> MuteConfigName.ofOrganizationLocationMuteConfigName()
          client.deleteMuteConfig(
              MuteConfigName.ofProjectLocationMuteConfigName(projectId, location, muteConfigId));
    
          System.out.println("Mute rule deleted successfully: " + muteConfigId);
        }
      }
    }

    Python

    def delete_mute_rule(parent_path: str, location_id: str, mute_config_id: str) -> None:
        """
        Deletes a mute configuration given its resource name.
        Note: Previously muted findings are not affected when a mute config is deleted.
        Args:
             parent_path: use any one of the following options:
                         - organizations/{organization_id}
                         - folders/{folder_id}
                         - projects/{project_id}
            location_id: Gcp location id; example: 'global'
            mute_config_id: Set a unique id; max of 63 chars.
        Returns:
             None: returns none mute rule is deleted
        """
        from google.cloud import securitycenter_v2
    
        client = securitycenter_v2.SecurityCenterClient()
    
        request = securitycenter_v2.DeleteMuteConfigRequest()
        request.name = (
            parent_path + "/locations/" + location_id + "/muteConfigs/" + mute_config_id
        )
    
        client.delete_mute_config(request)
        print(f"Mute rule deleted successfully: {mute_config_id}")
    
    

    REST

    Security Command Center API で、muteConfigs.delete メソッドを使用してミュートルールを削除できます。

    DELETE https://securitycenter.googleapis.com/v2/PARENT/PARENT_ID/locations/LOCATION/muteConfigs/CONFIG_ID
    

    次のように置き換えます。

    • PARENT: ミュートルールの親リソース(organizationsfolders、または projects
    • PARENT_ID: 組織、フォルダ、プロジェクトの ID
    • LOCATION: ミュートルールを削除する Security Command Center のロケーション。データ所在地が有効になっている場合は、eusaus を使用します。それ以外の場合は、global を使用します。
    • CONFIG_ID: ミュートルールの数値 ID

個別の検出結果をミュートする

個別の検出結果を静的にミュートするには、Google Cloud コンソール、gcloud CLI、または Security Command Center API を使用します。

検出結果の静的ミュートは、その有効 / 無効には影響を与えません。アクティブな検出結果がミュートされている場合、state 属性は変わらず state="ACTIVE" のまま残ります。その検出結果は非表示になりますが、根拠となる脆弱性、構成ミス、脅威が解決されるまでアクティブのまま残ります。また、検出結果を静的にミュートすると、その検出結果に適用される動的ミュートルールがオーバーライドされます。

有害な組み合わせの検出結果をミュートすると、対応する有害な組み合わせのケースがクローズします。

指定した条件に一致する将来の検出結果をすべてミュートするには、ミュートルールを作成するをご覧ください。

検出結果をミュートするサンプルコードについては、検出結果をミュートするをご覧ください。

個別の検出結果を静的にミュートするには、使用する方法のタブをクリックします。

コンソール

Google Cloud コンソールを使用して個別の検出結果をミュートするには、サービスティアのタブをクリックします。

スタンダードまたはプレミアム

  1. Google Cloud コンソールで、Security Command Center の [検出結果] ページに移動します。

    [検出結果] に移動

  2. 必要に応じて、 Google Cloud プロジェクトまたは組織を選択します。
  3. ミュートする検出結果が [検出結果のクエリ結果] パネルに表示されない場合は、[クイック フィルタ] パネルの [カテゴリ] セクションで検出結果のカテゴリを選択します。
  4. ミュートする検出結果の横にあるチェックボックスをオンにします。検出結果は 1 つ以上選択できます。
  5. [検出結果のクエリ結果] アクションバーで [ミュート オプション] をクリックし、[ミュートのオーバーライドを適用] を選択します。

    選択した検出結果の mute 属性は MUTED に設定され、[検出結果のクエリ結果] パネルから検出結果が削除されます。また、詳細パネルで検出結果をミュートすることもできます。

  6. [検出結果] ページの [検出結果のクエリ結果] パネルにある [カテゴリ] 列で、個々の検出結果の名前をクリックします。検出結果の詳細パネルが開きます。

  7. [操作] をクリックします。

  8. [操作] メニューから [ミュートのオーバーライドを適用] を選択します。

    代わりに [これに類似する検出をミュート] を選択すると、[ミュートルールを作成する] ページが開きます。ここで、同じ種類または同じ Indicator 属性を含む検出結果のミュートルールを作成できます。

エンタープライズ

  1. Google Cloud コンソールで、Security Command Center の [検出結果] ページに移動します。

    [検出結果] に移動

  2. 必要に応じて、 Google Cloud プロジェクトまたは組織を選択します。
  3. ミュートする検出結果が [検出結果のクエリ結果] パネルに表示されない場合は、[クイック フィルタ] パネルの [カテゴリ] セクションで検出結果のカテゴリを選択します。
  4. ミュートする検出結果の横にあるチェックボックスをオンにします。検出結果は 1 つ以上選択できます。
  5. [検出結果のクエリ結果] アクションバーで [ミュート オプション] をクリックし、[ミュートのオーバーライドを適用] を選択します。

選択した検出結果の mute 属性は MUTED に設定され、[検出結果のクエリ結果] パネルから検出結果が削除されます。

また、詳細パネルで検出結果をミュートすることもできます。

  1. [検出結果] ページの [検出結果のクエリ結果] パネルにある [カテゴリ] 列で、個々の検出結果の名前をクリックします。検出結果の詳細パネルが開きます。
  2. [ミュート オプション] メニューから [ミュートのオーバーライドを適用] を選択します。

    代わりに [これに類似する検出をミュート] を選択すると、[ミュートルールを作成する] ページが開きます。ここで、同じ種類または同じ Indicator 属性を含む検出結果のミュートルールを作成できます。

gcloud

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. 検出結果のミュート状態を MUTED に設定するには、gcloud CLI で set-mute コマンドを使用します。

    gcloud scc findings set-mute FINDING_ID \
      --PARENT=PARENT_ID \
      --location=LOCATION \
      --source=SOURCE_ID \
      --mute=MUTED

    次のように置き換えます。

    • FINDING_ID: ミュートする検出結果の ID

      検出結果の ID を取得するには、Security Command Center API を使用して検出結果を一覧表示します。検出結果の ID は canonicalName 属性の最後の部分です(例: projects/123456789012/sources/1234567890123456789/findings`/5ee30aa342e799e4e1700826de053aa9)。

    • PARENT: 親リソース(projectfolderorganization)。大文字と小文字が区別されます。

    • PARENT_ID: 親組織、フォルダ、またはプロジェクトの ID

    • LOCATION: 検出結果をミュートする Security Command Center のロケーション。データ所在地が有効になっている場合は、eusaus を使用します。それ以外の場合は、global を使用します。

    • SOURCE_ID: ソース ID

      ソース ID を取得する手順については、ソース ID の取得をご覧ください。

  3. Go

    import (
    	"context"
    	"fmt"
    	"io"
    
    	securitycenter "cloud.google.com/go/securitycenter/apiv2"
    	"cloud.google.com/go/securitycenter/apiv2/securitycenterpb"
    )
    
    // setMute mutes an individual finding.
    // If a finding is already muted, muting it again has no effect.
    // Various mute states are: MUTE_UNSPECIFIED/MUTE/UNMUTE.
    func setMute(w io.Writer, findingPath string) error {
    	// findingPath: The relative resource name of the finding. See:
    	// https://cloud.google.com/apis/design/resource_names#relative_resource_name
    	// Use any one of the following formats:
    	//  - organizations/{organization_id}/sources/{source_id}/finding/{finding_id}
    	//  - folders/{folder_id}/sources/{source_id}/finding/{finding_id}
    	//  - projects/{project_id}/sources/{source_id}/finding/{finding_id}
    	// findingPath := fmt.Sprintf("projects/%s/sources/%s/finding/%s", "your-google-cloud-project-id", "source", "finding-id")
    	ctx := context.Background()
    	client, err := securitycenter.NewClient(ctx)
    	if err != nil {
    		return fmt.Errorf("securitycenter.NewClient: %w", err)
    	}
    	defer client.Close()
    
    	req := &securitycenterpb.SetMuteRequest{
    		Name: findingPath,
    		Mute: securitycenterpb.Finding_MUTED}
    
    	finding, err := client.SetMute(ctx, req)
    	if err != nil {
    		return fmt.Errorf("failed to set the specified mute value: %w", err)
    	}
    	fmt.Fprintf(w, "Mute value for the finding: %s is %s", finding.Name, finding.Mute)
    	return nil
    }
    

    Java

    
    import com.google.cloud.securitycenter.v2.Finding;
    import com.google.cloud.securitycenter.v2.Finding.Mute;
    import com.google.cloud.securitycenter.v2.SecurityCenterClient;
    import com.google.cloud.securitycenter.v2.SetMuteRequest;
    import java.io.IOException;
    
    public class SetMuteFinding {
    
      public static void main(String[] args) throws IOException {
        // TODO: Replace the variables within {}
        // findingPath: The relative resource name of the finding. See:
        // https://cloud.google.com/apis/design/resource_names#relative_resource_name
        // Use any one of the following formats:
        //  - organizations/{org_id}/sources/{source_id}/locations/{location}/finding/{finding_id}
        //  - folders/{folder_id}/sources/{source_id}/locations/{location}/finding/{finding_id}
        //  - projects/{project_id}/sources/{source_id}/locations/{location}/finding/{finding_id}
        //
        String findingPath = "{path-to-the-finding}";
    
        setMute(findingPath);
      }
    
      // Mute an individual finding.
      // If a finding is already muted, muting it again has no effect.
      // Various mute states are: MUTE_UNSPECIFIED/MUTE/UNMUTE.
      public static Finding setMute(String findingPath) throws IOException {
        // Initialize client that will be used to send requests. This client only needs to be created
        // once, and can be reused for multiple requests.
        try (SecurityCenterClient client = SecurityCenterClient.create()) {
    
          SetMuteRequest setMuteRequest =
              SetMuteRequest.newBuilder()
                  // Relative path for the finding.
                  .setName(findingPath)
                  .setMute(Mute.MUTED)
                  .build();
    
          Finding finding = client.setMute(setMuteRequest);
          System.out.println(
              "Mute value for the finding " + finding.getName() + " is: " + finding.getMute());
          return finding;
        }
      }
    }

    Python

    def set_mute_finding(finding_path: str) -> None:
        """
          Mute an individual finding.
          If a finding is already muted, muting it again has no effect.
          Various mute states are: MUTE_UNSPECIFIED/MUTE/UNMUTE.
        Args:
            finding_path: The relative resource name of the finding. See:
            https://cloud.google.com/apis/design/resource_names#relative_resource_name
            Use any one of the following formats:
            - organizations/{organization_id}/sources/{source_id}/finding/{finding_id},
            - folders/{folder_id}/sources/{source_id}/finding/{finding_id},
            - projects/{project_id}/sources/{source_id}/finding/{finding_id}.
        """
        from google.cloud import securitycenter_v2
    
        client = securitycenter_v2.SecurityCenterClient()
    
        request = securitycenter_v2.SetMuteRequest()
        request.name = finding_path
        request.mute = securitycenter_v2.Finding.Mute.MUTED
    
        finding = client.set_mute(request)
        print(f"Mute value for the finding: {finding.mute.name}")
        return finding
    
    

    REST

    Security Command Center API で、findings.setMute メソッドを使用して検出結果をミュートします。リクエストの本文は、結果のミュート状態を示す列挙型です。

    POST https://securitycenter.googleapis.com/v2/PARENT/PARENT_ID/sources/SOURCE_ID/locations/LOCATION/findings/FINDING_ID:setMute
    
    {
      "mute": "MUTED"
    }
    

    次のように置き換えます。

    • PARENT: 親リソース(organizationsfolders、または projects)。
    • PARENT_ID: 親組織、フォルダ、またはプロジェクトの ID。
    • LOCATION: 検出結果をミュートする Security Command Center のロケーション。データ所在地が有効になっている場合は、eusaus を使用します。それ以外の場合は、global を使用します。
    • SOURCE_ID: ソースの数値 ID。

      ソース ID を取得する手順については、ソース ID の取得をご覧ください。

    • FINDING_ID: ミュートする検出結果の ID。

      検出結果の ID を取得するには、Security Command Center API を使用して検出結果を一覧表示します。検出結果の ID は canonicalName 属性の最後の部分です(例: projects/123456789012/sources/1234567890123456789/findings/5ee30aa342e799e4e1700826de053aa9)。

検出結果をミュートすると、mute 属性が MUTED に設定されます。

個別の検出結果のミュートを解除する

個別の検出結果を静的にミュート解除するには、 Google Cloud コンソール、gcloud CLI、または Security Command Center API を使用します。

検出結果のミュート解除は、ミュートルールの条件が広いために検出結果が表示されないような場合や、ルールが複雑すぎて、重要な検出結果を対象外にすることが難しい場合に役立ちます。

検出結果のミュートを解除するサンプルコードについては、検出結果のミュートを解除するをご覧ください。

ミュートを解除した検出結果が再度ミュートするには、検出結果を手動でミュートする必要があります。gcloud CLI または Security Command Center API を使用して作成したミュートルールは、ユーザーがミュート解除した検出結果に影響しません。

検出結果のミュートを解除するサンプルコードについては、検出結果のミュートを解除するをご覧ください。

コンソール

Google Cloud コンソールを使用して個別の検出結果のミュートを解除するには、サービスティアのタブをクリックします。

スタンダードまたはプレミアム

  1. Google Cloud コンソールで、Security Command Center の [検出結果] ページに移動します。

    [検出結果] に移動

  2. 必要に応じて、 Google Cloud プロジェクトまたは組織を選択します。 [検出結果] ページが開き、[クエリのプレビュー] セクションにデフォルトのクエリが表示されます。デフォルトのクエリではミュートされた検出結果が除外されるため、そのクエリは、[検出結果のクエリ結果] パネルにミュートされた結果が表示される前に編集する必要があります。
  3. [クエリのプレビュー] セクションの右側にある [クエリを編集] をクリックして、[クエリエディタ] を開きます。
  4. [クエリエディタ] フィールドで、既存の mute ステートメントを次のように置き換えます。
    mute="MUTED"
  5. [適用] をクリックします。[検出結果のクエリ結果] パネルの検出結果が更新され、ミュートされた検出結果のみが含まれるようになります。
  6. 必要に応じて、ミュートされている他の検出結果を除外します。たとえば、[カテゴリ] の [クイック フィルタ] パネルで、他の検出結果のカテゴリをすべて除外するには、ミュートを解除する検出結果の名前を選択します。
  7. ミュートを解除する検索結果の横にあるチェックボックスをオンにします。検出結果は 1 つ以上選択できます。
  8. [検出結果のクエリ結果] アクションバーで [ミュート オプション] をクリックし、[ミュート解除のオーバーライドを適用] を選択します。 選択した検出結果の mute 属性は UNMUTED に設定され、[検出結果のクエリ結果] パネルから検出結果が削除されます。また、詳細パネルで検出結果のミュートを解除することもできます。
  9. [検出結果] ページの [検出結果のクエリ結果] パネルにある [カテゴリ] 列で、個々の検出結果の名前をクリックします。検出結果の詳細パネルが開きます。
  10. [操作] をクリックします。
  11. [操作] メニューから [ミュート解除のオーバーライドを適用] を選択します。

エンタープライズ

  1. Google Cloud コンソールで、Security Command Center の [検出結果] ページに移動します。

    [検出結果] に移動

  2. 必要に応じて、 Google Cloud プロジェクトまたは組織を選択します。 [検出結果] ページが開き、[クエリのプレビュー] セクションにデフォルトのクエリが表示されます。デフォルトのクエリではミュートされた検出結果が除外されるため、そのクエリは、[検出結果のクエリ結果] パネルにミュートされた結果が表示される前に編集する必要があります。
  3. [クエリのプレビュー] セクションの右側にある [クエリを編集] をクリックして、[クエリエディタ] を開きます。
  4. [クエリエディタ] フィールドで、既存の mute ステートメントを次のように置き換えます。
    mute="MUTED"
  5. [適用] をクリックします。[検出結果のクエリ結果] パネルの検出結果が更新され、ミュートされた検出結果のみが含まれるようになります。
  6. 必要に応じて、ミュートされている他の検出結果を除外します。たとえば、[カテゴリ] の [クイック フィルタ] パネルで、他の検出結果のカテゴリをすべて除外するには、ミュートを解除する検出結果の名前を選択します。
  7. ミュートを解除する検索結果の横にあるチェックボックスをオンにします。検出結果は 1 つ以上選択できます。
  8. [検出結果のクエリ結果] アクションバーで [ミュート オプション] をクリックし、[ミュート解除のオーバーライドを適用] を選択します。 選択した検出結果の mute 属性は UNMUTED に設定され、[検出結果のクエリ結果] パネルから検出結果が削除されます。また、詳細パネルで検出結果のミュートを解除することもできます。
  9. [検出結果] ページの [検出結果のクエリ結果] パネルにある [カテゴリ] 列で、個々の検出結果の名前をクリックします。検出結果の詳細パネルが開きます。
  10. [ミュート オプション] をクリックします。
  11. [ミュート オプション] メニューから [ミュート解除のオーバーライドを適用] を選択します。

gcloud

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. 検出結果のミュート状態を UNMUTED に設定するには、gcloud CLI で set-mute コマンドを使用します。

    gcloud scc findings set-mute FINDING_ID \
      --PARENT=PARENT_ID \
      --location=LOCATION \
      --source=SOURCE_ID \
      --mute=UNMUTED

    次のように置き換えます。

    • FINDING_ID: ミュートする検出結果の ID

      検出結果の ID を取得するには、Security Command Center API を使用して検出結果を一覧表示します。検出結果の ID は canonicalName 属性の最後の部分です(例: projects/123456789012/sources/1234567890123456789/findings/5ee30aa342e799e4e1700826de053aa9)。

    • PARENT: 親リソース(projectfolderorganization)。大文字と小文字が区別されます。

    • PARENT_ID: 親組織、フォルダ、またはプロジェクトの ID

    • LOCATION: 検出結果のミュートを解除する Security Command Center のロケーション。データ所在地が有効になっている場合は、eusaus を使用します。それ以外の場合は、global を使用します。

    • SOURCE_ID: ソース ID

      ソース ID を取得する手順については、ソース ID の取得をご覧ください。

  3. Go

    
    import (
    	"context"
    	"fmt"
    	"io"
    
    	securitycenter "cloud.google.com/go/securitycenter/apiv2"
    	"cloud.google.com/go/securitycenter/apiv2/securitycenterpb"
    )
    
    // setUnmute unmutes an individual finding.
    // Unmuting a finding that isn't muted has no effect.
    // Various mute states are: MUTE_UNSPECIFIED/MUTE/UNMUTE.
    func setUnmute(w io.Writer, findingPath string) error {
    	// findingPath: The relative resource name of the finding. See:
    	// https://cloud.google.com/apis/design/resource_names#relative_resource_name
    	// Use any one of the following formats:
    	//  - organizations/{organization_id}/sources/{source_id}/finding/{finding_id}
    	//  - folders/{folder_id}/sources/{source_id}/finding/{finding_id}
    	//  - projects/{project_id}/sources/{source_id}/finding/{finding_id}
    	// findingPath := fmt.Sprintf("projects/%s/sources/%s/finding/%s", "your-google-cloud-project-id", "source", "finding-id")
    	ctx := context.Background()
    	client, err := securitycenter.NewClient(ctx)
    	if err != nil {
    		return fmt.Errorf("securitycenter.NewClient: %w", err)
    	}
    	defer client.Close()
    
    	req := &securitycenterpb.SetMuteRequest{
    		Name: findingPath,
    		Mute: securitycenterpb.Finding_UNMUTED}
    
    	finding, err := client.SetMute(ctx, req)
    	if err != nil {
    		return fmt.Errorf("failed to set the specified mute value: %w", err)
    	}
    	fmt.Fprintf(w, "Mute value for the finding: %s is %s", finding.Name, finding.Mute)
    	return nil
    }
    

    Java

    
    import com.google.cloud.securitycenter.v2.Finding;
    import com.google.cloud.securitycenter.v2.Finding.Mute;
    import com.google.cloud.securitycenter.v2.SecurityCenterClient;
    import com.google.cloud.securitycenter.v2.SetMuteRequest;
    import java.io.IOException;
    
    public class SetUnmuteFinding {
    
      public static void main(String[] args) throws IOException {
        // TODO: Replace the variables within {}
        // findingPath: The relative resource name of the finding. See:
        // https://cloud.google.com/apis/design/resource_names#relative_resource_name
        // Use any one of the following formats:
        //  - organizations/{org_id}/sources/{source_id}/locations/{location}/finding/{finding_id}
        //  - folders/{folder_id}/sources/{source_id}/locations/{location}/finding/{finding_id}
        //  - projects/{project_id}/sources/{source_id}/locations/{location}/finding/{finding_id}
        //
        String findingPath = "{path-to-the-finding}";
    
        setUnmute(findingPath);
      }
    
      // Unmute an individual finding.
      // Unmuting a finding that isn't muted has no effect.
      // Various mute states are: MUTE_UNSPECIFIED/MUTE/UNMUTE.
      public static Finding setUnmute(String findingPath) throws IOException {
        // Initialize client that will be used to send requests. This client only needs to be created
        // once, and can be reused for multiple requests.
        try (SecurityCenterClient client = SecurityCenterClient.create()) {
    
          SetMuteRequest setMuteRequest =
              SetMuteRequest.newBuilder()
                  .setName(findingPath)
                  .setMute(Mute.UNMUTED)
                  .build();
    
          Finding finding = client.setMute(setMuteRequest);
          System.out.println(
              "Mute value for the finding " + finding.getName() + " is: " + finding.getMute());
          return finding;
        }
      }
    }

    Python

    def set_unmute_finding(finding_path: str) -> None:
        """
          Unmute an individual finding.
          Unmuting a finding that isn't muted has no effect.
          Various mute states are: MUTE_UNSPECIFIED/MUTE/UNMUTE.
        Args:
            finding_path: The relative resource name of the finding. See:
            https://cloud.google.com/apis/design/resource_names#relative_resource_name
            Use any one of the following formats:
            - organizations/{organization_id}/sources/{source_id}/finding/{finding_id},
            - folders/{folder_id}/sources/{source_id}/finding/{finding_id},
            - projects/{project_id}/sources/{source_id}/finding/{finding_id}.
        """
        from google.cloud import securitycenter_v2
    
        client = securitycenter_v2.SecurityCenterClient()
    
        request = securitycenter_v2.SetMuteRequest()
        request.name = finding_path
        request.mute = securitycenter_v2.Finding.Mute.UNMUTED
    
        finding = client.set_mute(request)
        print(f"Mute value for the finding: {finding.mute.name}")
        return finding
    
    

    REST

    Security Command Center API で、findings.setMute メソッドを使用して検出結果のミュートを解除します。リクエストの本文は、結果のミュート状態を示す列挙型です。

    POST https://securitycenter.googleapis.com/v2/PARENT/PARENT_ID/sources/SOURCE_ID/locations/LOCATION/findings/FINDING_ID:setMute
    
    {
      "mute": "UNMUTED"
    }
    

    次のように置き換えます。

    • PARENT: 親リソース(organizationsfolders、または projects
    • PARENT_ID: 親組織、フォルダ、またはプロジェクトの ID
    • LOCATION: 検出結果のミュートを解除する Security Command Center のロケーション。データ所在地が有効になっている場合は、eusaus を使用します。それ以外の場合は、global を使用します。
    • SOURCE_ID: ソースの数値 ID

      ソース ID を取得する手順については、ソース ID の取得をご覧ください。

    • FINDING_ID: ミュートする検出結果の ID。

      検出結果の ID を取得するには、Security Command Center API を使用して検出結果を一覧表示します。検出結果の ID は canonicalName 属性の最後の部分です(例: projects/123456789012/sources/1234567890123456789/findings/5ee30aa342e799e4e1700826de053aa9)。

選択した検出結果は非表示になり、検出結果の mute 属性は UNMUTED に設定されます。

個々の検出結果からミュート状態のオーバーライドを削除する

検出結果のミュート状態を意図的に変更して、検出結果を静的にミュートまたはミュート解除する場合は、ミュート状態のオーバーライドを適用します。たとえば、動的ミュートルールを作成するほどではない重大度の低い検出結果を非表示にするために、ミュート状態のオーバーライドを適用できます。

個々の検出結果からミュート状態のオーバーライドを削除するには、 Google Cloud コンソール、gcloud CLI、または Security Command Center API を使用します。

検出結果からミュート状態のオーバーライドを削除する前に、次の点にご注意ください。

  • 検出結果が静的にミュートまたはミュート解除されている場合、検出結果にミュート状態のオーバーライドがあります。ミュート状態のオーバーライドは、手動で検出結果に適用することも、静的ミュートルールを使用して自動的に適用することもできます。
  • ミュート状態のオーバーライドは、検出結果に無期限に適用され、一致するミュートルールよりも優先されます。
  • 検出結果からミュート状態のオーバーライドを削除すると、検出結果のミュート状態がリセットされ、静的ミュートルールまたは動的ミュートルールで処理できるようになります。
  • 検出結果からミュート状態のオーバーライドを削除することは、検出結果のミュートを解除することとは異なります。検出結果のミュートを解除すると(ミュート解除のオーバーライドを適用すると)、ミュート状態のオーバーライドを手動で削除するまで、ミュートルールでその検出結果をミュートすることはできません。

個々の検出結果からミュートのオーバーライドを削除するには、次の操作を行います。

コンソール

スタンダードまたはプレミアム

  1. Google Cloud コンソールで、Security Command Center の [検出結果] ページに移動します。

    [検出結果] に移動

  2. Google Cloud プロジェクトまたは組織を選択します。
  3. [クエリのプレビュー] セクションの右側にある [クエリを編集] をクリックして、[クエリエディタ] を開きます。
  4. [クエリエディタ] フィールドで、既存の mute ステートメントを次のように置き換えます。
    mute="MUTED" OR mute="UNMUTED"
  5. [適用] をクリックします。[検出結果のクエリ結果] パネルの検出結果が更新され、静的にミュートされた検出結果とミュート解除された検出結果が含まれるようになります。
  6. 必要に応じて、他の検出結果を除外します。たとえば、[カテゴリ] の [クイック フィルタ] パネルで、他の検出結果のカテゴリをすべて除外するには、リセットする検出結果の名前を選択します。
  7. リセットする検出結果の横にあるチェックボックスをオンにします。検出結果は 1 つ以上選択できます。
  8. [検出結果のクエリ結果] アクションバーで [ミュート オプション] をクリックし、[ミュートのオーバーライドを削除] を選択します。 選択した検出結果の mute 属性は UNDEFINED, に設定され、[検出結果のクエリ結果] パネルから検出結果が削除されます。また、詳細パネルで検出結果のミュートを解除することもできます。
  9. [検出結果] ページの [検出結果のクエリ結果] パネルにある [カテゴリ] 列で、個々の検出結果の名前をクリックします。検出結果の詳細パネルが開きます。
  10. [操作] をクリックします。
  11. [操作] メニューから [ミュートのオーバーライドを削除] を選択します。

エンタープライズ

  1. Google Cloud コンソールで、Security Command Center の [検出結果] ページに移動します。

    [検出結果] に移動

  2. Google Cloud プロジェクトまたは組織を選択します。
  3. [クエリのプレビュー] セクションの右側にある [クエリを編集] をクリックして、[クエリエディタ] を開きます。
  4. [クエリエディタ] フィールドで、既存の mute ステートメントを次のように置き換えます。
    mute="MUTED" OR mute="UNMUTED"
  5. [適用] をクリックします。[検出結果のクエリ結果] パネルの検出結果が更新され、静的にミュートされた検出結果とミュート解除された検出結果が含まれるようになります。
  6. 必要に応じて、他の検出結果を除外します。たとえば、[カテゴリ] の [クイック フィルタ] パネルで、他の検出結果のカテゴリをすべて除外するには、リセットする検出結果の名前を選択します。
  7. リセットする検出結果の横にあるチェックボックスをオンにします。検出結果は 1 つ以上選択できます。
  8. [検出結果のクエリ結果] アクションバーで [ミュート オプション] をクリックし、[ミュートのオーバーライドを削除] を選択します。選択した検出結果の mute 属性は UNDEFINED に設定され、[検出結果のクエリ結果] パネルから検出結果が削除されます。また、詳細パネルで検出結果のミュートを解除することもできます。
  9. [検出結果] ページの [検出結果のクエリ結果] パネルにある [カテゴリ] 列で、個々の検出結果の名前をクリックします。検出結果の詳細パネルが開きます。
  10. [ミュート オプション] をクリックします。
  11. [ミュート オプション] メニューから [ミュートのオーバーライドを削除] を選択します。

gcloud

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. 検出結果のミュート状態を UNDEFINED に設定するには、gcloud CLI で set-mute コマンドを使用します。

    gcloud scc findings set-mute FINDING_ID \
      --PARENT=PARENT_ID \
      --location=LOCATION \
      --source=SOURCE_ID \
      --mute=UNDEFINED

    次のように置き換えます。

    • FINDING_ID: リセットする検出結果の ID

      検出結果の ID を取得するには、Security Command Center API を使用して検出結果を一覧表示します。検出結果の ID は canonicalName 属性の最後の部分です(例: projects/123456789012/sources/1234567890123456789/findings/5ee30aa342e799e4e1700826de053aa9)。

    • PARENT: 親リソース(projectfolderorganization)。大文字と小文字が区別されます。

    • PARENT_ID: 親組織、フォルダ、またはプロジェクトの ID

    • LOCATION: 検出結果からミュート状態のオーバーライドを削除する Security Command Center のロケーション。データ所在地が有効になっている場合は、eusa、または us を使用します。それ以外の場合は、global を使用します。

    • SOURCE_ID: ソース ID

      ソース ID を取得する手順については、ソース ID の取得をご覧ください。

  3. REST

    Security Command Center API で、findings.setMute メソッドを使用して検出結果のミュート状態をリセットします。リクエストの本文は、結果のミュート状態を示す列挙型です。

    POST https://securitycenter.googleapis.com/v2/PARENT/PARENT_ID/sources/SOURCE_ID/locations/LOCATION/findings/FINDING_ID:setMute
    
    {
      "mute": "UNDEFINED"
    }
    

    次のように置き換えます。

    • PARENT: 親リソース(organizationsfolders、または projects
    • PARENT_ID: 親組織、フォルダ、またはプロジェクトの ID
    • LOCATION: 検出結果からミュート状態のオーバーライドを削除する Security Command Center のロケーション。データ所在地が有効になっている場合は、eusa、または us を使用します。それ以外の場合は、global を使用します。
    • SOURCE_ID: ソースの数値 ID

    Java

    
    import com.google.cloud.securitycenter.v2.Finding;
    import com.google.cloud.securitycenter.v2.Finding.Mute;
    import com.google.cloud.securitycenter.v2.SecurityCenterClient;
    import com.google.cloud.securitycenter.v2.SetMuteRequest;
    import java.io.IOException;
    
    public class SetMuteUndefinedFinding {
    
      public static void main(String[] args) throws IOException {
        // TODO: Replace the variables within {}
    
        // findingPath: The relative resource name of the finding. See:
        // https://cloud.google.com/apis/design/resource_names#relative_resource_name
        // Use any one of the following formats:
        // - organizations/{organization_id}/sources/{source_id}/finding/{finding_id}
        // - folders/{folder_id}/sources/{source_id}/finding/{finding_id}
        // - projects/{project_id}/sources/{source_id}/finding/{finding_id}
        String findingPath = "{path-to-the-finding}";
        setMuteUndefined(findingPath);
      }
    
      // Reset mute state of an individual finding.
      // If a finding is already reset, resetting it again has no effect.
      // Various mute states are: MUTE_UNSPECIFIED/MUTE/UNMUTE/UNDEFINED.
      public static Finding setMuteUndefined(String findingPath) throws IOException {
        // Initialize client that will be used to send requests. This client only needs
        // to be created once, and can be reused for multiple requests.
        try (SecurityCenterClient client = SecurityCenterClient.create()) {
    
          SetMuteRequest setMuteRequest =
              SetMuteRequest.newBuilder()
                  .setName(findingPath)
                  .setMute(Mute.UNDEFINED)
                  .build();
    
          Finding finding = client.setMute(setMuteRequest);
          System.out.println(
              "Mute value for the finding " + finding.getName() + " is: " + finding.getMute());
          return finding;
        }
      }
    }

複数の既存の検出結果をミュートまたはリセットする

gcloud scc findings bulk-mute gcloud CLI コマンドまたは Security Command Center API の bulkMute メソッドを使用して、複数の既存の検出結果に対して次のミュート オペレーションを一括で実行できます。

  • 複数の既存の検出結果をミュートします。既存の検出結果を一括でミュートすると、検出結果が静的にミュートされ、検出結果に適用される動的ミュートルールがオーバーライドされます。類似した将来の検出結果をミュートする必要がある場合は、ミュートルールを作成します。

  • 複数の既存の検出結果のミュート状態のオーバーライドを削除します。検出結果のミュート状態のオーバーライドを削除すると、ミュート状態が MUTED(静的にミュート)または UNMUTED(静的にミュート解除)から UNDEFINED にリセットされます。この機能は、静的ミュートルールから動的ミュートルールに移行する場合に便利です。

検出結果フィルタを定義して、ミュートする必要がある一連の検出結果を指定します。一括ミュート フィルタは、すべての検出結果のプロパティに対応しているわけではありません。対応していないプロパティのリストについては、ミュートルールでサポートされていない検出結果のプロパティをご覧ください。

Security Command Center でデータ所在地が有効になっている場合は、一括ミュート オペレーションの範囲は、操作が実行される Security Command Center の場所に限定されます。

検出結果を一括でミュートするサンプルコードについては、検出結果の一括ミュートをご覧ください。

検出結果を一括でミュートまたはリセットするには、使用する方法のタブをクリックします。

コンソール

Google Cloud コンソールの場合、検索結果を一括でミュートするには、ミュートルールを作成する必要があります。 Google Cloud コンソールでミュートルールを作成すると、既存の検出結果と今後の検出結果がミュートされます。

gcloud

  1. In the Google Cloud console, activate Cloud Shell.

    Activate Cloud Shell

    At the bottom of the Google Cloud console, a Cloud Shell session starts and displays a command-line prompt. Cloud Shell is a shell environment with the Google Cloud CLI already installed and with values already set for your current project. It can take a few seconds for the session to initialize.

  2. 複数の検出結果を一括でミュートまたはリセットするには、gcloud scc findings bulk-mute コマンドを実行します。

    gcloud scc findings bulk-mute \
      --PARENT=PARENT_ID \
      --location=LOCATION \
      --filter="FILTER" \
      --mute-state=MUTE_STATE

    次のように置き換えます。

    • PARENT: ミュートルールが適用されるリソース階層内の範囲(organizationfolder、または project)。
    • PARENT_ID: 親組織、フォルダ、またはプロジェクトの数値 ID、または親プロジェクトの英数字 ID。
    • LOCATION: 検出結果を一括でミュートまたはリセットする Security Command Center のロケーション。データ所在地が有効になっている場合は、eusa、または us を使用します。それ以外の場合は、global を使用します。
    • FILTER: 検出結果のフィルタを定義する式。

      たとえば、internal-test プロジェクトで既存の重大度が低の OPEN_FIREWALLPUBLIC_IP_ADDRESS のすべての検出結果をミュートするには、フィルタを "category=\"OPEN_FIREWALL\" OR category=\"PUBLIC_IP_ADDRESS\" AND severity=\"LOW\" AND resource.projectDisplayName=\"internal-test\"" にできます。

    • MUTE_STATE: 検出結果が静的にミュートされているかどうかを示す値。有効な値は MUTEDUNDEFINED です。デフォルトでは MUTED に設定されています。この値を UNDEFINED に設定するのは、複数の既存の検出結果のミュート状態をリセットする場合だけです。

  3. REST

    Security Command Center API で、findings.bulkMute メソッドを使用して、複数の既存の検出結果のミュート状態をミュートまたはリセットします。リクエストの本文には、検出結果をフィルタリングする式が含まれます。

    POST https://securitycenter.googleapis.com/v2/PARENT/PARENT_ID/locations/LOCATION/findings:bulkMute
    
    {
      "filter": "FILTER",
      "muteState": "MUTE_STATE"
    }
    

    次のように置き換えます。

    • PARENT: 親リソース(organizationsfolders、または projects)。
    • PARENT_ID: 親組織、フォルダ、またはプロジェクトの ID。
    • LOCATION: 検出結果を一括でミュートまたはリセットする Security Command Center のロケーション。データ所在地が有効になっている場合は、eusa、または us を使用します。それ以外の場合は、global を使用します。
    • FILTER: 検出結果のフィルタを定義する式。

      たとえば、internal-test プロジェクトで既存の重大度が低の OPEN_FIREWALLPUBLIC_IP_ADDRESS のすべての検出結果をミュートするには、フィルタを "category=\"OPEN_FIREWALL\" OR category=\"PUBLIC_IP_ADDRESS\" AND severity=\"LOW\" AND resource.projectDisplayName=\"internal-test\"" にできます。

    • MUTE_STATE: 検出結果がミュートされているかどうかを示す値。有効な値は MUTED または UNDEFINED です。デフォルトでは MUTED に設定されています。この値を UNDEFINED に設定するのは、複数の既存の検出結果のミュート状態をリセットする場合だけです。

選択したリソース内にあり、フィルタと完全に一致する既存の検出結果はすべて非表示になります。検出結果の mute 属性は MUTED に設定されます。

検出結果をミュートしても状態は変わりません。アクティブな検出結果がミュートされている場合、それらは非表示になりますが、検出の原因となった脆弱性、構成ミス、または脅威が解決されるまではアクティブなままになります。

Google Cloud コンソールでミュートされた検出結果を表示する

Google Cloud コンソールでミュートされた検出結果を表示するには、検出結果クエリを編集して、プロパティ値 mute="MUTED" を含む検出結果を選択します。

たとえば、次の検出結果クエリでは、ミュートされているアクティブな検出結果のみが表示されます。

state="ACTIVE"
AND mute="MUTED"

ミュートとミュート解除の両方の結果を表示するには、クエリから mute 属性を省略します。

state="ACTIVE"

デフォルトでは、 Google Cloud コンソールの検出結果クエリには、ミュートされていない検出結果のみが表示されます。

ミュートルールのタイプ別にミュートされた検出結果を表示する

次のセクションでは、ミュートルールのタイプ別にアクティブな検出結果をクエリする方法について説明します。

特定の検出結果の一覧表示の詳細については、検出結果をフィルタするをご覧ください。

静的ミュートルールでミュートされた検出結果をクエリする

指定した時間後に静的ミュートルールでミュートされたアクティブな検出結果を表示するには、次のクエリを使用し、muteInitiator 属性を調べて、検出結果が静的ミュートルールでミュートされたかどうかを確認します。

state="ACTIVE" AND
muteInfo.staticMute.applyTime>=TIMESTAMP AND
muteInfo.staticMute.state="MUTED"

TIMESTAMP は、クエリを実行する期間の開始を示す日時文字列に置き換えます。時間形式については、gcloud topic datetimes をご覧ください。

動的ミュートルールでミュートされた検出結果をクエリする

指定した時間後に動的ミュートルールでミュートされたアクティブな検出結果を表示するには、次のクエリを使用します。

state="ACTIVE" AND
muteUpdateTime>=TIMESTAMP AND
contains(muteInfo.dynamicMuteRecords, muteConfig="PARENT_ID/muteConfigs/CONFIG_ID")

次のように置き換えます。

  • TIMESTAMP: クエリする期間の開始を示す日時文字列。時間形式については、gcloud topic datetimes をご覧ください。
  • PARENT_ID: 親組織、フォルダ、またはプロジェクトの ID。organizations/123folders/456、または projects/789 の形式で指定されます。
  • CONFIG_ID: ミュートルールの名前。ID には英数字とハイフンを使用し、1 文字から 63 文字までの長さにする必要があります。

検出結果クエリの編集の詳細については、ダッシュボードで検出結果クエリを作成または編集するをご覧ください。

ミュートに関連する検出結果のプロパティ

このセクションでは、検出結果のミュート状態に関連する検出結果のプロパティを示し、それらがミュート オペレーションによってどのような影響を受けるか説明します。

  • mute: 検出結果が作成されると UNDEFINED にセットされます。次のシナリオで変更されます。
    • MUTED: 検出結果が手動またはミュートルールでミュートされる。
    • UNMUTED: ユーザーが検出結果のミュートを解除する。
  • muteUpdateTime: 検出結果がミュート、またはミュートが解除された時間。
  • muteInitiator: 検出結果をミュートしたプリンシパル、またはミュートルールの ID。
  • muteInfo: 検出結果のミュート情報(ミュートルールのタイプ(静的または動的)、検出結果が一致したミュートルールなど)。
  • muteInfo.staticMute: 静的ミュート状態は、この検出結果に適用される動的ミュートルールをオーバーライドします。
    • state: 検出結果を直接ミュートするか、静的ミュートルールで設定できる静的ミュート状態。
    • applyTime: 静的ミュート状態が検出結果に適用された時間。
  • muteInfo.dynamicMuteRecords: 検出結果に一致する動的ミュートルールのレコード。
    • muteConfig:: レコードを作成したミュート構成で表される、ミュートルールの相対リソース名。例: organizations/123/muteConfigs/examplemuteconfig
    • matchTime: 動的ミュートルールが検出結果と一致した時間。

ミュートされた検出結果の通知とエクスポートを停止する

検出結果の通知を有効にしている場合、通知フィルタに一致する、新規または更新されたミュートされた検出結果は Pub/Sub にエクスポートされます

ミュートされた検出結果のエクスポートと通知を停止するには、mute 属性を使用して、NotificationConfig フィルタでミュートされた検出結果を除外します。たとえば、次のフィルタは、ミュートされていないか、ミュート属性が設定されていないアクティブな検出結果に対してのみ通知を送信します。

FILTER="state=\"ACTIVE\" AND -mute=\"MUTED\""

次のステップ

検出結果の通知のフィルタリングの詳細を確認する。

使用できるフィルタの例を確認する。