This document explains how to create and manage mute rules to automatically mute findings in Security Command Center.
Required roles
To get the permissions that you need to manage mute rules, ask your administrator to grant you the following IAM roles on the organization, folder, or project:
-
View mute rules:
- Security Center Admin Viewer (
roles/securitycenter.adminViewer) - Security Center Settings Viewer (
roles/securitycenter.settingsViewer) - Security Center Mute Configurations Viewer (
roles/securitycenter.muteConfigsViewer)
- Security Center Admin Viewer (
-
View, create, update, and delete mute rules:
- Security Center Admin (
roles/securitycenter.admin) - Security Center Admin Editor (
roles/securitycenter.adminEditor) - Security Center Settings Editor (
roles/securitycenter.settingsEditor) - Security Center Mute Configurations Editor (
roles/securitycenter.muteConfigsEditor)
- Security Center Admin (
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Create a mute rule
Your organization can create a maximum of 1,000 mute rules.
We recommend using dynamic mute rules exclusively in your mute rule configurations, because they're more flexible than static mute rules. For a comparison of mute rule types, see Types of mute rules.
To create a mute rule, click the tab for the procedure that you want to use:
Console
Define the mute rule
In the Google Cloud console, go to the Findings page.
Select an organization or project.
Click Mute options, and then select Manage mute rules.
Click Create mute rule.
Enter a Mute rule ID.
Recommended: Enter a Description that provides context for why findings are muted.
To confirm the scope of the mute rule, check the Parent resource value.
Optional: Add an expiration date
You can add an expiration date to dynamic mute rules.
- Select Mute matching findings temporarily.
To configure the expiration date for the dynamic mute rule, select the calendar and choose a date and time at least 24 hours in the future.
After the expiration date, the mute rule has no effect.
Optional: Limit the mute rule with a query
If you add a query, then the mute rule applies only to findings that match the query.
To limit the mute rule with a query, in the Findings query section, click Add filter.
The Add filter menu lets you choose supported finding attributes and values.
- In the Select filter menu, select a finding attribute or type its name in the Search finding attributes box. A list of the available sub-attributes displays.
- Select a sub-attribute. A selection field displays where you can build the query statement using the sub-attribute you selected, a query operator, and one or more values for the sub-attribute.
-
Select the operator and one or more values for the sub-attribute from the panel. For more information about query operators and functions that they use, see Query operators in the Add filters menu.
If you want to start over, click Reset.
-
Click Apply.
The menu closes and your query is updated.
- Repeat until the findings query contains all the attributes you want.
If the query doesn't match the correct findings, then revise the query as needed and preview the findings again. Repeat this step until you're satisfied with the results.
Save the mute rule
Click Save. The Google Cloud console shows a list of your mute rules.
gcloud
-
In the Google Cloud console, 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.
To create mute rules, run the
gcloud scc muteconfigs createcommand:gcloud scc muteconfigs create CONFIG_ID \ --PARENT=PARENT_ID \ --location=LOCATION \ --description="RULE_DESCRIPTION" \ --filter="FILTER" \ --type=MUTE_TYPE \ --expiry-time=TIMESTAMP
Replace the following:
CONFIG_ID: the name of the mute rule. The ID must use alphanumeric characters and hyphens and be between 1 and 63 characters.PARENT: the scope in the resource hierarchy to which the mute rule applies,organization,folder, orproject.PARENT_ID: the numeric ID of the parent organization, folder, or project, or the alphanumeric ID of the parent project.LOCATION: the Security Command Center location in which to manage mute rules; if data residency is enabled, useeu,sa, orus; otherwise, use the valueglobal.RULE_DESCRIPTION: a description of the mute rule of no more than 1,024 characters.FILTER: the expression you define to filter findings. For example, to muteOPEN_FIREWALLfindings, your filter can beFILTER="category=\"OPEN_FIREWALL\"".MUTE_TYPE: the type of mute rule you want to create. Valid mute rule types areDYNAMICandSTATIC. The mute rule type is set toSTATICby default. You can't change the type of a mute rule after you've created it.TIMESTAMP: only applies if you are creating a dynamic mute rule. The date and time string that indicates when the dynamic mute rule expires. The value must be set to at least one day in the future or the request will be rejected. For information about time formats, seegcloud topic datetimes. When a dynamic mute rule expires, it is removed from all matched findings. To have the dynamic mute rule act indefinitely on matching findings, omit this field.
The response includes the mute rule ID, which you can use to view, update, and delete mute rules, as described in Manage mute rules.
Terraform
Create a mute rule for an organization:
Create a mute rule for a folder:
Create a mute rule for a project:
Go
Java
Python
REST
In the Security Command Center API, use the
muteConfigs.create
method to create a mute rule. The request body is an instance of 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"
}
Replace the following:
PARENT: the parent resource for your mute rule (organizations,folders, orprojects)PARENT_ID: the ID of the parent organization, folder, or projectLOCATION: the Security Command Center location in which to manage mute rules; if data residency is enabled, useeu,sa, orus; otherwise, use the valueglobalMUTE_CONFIG_ID: the name of the mute rule (between 1 and 63 characters)RULE_DESCRIPTION: a description of the mute rule (max: 1,024 characters)FILTER: the expression you define to filter findingsFor example, to mute
OPEN_FIREWALLfindings, your filter can be"category=\"OPEN_FIREWALL\"".MUTE_TYPE: the type of mute rule you want to create. Valid mute rule types areDYNAMICandSTATIC. You can't change the type of a mute rule after you've created it.TIMESTAMP: only applies if you are creating a dynamic mute rule. The date and time string that indicates when the dynamic mute rule expires. The value must be set to at least one day in the future or the request will be rejected. For information about time formats, seegcloud topic datetimes. When a dynamic mute rule expires, it is removed from all matched findings. If you want the dynamic mute rule to act indefinitely on matching findings, omit this field.
The response includes the mute config ID, which you can use to view, update, and delete mute rules, as described in Manage mute rules.
New findings that exactly match the filter are hidden, and the mute
attribute for the findings is set to MUTED.
Unsupported finding properties for mute rules
Mute rules don't support all finding properties in filters. Expand the following section to see the list of properties that aren't supported in mute rule filters.
Unsupported finding properties
caiResourcecanonicalNamecreateTimedescriptioneventTimeexternalUrigcpMetadata.folders1libraryPathsmutemuteAnnotationmuteInfomuteInitiatormuteUpdateTimenamenextStepsoriginalProviderIdparentprocesses.binaryPathprocesses.libraryPathspropertyDataTypesresource.tagsresourceNamesecurityMarkssourcePropertiesstateworkflowState
1The gcpMetadata.folders property
contains subfields that are supported in mute filters.
List mute rules
You can list the mute rules in an organization, folder, or project by using the Google Cloud console, the gcloud CLI, or the Security Command Center API.
Your ability to list mute rules for a given scope depends on the permissions that are granted to your IAM roles.
If data residency is enabled for Security Command Center, the scope of the list command is also limited to the selected Security Command Center location.
For sample code that lists mute rules, see List mute rules.
To list the mute rules for an organization, folder, or project, click the tab for the procedure that you want to use:
Console
In the Google Cloud console, go to the Mute rules tab in the Security Command Center Settings page.
If necessary, select your Google Cloud project or organization.
In the Mute rules section, you see details for active mute rules, including the following:
- Name: mute rule ID
- Parent resource: the resource where the mute rule lives
- Description: the mute rule description, if available
- Last updated by: the principal who last updated the rule
- Last updated: the date and time the rule was last updated
gcloud
-
In the Google Cloud console, 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.
To list mute rules, run the
gcloud scc muteconfigs listcommand:gcloud scc muteconfigs list --PARENT=PARENT_ID \ --location=LOCATION
Replace the following:
PARENT: the parentorganization,folder, orprojectfor which to list mute rulesPARENT_ID: the ID of the parent organization, folder, or projectLOCATION: the Security Command Center location in which to manage mute rules; if data residency is enabled, useeu,sa, orus; otherwise, use the valueglobal
Go
Java
Python
REST
In the Security Command Center API, use the
muteConfigs.list
method to list mute rules:
GET https://securitycenter.googleapis.com/v2/PARENT/PARENT_ID/locations/LOCATION/muteConfigs
Replace the following:
PARENT: the parent resource for your mute rule (organizations,folders, orprojects)PARENT_ID: the ID of the parent organization, folder, or projectLOCATION: the Security Command Center location in which to manage mute rules; if data residency is enabled, useeu,sa, orus; otherwise, use the valueglobal
The response includes the names, descriptions, and mute config IDs for your mute rules.
View a mute rule configuration
You can view a mute rule configuration by using the Google Cloud console, the gcloud CLI, or the Security Command Center API.
For sample code that retrieves a mute rule configuration, see View a mute rule.
To view a mute rule configuration, click the tab for the procedure that you want to use:
Console
In the Google Cloud console, go to the Mute rules tab in the Security Command Center Settings page.
If necessary, select your Google Cloud project or organization.
In the Mute rules section, you see a list of mute rules.
Click the name of the rule you want to view.
A page opens with the mute rule's configuration.
gcloud
-
In the Google Cloud console, 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.
To view the configuration of a mute rule, run the
gcloud scc muteconfigs getcommand:gcloud scc muteconfigs get MUTE_CONFIG_ID \ --PARENT=PARENT_ID --location=LOCATION
Replace the following:
MUTE_CONFIG_ID: the ID for the mute rulePARENT: the parent resource for your mute rule (organization,folder, orproject)PARENT_ID: the ID of the organization, folder, or projectLOCATION: the Security Command Center location in which to manage mute rules; if data residency is enabled, useeu,sa, orus; otherwise, use the valueglobal
Go
Java
Python
REST
In the Security Command Center API, use the
muteConfigs.get
method to return the configuration of a mute rule:
GET https://securitycenter.googleapis.com/v2/PARENT/PARENT_ID/locations/LOCATION/muteConfigs/CONFIG_ID
Replace the following:
PARENT: the parent resource for your mute rule (organizations,folders, orprojects)PARENT_ID: the ID for the organization, folder, or projectLOCATION: the Security Command Center location in which to manage mute rules; if data residency is enabled, useeu,sa, orus; otherwise, use the valueglobalCONFIG_ID: the numeric ID of the mute rule
Update mute rules
You can update the description or finding filter of a mute rule by using the Google Cloud console, the gcloud CLI, or the Security Command Center API.
You can't change the ID; the parent organization, folder, or project; or the location of a mute rule. To change any of these values, you must create a new mute rule.
If you previously unmuted findings, they're muted again if they matched through a mute rule that is updated in the Google Cloud console. For more information, see Unmute individual findings.
For sample code that updates a mute rule, see Update a mute rule.
To update a mute rule, click the tab for the procedure that you want to use:
Console
In the Google Cloud console, go to the Mute rules tab in the Security Command Center Settings page.
Select the Google Cloud project or organization that is the parent resource for the mute rule you want to modify.
Click the name of the mute rule you want to modify.
If you didn't select the appropriate project or organization, you might see a note informing you that you don't have permission to modify the mute rule.
Make changes to the mute rule.
Optional: After you update the filter, click Preview Matching Findings to view findings that match the updated filter. A table loads with findings that match the new query.
Click Save.
gcloud
-
In the Google Cloud console, 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.
To update mute rules, run the
gcloud scc muteconfigs updatecommand:gcloud scc muteconfigs update MUTE_CONFIG_ID \ --PARENT=PARENT_ID \ --location=LOCATION \ --description=RULE_DESCRIPTION \ --filter=FILTER \ --type=MUTE_TYPE \ --expiry-time=TIMESTAMPReplace the following:
MUTE_CONFIG_ID: the ID for the mute rule.PARENT: the parent resource for your mute rule (organization,folder, orproject).PARENT_ID: the ID for the organization, folder, or project.LOCATION: the Security Command Center location in which to manage mute rules; if data residency is enabled, useeu,sa, orus; otherwise, use the valueglobal.RULE_DESCRIPTION: a description of the mute rule (max: 1,024 characters).FILTER: the expression you define to filter findings.For example, to mute
OPEN_FIREWALLfindings, your filter could beFILTER="category=\"OPEN_FIREWALL\"".MUTE_TYPE: the type of mute rule you are updating. Valid mute rule types areDYNAMICandSTATIC. You can't change the type of a mute rule once you've created it.TIMESTAMP: only applies if you are updating a dynamic mute rule. The date and time string that indicates when the dynamic mute rule expires. The value must be set to at least one day in the future or the request will be rejected. For information about time formats, seegcloud topic datetimes. When a dynamic mute rule expires, it is removed from all matched findings. If you want the dynamic mute rule to act indefinitely on matching findings, omit this field.
Go
Java
Python
REST
In the Security Command Center API, use the
muteConfigs.patch
method to update a mute rule. The request body is an instance of 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"
}
Replace the following:
PARENT: the parent resource for your mute rule (organizations,folders, orprojects)PARENT_ID: the ID for the organization, folder, or projectLOCATION: the Security Command Center location in which to manage mute rules; if data residency is enabled, useeu,sa, orus; otherwise, use the valueglobalCONFIG_ID: the numeric ID of the mute ruleRULE_DESCRIPTION: a description of the mute rule (max: 1,024 characters)FILTER: the expression you define to filter findingsMUTE_TYPE: the type of mute rule you are updating. Valid mute rule types areDYNAMICandSTATIC. You can't change the type of a mute rule once you've created it.TIMESTAMP: only applies if you are updating a dynamic mute rule. The date and time string that indicates when the dynamic mute rule expires. The value must be set to at least one day in the future or the request will be rejected. For information about time formats, seegcloud topic datetimes. When a dynamic mute rule expires, it is removed from all matched findings. If you want the dynamic mute rule to act indefinitely on matching findings, omit this field.
Delete mute rules
You can delete a mute rule by using the Google Cloud console, the gcloud CLI, or the Security Command Center API.
Before deleting mute rules, understand the following:
- You can't recover deleted mute rules.
- Deleting static mute rules doesn't automatically unmute any findings that are muted. You must manually or programmatically unmute findings.
- Deleting dynamic mute rules automatically removes the rule from all previously matching findings and unmutes them if they don't match any additional rules.
- Future findings that match filters in deleted mute rules aren't muted.
For sample code that deletes a mute rule, see Delete a mute rule.
To delete a mute rule, click the tab for the procedure that you want to use:
Console
In the Google Cloud console, go to the Mute rules tab in the Security Command Center Settings page.
If necessary, select your Google Cloud project or organization.
Click the name of the mute rule you want to delete.
Click delete Delete.
Read the dialog and, if satisfied, click Delete.
gcloud
-
In the Google Cloud console, 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.
To delete mute rules, run the
gcloud scc muteconfigs deletecommand:gcloud scc muteconfigs delete MUTE_CONFIG_ID \ --PARENT=PARENT_ID --location=LOCATION
Replace the following:
MUTE_CONFIG_ID: the ID for the mute configPARENT: the parent resource for your mute rule (organization,folder, orproject)PARENT_ID: the ID for the organization, folder, or projectLOCATION: the Security Command Center location in which to manage mute rules; if data residency is enabled, useeu,sa, orus; otherwise, use the valueglobal
Confirm your request to delete the mute rule.
Go
Java
Python
REST
In the Security Command Center API, use the
muteConfigs.delete
method to delete a mute rule:
DELETE https://securitycenter.googleapis.com/v2/PARENT/PARENT_ID/locations/LOCATION/muteConfigs/CONFIG_ID
Replace the following:
PARENT: the parent resource for your mute rule (organizations,folders, orprojects)PARENT_ID: the ID for the organization, folder, or projectLOCATION: the Security Command Center location in which to manage mute rules; if data residency is enabled, useeu,sa, orus; otherwise, use the valueglobalCONFIG_ID: the numeric ID of the mute rule