Este rol predefinido contiene el permiso recommender.computeFirewallInsightTypeConfigs.update, que se requiere para configurar el período de observación y el ciclo de actualización.
Para algunas estadísticas, puedes configurar un período de observación, es decir, el intervalo de tiempo que abarca la estadística. Por ejemplo, puedes configurar el período de observación de las estadísticas de reglas demasiado permisivas y deny. El período de observación predeterminado es de seis semanas, y puedes configurar el período de observación entre siete días y un año.
Por ejemplo, si estableces el período de observación de las estadísticas de reglas deny en dos meses, cuando revises la lista de reglas deny con hits después del período de observación, Estadísticas de firewall te mostrará solo las que tuvieron hits durante los últimos dos meses. Supongamos que luego cambias el período de observación a un mes. Es posible que Estadísticas de firewall identifique una cantidad diferente de reglas, ya que analizaría un intervalo de tiempo más corto.
Cuando revises las estadísticas y configures los períodos de observación, ten en cuenta lo siguiente:
Cuando configuras el período de observación de las reglas deny con hits, Estadísticas de firewall actualizan los resultados de las estadísticas de inmediato.
Cuando actualizas el período de observación para estadísticas de reglas demasiado permisivas, las Estadísticas de firewall pueden tardar hasta 48 horas en actualizar los resultados existentes. Mientras tanto, el período de observación de los resultados existentes coincide con el período de observación configurado antes.
Para las estadísticas demasiado permisivas, si la estadística no identificó reglas de firewall, Estadísticas de firewall no muestra el período de observación para identificar las estadísticas que se usaron.
Las estadísticas de reglas bloqueadas no tienen un período de observación porque no evalúan los datos históricos. El análisis de reglas bloqueadas evalúa tu configuración de regla de firewall existente cada 24 horas.
Es posible que no se incluyan datos de registro de tráfico de las últimas 24 horas cuando se generan estadísticas.
Console
Para configurar un período de observación, haz lo siguiente:
En la consola de Google Cloud , ve a la página Estadísticas de firewall.
Según corresponda, configura la lista desplegable Período de observación en el momento adecuado para cada uno de los siguientes elementos:
Estadísticas de reglas demasiado permisivas
Estadísticas de reglas de denegación
API
Si deseas configurar el período de observación de las reglas deny con hits, debes usar la consola deGoogle Cloud . Sin embargo, puedes usar la API de recomendador a fin de configurar el período de observación para estadísticas de reglas demasiado permisivas. También puedes usar la API para habilitar las estadísticas y recuperar los detalles de la configuración.
Para establecer el período de observación de las estadísticas de reglas demasiado permisivas, usa el método updateConfig.
Para usar el método updateConfig, establece valores para todos sus parámetros. También debes especificar si las estadísticas de regla bloqueada y las estadísticas de reglas demasiado permisivas están habilitadas o inhabilitadas.
Para realizar este tipo de actualización, usa la siguiente solicitud.
Para recuperar detalles sobre cómo se configuran las Estadísticas de firewall, usa el método getConfig, como se muestra en el siguiente ejemplo.
GET https://recommender.googleapis.com/v1beta1/projects/PROJECT_ID/locations/global/insightTypes/google.compute.firewall.Insight/config
Programa un ciclo de actualización personalizado
Configura un ciclo de actualización para generar estadísticas de regla bloqueada para tu proyecto.
Puedes programar el ciclo de actualización para que comience en una fecha específica y personalizar la frecuencia del ciclo. La frecuencia de ciclo predeterminada es de un día (24 horas).
Console
Sigue estos pasos para configurar un ciclo de actualización personalizado para las estadísticas:
En la consola de Google Cloud , ve a la página Estadísticas de firewall.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[],[],null,["# Set up observation period and refresh cycle\n\nThis page describes how to configure an observation period and a refresh cycle in\nFirewall Insights.\n\nFor an overview of the available insights, see\n[Firewall Insights categories and states](/network-intelligence-center/docs/firewall-insights/concepts/insights-categories-states).\n\nFor a list of firewall usage metrics, see\n[View Firewall Insights metrics](/network-intelligence-center/docs/firewall-insights/how-to/view-metrics).\n\nRequired roles and permissions\n------------------------------\n\n\nTo get the permission that\nyou need to configure observation period and refresh cycle,\n\nask your administrator to grant you the\n\n\n[Firewall Recommender Admin](/iam/docs/roles-permissions/recommender#recommender.firewallAdmin) (`roles/recommender.firewallAdmin`)\nIAM role on your project.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nThis predefined role contains the\n` recommender.computeFirewallInsightTypeConfigs.update`\npermission,\nwhich is required to\nconfigure observation period and refresh cycle.\n\n\nYou might also be able to get\nthis permission\nwith [custom roles](/iam/docs/creating-custom-roles) or\nother [predefined roles](/iam/docs/roles-overview#predefined).\n\nConfigure observation period\n----------------------------\n\nFor some insights, you can configure an *observation period* ---the time interval\nthe insight covers. For example, you can configure the observation period for\noverly permissive and `deny` rule insights. The default observation window is\nsix weeks, and you can configure the observation period between seven\ndays to one year.\n\nFor example, if you set the observation period for `deny` rule insights\nto two months, when you review the list of `deny` rules with\nhits after the observation period, Firewall Insights shows you\nonly those that had hits during the past two months. Suppose\nyou later change the observation period to one month; Firewall Insights\nmight identify a different number of rules because it would analyze a\nshorter time interval.\n\nWhen reviewing insights and configuring observation periods, be aware of the\nfollowing:\n\n- When you configure the observation period for `deny` rules with hits,\n Firewall Insights updates the insight results immediately.\n\n- When you update the observation period for overly permissive rule insights,\n Firewall Insights can take up to 48 hours to update\n existing results. In the interim, the observation period for existing\n results matches the previously configured observation period.\n\n- For overly permissive insights, if the insight identified no firewall rules,\n Firewall Insights does not display the observation period\n to identify the insights used.\n\n- Shadowed rule insights do not have an observation period because they do not\n evaluate historical data. Shadowed rule analysis evaluates your existing\n firewall rule configuration every 24 hours.\n\n- Traffic log data from the last 24 hours might not be included when\n generating insights.\n\n### Console\n\nConfigure an observation period:\n\n1. In the Google Cloud console, go to the **Firewall Insights** page.\n\n [Go to Firewall Insights](https://console.cloud.google.com/net-intelligence/firewalls)\n2. Click **Configuration**.\n\n3. Click **Observation period**.\n\n4. As appropriate, set the **Observation period** drop-down list to the\n appropriate time for each of the following:\n\n - **Overly permissive rule insights**\n\n - **Deny rule insights**\n\n### API\n\nTo set the observation period for `deny` rules with hits, you must use the\nGoogle Cloud console. However, you can use the Recommender API to set\nthe observation period for overly permissive rule insights. You can also use\nthe API to enable insights and to retrieve configuration details.\n\nTo set the observation period for overly permissive rules insights, use the\n[`updateConfig` method](/recommender/docs/reference/rest/v1beta1/projects.locations.insightTypes/updateConfig).\n\nTo use the `updateConfig` method, set values for all of its\nparameters. Also specify whether shadowed rule insights\nand overly permissive rule insights are enabled or disabled.\n\nTo make this type of update, use the following request. \n\n```\n PATCH https://recommender.googleapis.com/v1beta1/projects/PROJECT_ID/locations/global/insightTypes/google.compute.firewall.Insight/config\n {\n \"name\": \"projects/PROJECT_ID/locations/global/insightTypes/google.compute.firewall.Insight/config\",\n \"insightTypeGenerationConfig\": {\n \"params\": {\n \"observation_period\": \"OBSERVATION_PERIOD_OVERLY_PERMISSIVE\",\n \"enable_shadowed_rule_insights\": ENABLEMENT_SHADOWED,\n \"enable_overly_permissive_rule_insights\": ENABLEMENT_OVERLY_PERMISSIVE\n }\n },\n \"etag\": \"\\\"ETAG\\\"\",\n }\n```\n\nReplace the following values:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of your project\n- \u003cvar translate=\"no\"\u003eOBSERVATION_PERIOD_OVERLY_PERMISSIVE\u003c/var\u003e: the time, in seconds, of the observation period for overly permissive rules insights\n- \u003cvar translate=\"no\"\u003eENABLEMENT_SHADOWED\u003c/var\u003e: a boolean value that represents whether shadowed rule insights are enabled\n- \u003cvar translate=\"no\"\u003eENABLEMENT_OVERLY_PERMISSIVE\u003c/var\u003e: a boolean value that represents whether overly permissive rule insights are enabled\n- \u003cvar translate=\"no\"\u003eETAG\u003c/var\u003e: the [IAM policy etag](/iam/docs/policies) value; to retrieve the etag value, use the `getConfig` method, as described in the following section\n\n#### Example\n\n```\n PATCH https://recommender.googleapis.com/v1beta1/projects/PROJECT_ID/locations/global/insightTypes/google.compute.firewall.Insight/config\n {\n \"name\": \"projects/PROJECT_ID/locations/global/insightTypes/google.compute.firewall.Insight/config\",\n \"insightTypeGenerationConfig\": {\n \"params\": {\n \"observation_period\": \"604800s\",\n \"enable_shadowed_rule_insights\": true,\n \"enable_overly_permissive_rule_insights\": true\n }\n },\n \"etag\": \"\\\"ETAG\\\"\",\n }\n```\n\n#### Retrieve configuration details\n\n\nTo retrieve details about how Firewall Insights is configured, use the\n[`getConfig` method](/recommender/docs/reference/rest/v1beta1/projects.locations.insightTypes/getConfig)\nas shown in the following example. \n\n```\n GET https://recommender.googleapis.com/v1beta1/projects/PROJECT_ID/locations/global/insightTypes/google.compute.firewall.Insight/config\n```\n\nSchedule a custom refresh cycle\n-------------------------------\n\nSet up a refresh cycle to generate shadowed rule insights for your project.\n\nYou can schedule the refresh cycle to begin on a specified date and customize\nthe cycle frequency. The default cycle frequency is one day (24 hours). \n\n### Console\n\nConfigure a custom refresh cycle for insights:\n\n1. In the Google Cloud console, go to the **Firewall Insights** page.\n\n [Go to Firewall Insights](https://console.cloud.google.com/net-intelligence/firewalls)\n2. Click **Configuration**.\n\n3. Click **Enablement**.\n\n4. To enable shadowed rule insights, click the toggle.\n\n5. In the **Start on** field, enter a date from which the custom refresh\n cycle starts.\n\n6. In the **Repeat every** field, select the frequency for the refresh\n cycle starting from the cycle start date:\n\n - **day**: every 24 hours\n - **week**: every week on the days you select\n - **month**: every month\n - **quarter**: every quarter\n\n The new insight generation schedule takes effect 24 hours after saving\n changes to the schedule.\n\nWhat's next\n-----------\n\n- [View and understand Firewall Insights](/network-intelligence-center/docs/firewall-insights/how-to/view-understand-insights)\n- [Review and optimize firewall rules](/network-intelligence-center/docs/firewall-insights/how-to/review-optimize)"]]