Visão geral da migração das regras de firewall da VPC
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
As regras de firewall da nuvem privada virtual (VPC) se aplicam a uma única rede
VPC. Para ter um controle mais preciso sobre o tráfego enviado ou recebido pelas instâncias de máquina virtual (VM) na sua rede VPC, us etags de rede ou contas de serviço nas regras de firewall da VPC. No entanto, as regras de firewall da VPC têm as seguintes limitações:
Sem edição em lote: as regras de firewall da VPC são aplicadas
por regra e editadas individualmente, o que pode ser um processo ineficiente.
Controle limitado do Identity and Access Management (IAM): as tags de rede não oferecem os
controles avançados do IAM necessários para uma segmentação de tráfego estrita.
Para lidar com as limitações das regras de firewall da VPC, o Cloud Next Generation Firewall oferece suporte a políticas de firewall de rede globais e regionais. É possível definir e aplicar políticas de firewall de rede a várias
redes VPC em várias regiões. Essas políticas também oferecem suporte a tags seguras controladas pelo IAM que permitem aplicar um controle granular no nível da VM para uma microssegmentação segura e confiável de todos os tipos de tráfego de rede.
Para controlar o acesso à sua rede VPC, migre as regras de firewall da VPC atuais para uma política de firewall de rede global e aproveite os recursos das políticas de firewall de rede.
Benefícios da migração de regras de firewall da VPC para uma política de firewall de rede
Uma política de firewall de rede oferece uma experiência consistente em toda a
hierarquia de recursos doGoogle Cloud e vários benefícios operacionais em relação às
regras de firewall da VPC.
Fornece segurança granular e controle de acesso usando tags
regidas pelo IAM. Google Cloud permite anexar tags separadas a cada
interface de rede de uma VM. Com base nas tags, é possível definir regras da política de firewall para restringir o acesso não autorizado aos recursos e ao tráfego de carga de trabalho. Assim, você tem um nível mais alto de controle sobre os recursos, o que ajuda a garantir um ambiente de autoatendimento e privilégio mínimo para cada grupo de usuários ou aplicativo. As regras de firewall da VPC usam tags de rede, que não são compatíveis com o controle de acesso do IAM.
Permite o gerenciamento simplificado de regras. As políticas de firewall de rede são compatíveis
com a edição em lote, o que permite editar várias regras em uma única política.
As regras de firewall da VPC operam apenas no nível da regra.
Facilita as operações. As políticas de firewall de rede são compatíveis com o uso de recursos, como objetos de nome de domínio totalmente qualificado (FQDN, na sigla em inglês), objetos de geolocalização, detecção de ameaças, prevenção de invasões, e grupos de endereços.
As regras de firewall da VPC não são compatíveis com esses recursos avançados.
Oferece suporte à residência de dados flexível. As políticas de firewall de rede podem ser
aplicadas a várias regiões ou a uma única região de uma rede.
As regras de firewall da VPC só podem ser aplicadas globalmente.
Ferramenta de migração de regras de firewall da VPC
A ferramenta de migração de regras de firewall da VPC pode migrar
automaticamente as regras de firewall da VPC para uma política de firewall de rede global. É um utilitário de linha de comando que pode ser acessado usando a Google Cloud CLI.
Especificações
A ferramenta de migração cria uma política de firewall de rede global, converte as
regras de firewall atuais da VPC em regras de política de firewall e
adiciona as novas regras à política.
Se duas ou mais regras de firewall da VPC tiverem a mesma prioridade, a ferramenta de migração atualizará automaticamente as prioridades da regra para evitar qualquer sobreposição.
Uma regra com uma ação deny tem uma prioridade maior do que uma regra com uma ação allow.
Durante a atualização das prioridades, a ferramenta preserva a sequência relativa das
regras de firewall da VPC originais.
Por exemplo, se você tiver quatro regras de firewall da VPC com prioridade 1000 e uma quinta regra com prioridade 2000, a ferramenta de migração vai atribuir um número de prioridade exclusivo às quatro primeiras regras com a sequência 1000, 1001, 1002 e 1003. A quinta regra com a
prioridade 2000 recebe uma nova prioridade exclusiva de 1004. Isso garante que as novas prioridades das quatro primeiras regras sejam maiores do que as de todas as regras com prioridade menor que 1000.
Se as regras de firewall da VPC tiverem dependências, como tags
de rede ou contas de serviço, a ferramenta de migração poderá aproveitar as
tags controladas pelo IAM que servem para substituir essas
tags de rede e contas de serviço.
Se a rede VPC tiver regras de firewall da VPC e uma política de firewall de rede associada, a ferramenta de migração moverá as regras de firewall da VPC compatíveis e as regras da política de firewall de rede para a nova política de firewall de rede global.
A ferramenta de migração preserva as configurações de registro das regras de firewall
da VPC. Se uma regra de firewall da VPC tiver a geração de registros ativada,
a ferramenta de migração a manterá ativada. Se a geração de registros estiver desativada, a ferramenta de migração a manterá dessa mesma forma.
A ferramenta de migração gera apenas a política de firewall de rede global. A
ferramenta não exclui as regras de firewall da VPC atuais nem associa
a nova política de firewall de rede global à rede VPC
necessária. É preciso associar manualmente a política de firewall de rede global à rede VPC
necessária e, em seguida, remover a associação
entre as regras de firewall da VPC e a rede
VPC.
Depois de associar a política de firewall de rede global à rede VPC
necessária, é possível desativar as regras de firewall da VPC
se as regras da política na política de firewall de rede global estiverem funcionando
conforme o esperado.
Se necessário, é possível associar a nova política de firewall de rede global, além de regras de firewall da VPC à mesma rede VPC, porque as regras são aplicadas de acordo com a ordem de avaliação da política e da regra.
No entanto, recomendamos desativar as regras de firewall da VPC.
Cenários de migração
Considere as seguintes situações ao migrar suas regras de firewall da VPC para uma política de firewall de rede global:
Confira no diagrama a seguir o fluxo de trabalho de migração para as combinações de configurações
anteriores. Escolha o fluxo de trabalho que corresponda aos seus requisitos de rede.
Figura 1. Fluxo de migração de regras de firewall da VPC (clique para ampliar).
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-04 UTC."],[[["\u003cp\u003eVPC firewall rules are limited to a single VPC network and lack batch editing capabilities and robust IAM controls, unlike network firewall policies.\u003c/p\u003e\n"],["\u003cp\u003eNetwork firewall policies offer enhanced control through IAM-governed secure tags, allowing for detailed micro-segmentation of network traffic at the VM level.\u003c/p\u003e\n"],["\u003cp\u003eNetwork firewall policies enable simplified management through batch editing, along with advanced features like FQDN and geolocation objects, which are not supported by VPC firewall rules.\u003c/p\u003e\n"],["\u003cp\u003eThe VPC firewall rules migration tool facilitates the conversion of existing VPC firewall rules into a global network firewall policy, automatically managing priorities and preserving log settings.\u003c/p\u003e\n"],["\u003cp\u003eMigrating to a global network firewall policy allows for greater flexibility in data residency, as it can be applied to multiple or single regions, whereas VPC firewall rules are applied globally.\u003c/p\u003e\n"]]],[],null,["# VPC firewall rules migration overview\n\nVirtual Private Cloud (VPC) firewall rules apply to a single VPC\nnetwork. To have finer control over the traffic sent or received by the virtual\nmachine (VM) instances in your VPC network, you can use\n[network tags](/vpc/docs/add-remove-network-tags) or [service accounts](/iam/docs/service-account-overview)\nin the VPC firewall rules. However, VPC firewall\nrules have the following limitations:\n\n- **No batch editing**: VPC firewall rules are applied on a\n per-rule basis and must be edited individually, which can be inefficient.\n\n- **Limited Identity and Access Management (IAM) control**: Network tags don't offer the\n robust IAM controls needed for strict traffic segmentation.\n\nTo address the limitations of VPC firewall rules,\nCloud Next Generation Firewall supports global and regional network firewall\npolicies. You can define and apply network firewall policies to multiple\nVPC networks across multiple regions. These policies also support\nIAM-governed [secure tags](/firewall/docs/tags-firewalls-overview) that let you enforce granular\ncontrol at the VM level for safe and reliable micro-segmentation of all types of\nnetwork traffic.\n\nFor more information, see [Benefits of migrating VPC firewall rules to a network firewall policy](#benefits).\n\nTo control access to your VPC network, you can migrate your existing VPC firewall rules to a global network firewall policy to take advantage of the capabilities of network firewall policies.\n\nBenefits of migrating VPC firewall rules to a network firewall policy\n---------------------------------------------------------------------\n\nA network firewall policy delivers a consistent firewall experience across the\nGoogle Cloud resource hierarchy and offers multiple operational benefits over\nVPC firewall rules.\n\n- **Provides granular security and access control by using IAM\n governed Tags**. Google Cloud lets you attach separate Tags to each\n network interface of a VM. Based on the Tags, you can define your firewall\n policy rules to restrict unauthorized access to your resources and workload\n traffic. So, you gain a finer level of control over your resources, which\n helps to ensure a least-privilege, self-service environment for each user\n group or application. VPC firewall rules use network tags,\n which don't support IAM access control.\n\n- **Enables simplified rule management**. Network firewall policies support\n batch editing, which lets you edit multiple rules within a single policy.\n VPC firewall rules operate only at a per-rule level.\n\n- **Provides ease of operations**. Network firewall policies support the use\n of features, such as fully qualified domain name (FQDN) objects,\n geolocation objects, threat detection, intrusion prevention, and address groups.\n VPC firewall rules don't support these advanced features.\n\n- **Supports flexible data residency**. Network firewall policies can be\n applied to either multiple regions or a single region of a network.\n VPC firewall rules can only be applied globally.\n\nVPC firewall rules migration tool\n---------------------------------\n\nThe VPC firewall rules migration tool can automatically migrate\nVPC firewall rules to a global network firewall policy. The tool\nis a command-line utility that you can access using the Google Cloud CLI.\n\n### Specifications\n\n- The migration tool creates a global network firewall policy, converts the\n existing VPC firewall rules into firewall policy rules, and\n adds the new rules to the policy.\n\n- If two or more VPC firewall rules have the same priority, the\n migration tool automatically updates the rule priorities to avoid any overlap.\n A rule with a `deny` action is given a higher priority than a rule with an `allow` action.\n While updating the priorities, the tool preserves the relative sequence of the\n original VPC firewall rules.\n\n For example, if you have four VPC firewall rules with a priority\n of `1000` and a fifth rule with a priority of `2000`, the migration tool\n assigns a unique priority number to the first four rules with the\n sequence---`1000`, `1001`, `1002`, and `1003`. The fifth rule with the\n priority of `2000` is assigned a new unique priority of `1004`. This ensures\n that the new priorities for the first four rules are higher than that of all\n rules that have priority lower than `1000`.\n | **Note:** Before you attach the new global network firewall policy to a VPC network, review the new priorities and make sure that the automatically generated priorities align with your original VPC network configuration.\n- If your VPC firewall rules contain dependencies, such as network\n tags or service accounts, the migration tool can take advantage of\n IAM-governed Tags that serve as a replacement to those network\n tags and services accounts.\n\n- If your VPC network contains VPC firewall\n rules and an associated network firewall policy, the migration tool moves\n the compatible VPC firewall rules as well as the network\n firewall policy rules to the new global network firewall policy.\n\n- The migration tool preserves the log settings of the existing VPC\n firewall rules. If a VPC firewall rule has logging turned on,\n the migration tool keeps it on. If logging is off, the migration tool keeps it turned off.\n\n- The migration tool generates the global network firewall policy only. The\n tool does not delete existing VPC firewall rules or associate\n the new global network firewall policy with the required VPC\n network. You must manually associate the global network firewall policy with\n the required VPC network, and then remove the association\n between the VPC firewall rules and the VPC\n network.\n\n- After you associate the global network firewall policy with the required\n VPC network, you can disable the VPC firewall\n rules if the policy rules in the global network firewall policy are working\n as intended.\n\n If necessary, you can associate the new global network firewall policy as well\n as the VPC firewall rules with the same VPC\n network because the rules are applied according to the [policy and rule\n evaluation order](/vpc/docs/firewall-policies-overview#rule-evaluation).\n However, we recommend you disable the VPC firewall rules.\n\nMigration scenarios\n-------------------\n\nConsider the following scenarios when you migrate your VPC firewall\nrules to a global network firewall policy:\n\n- [VPC firewall rules don't contain network tags or service accounts](/firewall/docs/migrate-firewall-rules-no-dependencies).\n- [VPC firewall rules contain network tags or target service accounts, or both](/firewall/docs/migrate-firewall-rules-with-dependencies).\n\nThe following diagram shows the migration workflow for the preceding configuration\ncombinations. Choose the workflow that matches your network requirements.\n[](/static/firewall/images/vpc-rules-migration.png) **Figure 1.** VPC firewall rules migration flow (click to enlarge).\n\nWhat's next\n-----------\n\n- [Migrate VPC firewall rules that don't use network tags and service accounts](/firewall/docs/migrate-firewall-rules-no-dependencies)\n- [Migrate VPC firewall rules that use network tags and service accounts](/firewall/docs/migrate-firewall-rules-with-dependencies)"]]