[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78QQTT1DTQMQT4VAD9P99T2":3,"skill-same:01M78QQTT1DTQMQT4VAD9P99T2":75},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":39,"repositoryHtmlUrl":40,"repositoryHomepageUrl":6,"ownerHtmlUrl":41,"ownerBlogUrl":42,"ownerDescription":43,"updatedAt":44,"install":45,"resources":58},"01M78QQTT1DTQMQT4VAD9P99T2","implementing-gcp-vpc-firewall-rules",null,"Implementing and auditing GCP VPC firewall rules to enforce network segmentation, restrict ingress and egress traffic, apply hierarchical firewall policies across the organization, and monitor firewall rule effectiveness using VPC Flow Logs.","jukeyman\u002Fjukeyman-skills","jukeyman","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F142960420?v=4","01M78FR4Y3DHMMCBCC0GXXNB3F","RICK JEFFERSON","01M78FR4Z8RVQRAD31Y5J7V6EB",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fimplementing-gcp-vpc-firewall-rules\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fimplementing-gcp-vpc-firewall-rules\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: implementing-gcp-vpc-firewall-rules\ndescription: >\n  Implementing and auditing GCP VPC firewall rules to enforce network segmentation,\n  restrict ingress and egress traffic, apply hierarchical firewall policies across\n  the organization, and monitor firewall rule effectiveness using VPC Flow Logs.\ndomain: cybersecurity\nsubdomain: cloud-security\ntags: [cloud-security, gcp, vpc, firewall-rules, network-security, segmentation]\nversion: \"1.0\"\nauthor: mahipal\nlicense: Apache-2.0\n---\n\n# Implementing GCP VPC Firewall Rules\n\n## When to Use\n\n- When deploying new GCP workloads that require network-level access controls\n- When auditing existing firewall configurations for overly permissive rules\n- When implementing zero trust network segmentation within GCP VPC networks\n- When responding to Security Command Center findings about open firewall rules\n- When building hierarchical firewall policies across a GCP organization\n\n**Do not use** for application-layer filtering (use Cloud Armor WAF), for DNS-based filtering (use Cloud DNS response policies), or for VPN\u002Finterconnect traffic filtering without understanding that VPC firewall rules apply to traffic within the VPC.\n\n## Prerequisites\n\n- GCP project with Compute Engine API enabled\n- IAM roles: `roles\u002Fcompute.securityAdmin` for firewall management, `roles\u002Fcompute.networkViewer` for auditing\n- Organization Admin role for hierarchical firewall policies\n- gcloud CLI authenticated with appropriate permissions\n- VPC Flow Logs enabled on target subnets for monitoring\n\n## Workflow\n\n### Step 1: Audit Existing Firewall Rules for Security Gaps\n\nEnumerate all firewall rules and identify overly permissive configurations.\n\n```bash\n# List all firewall rules in the project\ngcloud compute firewall-rules list \\\n  --format=\"table(name, network, direction, priority, allowed[].map().firewall_rule().list():label=ALLOWED, sourceRanges, targetTags)\"\n\n# Find rules allowing all traffic from 0.0.0.0\u002F0\ngcloud compute firewall-rules list \\\n  --filter=\"direction=INGRESS AND sourceRanges=0.0.0.0\u002F0\" \\\n  --format=\"table(name, network, allowed, priority, targetTags)\" \\\n  --sort-by=priority\n\n# Find rules allowing all protocols and ports\ngcloud compute firewall-rules list \\\n  --filter=\"direction=INGRESS AND allowed[].IPProtocol=all\" \\\n  --format=\"table(name, network, sourceRanges, targetTags)\"\n\n# Find rules with SSH (22) or RDP (3389) open to the internet\ngcloud compute firewall-rules list \\\n  --filter=\"direction=INGRESS AND sourceRanges=0.0.0.0\u002F0 AND (allowed[].ports=22 OR allowed[].ports=3389)\" \\\n  --format=\"table(name, network, allowed, sourceRanges)\"\n\n# Check for disabled rules\ngcloud compute firewall-rules list \\\n  --filter=\"disabled=true\" \\\n  --format=\"table(name, network, direction)\"\n```\n\n### Step 2: Create Restrictive Ingress Firewall Rules\n\nImplement least-privilege ingress rules using network tags and service accounts for targeting.\n\n```bash\n# Create rule allowing HTTPS from the internet to web servers only\ngcloud compute firewall-rules create allow-https-web \\\n  --network=production-vpc \\\n  --direction=INGRESS \\\n  --action=ALLOW \\\n  --rules=tcp:443 \\\n  --source-ranges=0.0.0.0\u002F0 \\\n  --target-tags=web-server \\\n  --priority=1000 \\\n  --description=\"Allow HTTPS to web servers from internet\"\n\n# Create rule allowing SSH only from bastion host subnet\ngcloud compute firewall-rules create allow-ssh-bastion \\\n  --network=production-vpc \\\n  --direction=INGRESS \\\n  --action=ALLOW \\\n  --rules=tcp:22 \\\n  --source-ranges=10.0.1.0\u002F24 \\\n  --target-tags=ssh-allowed \\\n  --priority=1000 \\\n  --description=\"Allow SSH only from bastion subnet\"\n\n# Create rule allowing internal communication between app tiers\ngcloud compute firewall-rules create allow-app-to-db \\\n  --network=production-vpc \\\n  --direction=INGRESS \\\n  --action=ALLOW \\\n  --rules=tcp:5432 \\\n  --source-tags=app-server \\\n  --target-tags=db-server \\\n  --priority=1000 \\\n  --description=\"Allow PostgreSQL from app tier to database tier\"\n\n# Create service-account-based rule (more secure than tags)\ngcloud compute firewall-rules create allow-api-internal \\\n  --network=production-vpc \\\n  --direction=INGRESS \\\n  --action=ALLOW \\\n  --rules=tcp:8080 \\\n  --source-service-accounts=api-client@project.iam.gserviceaccount.com \\\n  --target-service-accounts=api-server@project.iam.gserviceaccount.com \\\n  --priority=1000\n```\n\n### Step 3: Implement Egress Restrictions\n\nConfigure egress firewall rules to control outbound traffic and prevent data exfiltration.\n\n```bash\n# Deny all egress by default (low priority)\ngcloud compute firewall-rules create deny-all-egress \\\n  --network=production-vpc \\\n  --direction=EGRESS \\\n  --action=DENY \\\n  --rules=all \\\n  --destination-ranges=0.0.0.0\u002F0 \\\n  --priority=65534 \\\n  --description=\"Default deny all egress traffic\"\n\n# Allow egress to Google APIs via restricted VIP\ngcloud compute firewall-rules create allow-google-apis \\\n  --network=production-vpc \\\n  --direction=EGRESS \\\n  --action=ALLOW \\\n  --rules=tcp:443 \\\n  --destination-ranges=199.36.153.4\u002F30 \\\n  --priority=1000 \\\n  --description=\"Allow HTTPS to Google APIs restricted VIP\"\n\n# Allow DNS resolution\ngcloud compute firewall-rules create allow-dns-egress \\\n  --network=production-vpc \\\n  --direction=EGRESS \\\n  --action=ALLOW \\\n  --rules=udp:53,tcp:53 \\\n  --destination-ranges=169.254.169.254\u002F32,8.8.8.8\u002F32,8.8.4.4\u002F32 \\\n  --priority=1000 \\\n  --description=\"Allow DNS resolution to metadata and Google DNS\"\n\n# Allow egress to specific external services\ngcloud compute firewall-rules create allow-external-apis \\\n  --network=production-vpc \\\n  --direction=EGRESS \\\n  --action=ALLOW \\\n  --rules=tcp:443 \\\n  --destination-ranges=PARTNER_CIDR\u002F32 \\\n  --target-tags=api-client \\\n  --priority=1000\n```\n\n### Step 4: Deploy Hierarchical Firewall Policies\n\nCreate organization and folder-level firewall policies that apply across all projects.\n\n```bash\n# Create an organization-level firewall policy\ngcloud compute firewall-policies create \\\n  --organization=ORG_ID \\\n  --short-name=org-security-policy \\\n  --description=\"Organization-wide security firewall policy\"\n\n# Add rule to block known malicious IP ranges at org level\ngcloud compute firewall-policies rules create 100 \\\n  --firewall-policy=org-security-policy \\\n  --organization=ORG_ID \\\n  --direction=INGRESS \\\n  --action=deny \\\n  --src-ip-ranges=THREAT_INTEL_CIDR_1,THREAT_INTEL_CIDR_2 \\\n  --layer4-configs=all \\\n  --description=\"Block known malicious IPs organization-wide\"\n\n# Add rule to enforce HTTPS-only ingress at org level\ngcloud compute firewall-policies rules create 200 \\\n  --firewall-policy=org-security-policy \\\n  --organization=ORG_ID \\\n  --direction=INGRESS \\\n  --action=allow \\\n  --src-ip-ranges=0.0.0.0\u002F0 \\\n  --layer4-configs=tcp:443 \\\n  --description=\"Allow only HTTPS from external sources\"\n\n# Associate policy with the organization\ngcloud compute firewall-policies associations create \\\n  --firewall-policy=org-security-policy \\\n  --organization=ORG_ID\n```\n\n### Step 5: Enable VPC Flow Logs for Monitoring\n\nConfigure VPC Flow Logs to monitor traffic patterns and validate firewall rule effectiveness.\n\n```bash\n# Enable flow logs on a subnet\ngcloud compute networks subnets update production-subnet \\\n  --region=us-central1 \\\n  --enable-flow-logs \\\n  --logging-aggregation-interval=interval-5-sec \\\n  --logging-flow-sampling=1.0 \\\n  --logging-metadata=include-all\n\n# Query flow logs in Cloud Logging for denied traffic\ngcloud logging read '\n  resource.type=\"gce_subnetwork\"\n  AND jsonPayload.disposition=\"DENIED\"\n  AND timestamp>=\"2026-02-22T00:00:00Z\"\n' --limit=50 --format=json\n\n# Find traffic hitting overly permissive rules\ngcloud logging read '\n  resource.type=\"gce_subnetwork\"\n  AND jsonPayload.rule_details.reference:\"\u002Ffirewall-rules\u002Fdefault-allow-\"\n' --limit=100 --format=\"table(jsonPayload.connection.src_ip,jsonPayload.connection.dest_ip,jsonPayload.connection.dest_port)\"\n\n# Export flow logs to BigQuery for analysis\ngcloud logging sinks create vpc-flow-bq \\\n  bigquery.googleapis.com\u002Fprojects\u002FPROJECT\u002Fdatasets\u002Fvpc_flow_logs \\\n  --log-filter='resource.type=\"gce_subnetwork\"'\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| VPC Firewall Rule | Stateful network-level access control that allows or denies traffic to and from VM instances based on IP ranges, protocols, ports, and tags |\n| Hierarchical Firewall Policy | Organization or folder-level firewall policy that is evaluated before VPC-level rules and applies across all child projects |\n| Network Tag | Label applied to VM instances that determines which firewall rules apply, used for targeting ingress and egress rules |\n| Service Account Firewall Rule | Firewall rule that targets instances based on their attached service account, providing more secure targeting than mutable network tags |\n| VPC Flow Logs | Network telemetry captured at the subnet level that records traffic metadata for monitoring, forensics, and firewall rule validation |\n| Implied Rules | Default GCP firewall rules that allow egress to all destinations and deny ingress from all sources, with lowest priority (65535) |\n\n## Tools & Systems\n\n- **gcloud compute firewall-rules**: CLI commands for creating, listing, and managing VPC firewall rules in GCP\n- **Hierarchical Firewall Policies**: Organization and folder-level policies enforcing security controls across all projects\n- **VPC Flow Logs**: Subnet-level traffic logging for monitoring, troubleshooting, and validating firewall effectiveness\n- **Cloud Logging**: Query engine for analyzing VPC Flow Logs and firewall rule hit counts\n- **Security Command Center**: GCP-native security platform with findings for overly permissive firewall configurations\n\n## Common Scenarios\n\n### Scenario: Locking Down a Production VPC After Discovery of Overly Permissive Rules\n\n**Context**: A security audit reveals that the production VPC has default-allow rules permitting SSH from `0.0.0.0\u002F0` and unrestricted egress. SCC reports 14 firewall findings.\n\n**Approach**:\n1. Enumerate all existing rules with `gcloud compute firewall-rules list` and categorize by risk\n2. Enable VPC Flow Logs on all subnets to capture baseline traffic patterns for 7 days\n3. Analyze flow logs to identify legitimate traffic that needs explicit allow rules\n4. Create targeted ingress rules for each application tier (web: 443, app: 8080, db: 5432)\n5. Replace the SSH-from-anywhere rule with SSH-from-bastion-subnet-only\n6. Implement default-deny egress and add explicit allow rules for required outbound destinations\n7. Delete the overly permissive default-allow rules after verifying applications function correctly\n\n**Pitfalls**: Deleting firewall rules without understanding traffic patterns causes outages. Always enable flow logs and analyze traffic before removing rules. Network tags can be added by anyone with compute.instances.setTags permission, making them less secure than service-account-based targeting for critical rules.\n\n## Output Format\n\n```\nGCP VPC Firewall Audit Report\n================================\nProject: production-project\nVPC Network: production-vpc\nAudit Date: 2026-02-23\n\nRULE INVENTORY:\n  Total firewall rules: 34\n  Ingress rules: 22\n  Egress rules: 12\n  Disabled rules: 3\n\nCRITICAL FINDINGS:\n[FW-001] SSH Open to Internet\n  Rule: default-allow-ssh\n  Source: 0.0.0.0\u002F0 -> tcp:22\n  Target: All instances (no tags)\n  Priority: 65534\n  Remediation: Restrict to bastion subnet CIDR\n\n[FW-002] No Egress Restrictions\n  Issue: Only implied allow-all-egress rule exists\n  Risk: No controls on outbound data exfiltration\n  Remediation: Add default-deny egress and explicit allow rules\n\nREMEDIATION ACTIONS COMPLETED:\n  Rules deleted: 3 (overly permissive defaults)\n  Rules created: 8 (targeted allow rules)\n  Egress deny rule: Created at priority 65534\n  Flow logs enabled: 6 subnets\n```\n","# Implementing GCP VPC Firewall Rules\n\n## When to Use\n\n- When deploying new GCP workloads that require network-level access controls\n- When auditing existing firewall configurations for overly permissive rules\n- When implementing zero trust network segmentation within GCP VPC networks\n- When responding to Security Command Center findings about open firewall rules\n- When building hierarchical firewall policies across a GCP organization\n\n**Do not use** for application-layer filtering (use Cloud Armor WAF), for DNS-based filtering (use Cloud DNS response policies), or for VPN\u002Finterconnect traffic filtering without understanding that VPC firewall rules apply to traffic within the VPC.\n\n## Prerequisites\n\n- GCP project with Compute Engine API enabled\n- IAM roles: `roles\u002Fcompute.securityAdmin` for firewall management, `roles\u002Fcompute.networkViewer` for auditing\n- Organization Admin role for hierarchical firewall policies\n- gcloud CLI authenticated with appropriate permissions\n- VPC Flow Logs enabled on target subnets for monitoring\n\n## Workflow\n\n### Step 1: Audit Existing Firewall Rules for Security Gaps\n\nEnumerate all firewall rules and identify overly permissive configurations.\n\n```bash\n# List all firewall rules in the project\ngcloud compute firewall-rules list \\\n  --format=\"table(name, network, direction, priority, allowed[].map().firewall_rule().list():label=ALLOWED, sourceRanges, targetTags)\"\n\n# Find rules allowing all traffic from 0.0.0.0\u002F0\ngcloud compute firewall-rules list \\\n  --filter=\"direction=INGRESS AND sourceRanges=0.0.0.0\u002F0\" \\\n  --format=\"table(name, network, allowed, priority, targetTags)\" \\\n  --sort-by=priority\n\n# Find rules allowing all protocols and ports\ngcloud compute firewall-rules list \\\n  --filter=\"direction=INGRESS AND allowed[].IPProtocol=all\" \\\n  --format=\"table(name, network, sourceRanges, targetTags)\"\n\n# Find rules with SSH (22) or RDP (3389) open to the internet\ngcloud compute firewall-rules list \\\n  --filter=\"direction=INGRESS AND sourceRanges=0.0.0.0\u002F0 AND (allowed[].ports=22 OR allowed[].ports=3389)\" \\\n  --format=\"table(name, network, allowed, sourceRanges)\"\n\n# Check for disabled rules\ngcloud compute firewall-rules list \\\n  --filter=\"disabled=true\" \\\n  --format=\"table(name, network, direction)\"\n```\n\n### Step 2: Create Restrictive Ingress Firewall Rules\n\nImplement least-privilege ingress rules using network tags and service accounts for targeting.\n\n```bash\n# Create rule allowing HTTPS from the internet to web servers only\ngcloud compute firewall-rules create allow-https-web \\\n  --network=production-vpc \\\n  --direction=INGRESS \\\n  --action=ALLOW \\\n  --rules=tcp:443 \\\n  --source-ranges=0.0.0.0\u002F0 \\\n  --target-tags=web-server \\\n  --priority=1000 \\\n  --description=\"Allow HTTPS to web servers from internet\"\n\n# Create rule allowing SSH only from bastion host subnet\ngcloud compute firewall-rules create allow-ssh-bastion \\\n  --network=production-vpc \\\n  --direction=INGRESS \\\n  --action=ALLOW \\\n  --rules=tcp:22 \\\n  --source-ranges=10.0.1.0\u002F24 \\\n  --target-tags=ssh-allowed \\\n  --priority=1000 \\\n  --description=\"Allow SSH only from bastion subnet\"\n\n# Create rule allowing internal communication between app tiers\ngcloud compute firewall-rules create allow-app-to-db \\\n  --network=production-vpc \\\n  --direction=INGRESS \\\n  --action=ALLOW \\\n  --rules=tcp:5432 \\\n  --source-tags=app-server \\\n  --target-tags=db-server \\\n  --priority=1000 \\\n  --description=\"Allow PostgreSQL from app tier to database tier\"\n\n# Create service-account-based rule (more secure than tags)\ngcloud compute firewall-rules create allow-api-internal \\\n  --network=production-vpc \\\n  --direction=INGRESS \\\n  --action=ALLOW \\\n  --rules=tcp:8080 \\\n  --source-service-accounts=api-client@project.iam.gserviceaccount.com \\\n  --target-service-accounts=api-server@project.iam.gserviceaccount.com \\\n  --priority=1000\n```\n\n### Step 3: Implement Egress Restrictions\n\nConfigure egress firewall rules to control outbound traffic and prevent data exfiltration.\n\n```bash\n# Deny all egress by default (low priority)\ngcloud compute firewall-rules create deny-all-egress \\\n  --network=production-vpc \\\n  --direction=EGRESS \\\n  --action=DENY \\\n  --rules=all \\\n  --destination-ranges=0.0.0.0\u002F0 \\\n  --priority=65534 \\\n  --description=\"Default deny all egress traffic\"\n\n# Allow egress to Google APIs via restricted VIP\ngcloud compute firewall-rules create allow-google-apis \\\n  --network=production-vpc \\\n  --direction=EGRESS \\\n  --action=ALLOW \\\n  --rules=tcp:443 \\\n  --destination-ranges=199.36.153.4\u002F30 \\\n  --priority=1000 \\\n  --description=\"Allow HTTPS to Google APIs restricted VIP\"\n\n# Allow DNS resolution\ngcloud compute firewall-rules create allow-dns-egress \\\n  --network=production-vpc \\\n  --direction=EGRESS \\\n  --action=ALLOW \\\n  --rules=udp:53,tcp:53 \\\n  --destination-ranges=169.254.169.254\u002F32,8.8.8.8\u002F32,8.8.4.4\u002F32 \\\n  --priority=1000 \\\n  --description=\"Allow DNS resolution to metadata and Google DNS\"\n\n# Allow egress to specific external services\ngcloud compute firewall-rules create allow-external-apis \\\n  --network=production-vpc \\\n  --direction=EGRESS \\\n  --action=ALLOW \\\n  --rules=tcp:443 \\\n  --destination-ranges=PARTNER_CIDR\u002F32 \\\n  --target-tags=api-client \\\n  --priority=1000\n```\n\n### Step 4: Deploy Hierarchical Firewall Policies\n\nCreate organization and folder-level firewall policies that apply across all projects.\n\n```bash\n# Create an organization-level firewall policy\ngcloud compute firewall-policies create \\\n  --organization=ORG_ID \\\n  --short-name=org-security-policy \\\n  --description=\"Organization-wide security firewall policy\"\n\n# Add rule to block known malicious IP ranges at org level\ngcloud compute firewall-policies rules create 100 \\\n  --firewall-policy=org-security-policy \\\n  --organization=ORG_ID \\\n  --direction=INGRESS \\\n  --action=deny \\\n  --src-ip-ranges=THREAT_INTEL_CIDR_1,THREAT_INTEL_CIDR_2 \\\n  --layer4-configs=all \\\n  --description=\"Block known malicious IPs organization-wide\"\n\n# Add rule to enforce HTTPS-only ingress at org level\ngcloud compute firewall-policies rules create 200 \\\n  --firewall-policy=org-security-policy \\\n  --organization=ORG_ID \\\n  --direction=INGRESS \\\n  --action=allow \\\n  --src-ip-ranges=0.0.0.0\u002F0 \\\n  --layer4-configs=tcp:443 \\\n  --description=\"Allow only HTTPS from external sources\"\n\n# Associate policy with the organization\ngcloud compute firewall-policies associations create \\\n  --firewall-policy=org-security-policy \\\n  --organization=ORG_ID\n```\n\n### Step 5: Enable VPC Flow Logs for Monitoring\n\nConfigure VPC Flow Logs to monitor traffic patterns and validate firewall rule effectiveness.\n\n```bash\n# Enable flow logs on a subnet\ngcloud compute networks subnets update production-subnet \\\n  --region=us-central1 \\\n  --enable-flow-logs \\\n  --logging-aggregation-interval=interval-5-sec \\\n  --logging-flow-sampling=1.0 \\\n  --logging-metadata=include-all\n\n# Query flow logs in Cloud Logging for denied traffic\ngcloud logging read '\n  resource.type=\"gce_subnetwork\"\n  AND jsonPayload.disposition=\"DENIED\"\n  AND timestamp>=\"2026-02-22T00:00:00Z\"\n' --limit=50 --format=json\n\n# Find traffic hitting overly permissive rules\ngcloud logging read '\n  resource.type=\"gce_subnetwork\"\n  AND jsonPayload.rule_details.reference:\"\u002Ffirewall-rules\u002Fdefault-allow-\"\n' --limit=100 --format=\"table(jsonPayload.connection.src_ip,jsonPayload.connection.dest_ip,jsonPayload.connection.dest_port)\"\n\n# Export flow logs to BigQuery for analysis\ngcloud logging sinks create vpc-flow-bq \\\n  bigquery.googleapis.com\u002Fprojects\u002FPROJECT\u002Fdatasets\u002Fvpc_flow_logs \\\n  --log-filter='resource.type=\"gce_subnetwork\"'\n```\n\n## Key Concepts\n\n| Term | Definition |\n|------|------------|\n| VPC Firewall Rule | Stateful network-level access control that allows or denies traffic to and from VM instances based on IP ranges, protocols, ports, and tags |\n| Hierarchical Firewall Policy | Organization or folder-level firewall policy that is evaluated before VPC-level rules and applies across all child projects |\n| Network Tag | Label applied to VM instances that determines which firewall rules apply, used for targeting ingress and egress rules |\n| Service Account Firewall Rule | Firewall rule that targets instances based on their attached service account, providing more secure targeting than mutable network tags |\n| VPC Flow Logs | Network telemetry captured at the subnet level that records traffic metadata for monitoring, forensics, and firewall rule validation |\n| Implied Rules | Default GCP firewall rules that allow egress to all destinations and deny ingress from all sources, with lowest priority (65535) |\n\n## Tools & Systems\n\n- **gcloud compute firewall-rules**: CLI commands for creating, listing, and managing VPC firewall rules in GCP\n- **Hierarchical Firewall Policies**: Organization and folder-level policies enforcing security controls across all projects\n- **VPC Flow Logs**: Subnet-level traffic logging for monitoring, troubleshooting, and validating firewall effectiveness\n- **Cloud Logging**: Query engine for analyzing VPC Flow Logs and firewall rule hit counts\n- **Security Command Center**: GCP-native security platform with findings for overly permissive firewall configurations\n\n## Common Scenarios\n\n### Scenario: Locking Down a Production VPC After Discovery of Overly Permissive Rules\n\n**Context**: A security audit reveals that the production VPC has default-allow rules permitting SSH from `0.0.0.0\u002F0` and unrestricted egress. SCC reports 14 firewall findings.\n\n**Approach**:\n1. Enumerate all existing rules with `gcloud compute firewall-rules list` and categorize by risk\n2. Enable VPC Flow Logs on all subnets to capture baseline traffic patterns for 7 days\n3. Analyze flow logs to identify legitimate traffic that needs explicit allow rules\n4. Create targeted ingress rules for each application tier (web: 443, app: 8080, db: 5432)\n5. Replace the SSH-from-anywhere rule with SSH-from-bastion-subnet-only\n6. Implement default-deny egress and add explicit allow rules for required outbound destinations\n7. Delete the overly permissive default-allow rules after verifying applications function correctly\n\n**Pitfalls**: Deleting firewall rules without understanding traffic patterns causes outages. Always enable flow logs and analyze traffic before removing rules. Network tags can be added by anyone with compute.instances.setTags permission, making them less secure than service-account-based targeting for critical rules.\n\n## Output Format\n\n```\nGCP VPC Firewall Audit Report\n================================\nProject: production-project\nVPC Network: production-vpc\nAudit Date: 2026-02-23\n\nRULE INVENTORY:\n  Total firewall rules: 34\n  Ingress rules: 22\n  Egress rules: 12\n  Disabled rules: 3\n\nCRITICAL FINDINGS:\n[FW-001] SSH Open to Internet\n  Rule: default-allow-ssh\n  Source: 0.0.0.0\u002F0 -> tcp:22\n  Target: All instances (no tags)\n  Priority: 65534\n  Remediation: Restrict to bastion subnet CIDR\n\n[FW-002] No Egress Restrictions\n  Issue: Only implied allow-all-egress rule exists\n  Risk: No controls on outbound data exfiltration\n  Remediation: Add default-deny egress and explicit allow rules\n\nREMEDIATION ACTIONS COMPLETED:\n  Rules deleted: 3 (overly permissive defaults)\n  Rules created: 8 (targeted allow rules)\n  Egress deny rule: Created at priority 65534\n  Flow logs enabled: 6 subnets\n```\n",{"name":5,"tags":25,"author":32,"domain":33,"license":15,"version":34,"subdomain":26,"description":35},[26,27,28,29,30,31],"cloud-security","gcp","vpc","firewall-rules","network-security","segmentation","mahipal","cybersecurity","1.0","Implementing and auditing GCP VPC firewall rules to enforce network segmentation, restrict ingress and egress traffic, apply hierarchical firewall policies across the organization, and monitor firewall rule effectiveness using VPC Flow Logs.\n","main","99825ad3f3bcc6597ddcc7294a14e6e922f2b67b","skills\u002Fimplementing-gcp-vpc-firewall-rules",0,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills","https:\u002F\u002Fgithub.com\u002Fjukeyman","https:\u002F\u002FRJBUSINESSSOLUTIONS.ORG","Credit and Finance Expert | Developer\r\n\r\nI'm Rick Jefferson, a seasoned credit and finance expert with over a decade of experience in financial literacy,","2026-07-13 07:03:29",{"source":8,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add jukeyman\u002Fjukeyman-skills --skill implementing-gcp-vpc-firewall-rules",{"tool":51,"command":52},"bunx","bunx skills add jukeyman\u002Fjukeyman-skills --skill implementing-gcp-vpc-firewall-rules",{"tool":54,"command":55},"pnpm","pnpm dlx skills add jukeyman\u002Fjukeyman-skills --skill implementing-gcp-vpc-firewall-rules","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fimplementing-gcp-vpc-firewall-rules\u002FSKILL.md",true,[59,63,69],{"path":60,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":16},"LICENSE","许可证",11255,{"path":64,"resourceType":65,"resourceTypeDesc":66,"sizeBytes":67,"sourceHtmlUrl":68},"references\u002Fapi-reference.md","REFERENCE","参考文档",2365,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fimplementing-gcp-vpc-firewall-rules\u002Freferences\u002Fapi-reference.md",{"path":70,"resourceType":71,"resourceTypeDesc":72,"sizeBytes":73,"sourceHtmlUrl":74},"scripts\u002Fagent.py","SCRIPT","脚本",7538,"https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fimplementing-gcp-vpc-firewall-rules\u002Fscripts\u002Fagent.py",[76,84,91,98,105,113],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":20},"01M79ANS2SM329NEP5ZCX106RR","zustand-store-creator","Create zustand store creator operations. Auto-activating skill for Frontend Development.\nTriggers on: zustand store creator, zustand store creator\nPart of the Frontend Development skill category. Use when working with zustand store creator functionality. Trigger with phrases like \"zustand store creator\", \"zustand creator\", \"zustand\".","MIT","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzustand-store-creator\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":20},"01M79AMZKP4YDEZ7EHG1Y7PP74","zero-trust-config-helper","Configure with zero trust config helper operations. Auto-activating skill for Security Advanced.\nTriggers on: zero trust config helper, zero trust config helper\nPart of the Security Advanced skill category. Use when configuring systems or services. Trigger with phrases like \"zero trust config helper\", \"zero helper\", \"zero\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-config-helper\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":20},"01M79AMJSBCEJQNBTYNAHYN5HM","zapier-integration-helper","Assist with zapier integration helper operations. Auto-activating skill for Business Automation.\nTriggers on: zapier integration helper, zapier integration helper\nPart of the Business Automation skill category. Use when working with APIs or building integrations. Trigger with phrases like \"zapier integration helper\", \"zapier helper\", \"zapier\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzapier-integration-helper\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":20},"01M79AHJZGVMARS13VFQYRR1MP","yaml-config-validator","Validate yaml config validator operations. Auto-activating skill for DevOps Basics.\nTriggers on: yaml config validator, yaml config validator\nPart of the DevOps Basics skill category. Use when configuring systems or services. Trigger with phrases like \"yaml config validator\", \"yaml validator\", \"yaml\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fyaml-config-validator\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":109,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":20},"01M79AHGDZRN0020RDQSQDPAM8","xvary-stock-research","Thesis-driven equity analysis from public SEC EDGAR and market data; \u002Fanalyze, \u002Fscore, \u002Fcompare workflows with bundled Python tools (Claude Code, Cursor, Codex).","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxvary-stock-research\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":80,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":20},"01M79AHCYJ9FV9RMHQ24HDRN33","xss-vulnerability-scanner","Scan xss vulnerability scanner operations. Auto-activating skill for Security Fundamentals.\nTriggers on: xss vulnerability scanner, xss vulnerability scanner\nPart of the Security Fundamentals skill category. Use when working with xss vulnerability scanner functionality. Trigger with phrases like \"xss vulnerability scanner\", \"xss scanner\", \"xss\".","https:\u002F\u002Fgithub.com\u002Fjukeyman\u002Fjukeyman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fxss-vulnerability-scanner\u002FSKILL.md",[],[]]