Per ottenere l'autorizzazione necessaria per configurare il periodo di osservazione e il ciclo di aggiornamento, chiedi all'amministratore di concederti il ruolo IAM Firewall Recommender Admin (roles/recommender.firewallAdmin) sul progetto.
Per saperne di più sulla concessione dei ruoli, consulta Gestisci l'accesso a progetti, cartelle e organizzazioni.
Questo ruolo predefinito contiene l'autorizzazione
recommender.computeFirewallInsightTypeConfigs.update
necessaria per
configurare il periodo di osservazione e il ciclo di aggiornamento.
Per alcuni insight, puoi configurare un periodo di osservazione, ovvero l'intervallo di tempo
coperto dall'insight. Ad esempio, puoi configurare il periodo di osservazione per gli insight sulle regole eccessivamente permissive e deny. La finestra di osservazione predefinita è di sei settimane e puoi configurare il periodo di osservazione tra sette giorni e un anno.
Ad esempio, se imposti il periodo di osservazione per gli approfondimenti sulle regole deny
su due mesi, quando esamini l'elenco delle regole deny con
corrispondenze dopo il periodo di osservazione, Firewall Insights mostra solo quelle che hanno avuto corrispondenze negli ultimi due mesi. Supponiamo
che in un secondo momento tu modifichi il periodo di osservazione in un mese. Firewall Insights
potrebbe identificare un numero diverso di regole perché analizzerebbe un
intervallo di tempo più breve.
Quando esamini gli approfondimenti e configuri i periodi di osservazione, tieni presente quanto segue:
Quando configuri il periodo di osservazione per le regole deny con corrispondenze, Firewall Insights aggiorna immediatamente i risultati degli insight.
Quando aggiorni il periodo di osservazione per gli insight sulle regole eccessivamente permissive,
Firewall Insights può richiedere fino a 48 ore per aggiornare
i risultati esistenti. Nel frattempo, il periodo di osservazione per i risultati esistenti
corrisponde a quello configurato in precedenza.
Per gli insight eccessivamente permissivi, se l'insight non ha identificato regole firewall, Firewall Insights non mostra il periodo di osservazione per identificare gli insight utilizzati.
Gli insight sulle regole oscurate non hanno un periodo di osservazione perché non valutano i dati storici. L'analisi delle regole con shadowing valuta la configurazione delle regole firewall esistenti ogni 24 ore.
I dati dei log del traffico delle ultime 24 ore potrebbero non essere inclusi durante la generazione degli approfondimenti.
Console
Configura un periodo di osservazione:
Nella console Google Cloud , vai alla pagina Firewall Insights.
Se necessario, imposta l'elenco a discesa Periodo di osservazione sull'ora
appropriata per ciascuno dei seguenti elementi:
Insight sulle regole eccessivamente permissive
Insight sulle regole di negazione
API
Per impostare il periodo di osservazione per le regole deny con hit, devi utilizzare la
consoleGoogle Cloud . Tuttavia, puoi utilizzare l'API Recommender per impostare
il periodo di osservazione per gli insight sulle regole eccessivamente permissive. Puoi anche utilizzare
l'API per attivare gli approfondimenti e recuperare i dettagli di configurazione.
Per impostare il periodo di osservazione per gli insight sulle regole eccessivamente permissive, utilizza il metodo updateConfig.
Per utilizzare il metodo updateConfig, imposta i valori per tutti i relativi parametri. Specifica anche se gli insight regola oscurata
e gli insight sulle regole eccessivamente permissive sono abilitati o disabilitati.
Per eseguire questo tipo di aggiornamento, utilizza la seguente richiesta.
Per recuperare i dettagli sulla configurazione di Firewall Insights, utilizza il
metodo getConfig
come mostrato nell'esempio seguente.
GET https://recommender.googleapis.com/v1beta1/projects/PROJECT_ID/locations/global/insightTypes/google.compute.firewall.Insight/config
Pianificare un ciclo di aggiornamento personalizzato
Configura un ciclo di aggiornamento per generare approfondimenti regola oscurata per il tuo progetto.
Puoi programmare l'inizio del ciclo di aggiornamento in una data specifica e personalizzare la frequenza del ciclo. La frequenza del ciclo predefinita è un giorno (24 ore).
Console
Configura un ciclo di aggiornamento personalizzato per gli approfondimenti:
Nella console Google Cloud , vai alla pagina Firewall Insights.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 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)"]]