Skip to main content

GCP Load Balancer
Ghost Hunter

Hunt down forgotten GCP Load Balancersconsuming resources but not serving traffic like a ghost hunter chef tracking down phantom ingredients in your Google Cloud kitchen.

Blaze
Blaze says:Each idle GCP load balancer quietly burns ~$16/month. Got 10 ghosts across your org? That's nearly $2K/year haunting your bill. The ghost scoring system makes it dead simple to prioritize which ones to exorcise first.

Quick Start

# Complete GCP organization ghost hunt
.\GCP-LoadBalancer-GhostHunter.ps1
# Target specific projects
.\GCP-LoadBalancer-GhostHunter.ps1 -ProjectIds "project-1","project-2"

Ghost hunt quick start

Structured quick-reference sections for prerequisites, installation, usage, and troubleshooting.

Prerequisites

  • PowerShell 5.1+ with advanced cmdlet support and JSON processing capabilities
  • Google Cloud SDK (gcloud CLI) installed and configured with proper authentication
  • Valid GCP credentials configured via gcloud auth login or service account authentication
  • Compute Engine and Load Balancer read permissions across target projects and regions
  • Network connectivity to Google Cloud APIs and sufficient API quota for discovery operations

Authentication check first

Validate `gcloud` authentication and project visibility before running org-wide ghost hunts to avoid partial or misleading results.

Ghost score interpretation

Score rangeClassificationWhat to do next
80-100DEFINITE GHOSTLoad balancers with no backend services or all backends unhealthy
60-79LIKELY GHOSTLoad balancers with minimal traffic or inactive forwarding rules
40-59SUSPICIOUSLoad balancers with questionable configuration or low utilization
20-39REVIEW NEEDEDLoad balancers requiring manual review for optimization opportunities
0-19ACTIVELoad balancers with healthy backends and active traffic patterns

Use score ranges for triage, then validate ownership and traffic before any cleanup actions.

Standard ghost-hunt workflow

  1. 1Start with an organization-wide scan to establish a baseline of GCP load balancer candidates.
  2. 2Run targeted project or regional scans for critical environments before remediation decisions.
  3. 3Use ghost scoring to prioritize `Definite Ghost` and `Likely Ghost` entries first.
  4. 4Review backend services, forwarding rules, and owner context before cleanup.
PowerShell
.\GCP-LoadBalancer-GhostHunter.ps1
PowerShell
.\GCP-LoadBalancer-GhostHunter.ps1 -ProjectIds"project-prod","project-staging"
PowerShell
.\GCP-LoadBalancer-GhostHunter.ps1 -Regions"us-central1","europe-west1"

Common parameters

ParameterPurposeExample
-ProjectIdsScope scan to specific GCP projects"project-prod","project-staging"
-RegionsLimit analysis to selected regions"us-central1","europe-west1"
-CsvPathSet custom CSV report location"./reports/gcp-ghosts.csv"
-HtmlPathSet custom HTML report location"./reports/gcp-report.html"

Expected outputs

OutputBest forAudience
CSVFiltering and automation workflowsEngineers / analysts
HTMLExecutive visibility and reviewsLeads / stakeholders
  • Use the same output path pattern in scheduled runs to compare ghost trends month over month.

Troubleshooting

  • If authentication fails, run `gcloud auth login` (or configure service account credentials) and rerun the scan.
  • If scans are slow in large organizations, target specific projects/regions first to validate scope and estimate runtime.
  • If results seem incomplete, verify project access and required Compute / Load Balancer read permissions.

Professional Ghost Hunting Features

Enterprise-grade load balancer discovery and analysis for Google Cloud Platform

Native gcloud CLI Integration

Leverages Google Cloud SDK for authenticated access and reliable data retrieval across projects and regions

Intelligent Project Discovery

Automatic project enumeration or targeted project analysis with lifecycle state validation

Advanced Ghost Scoring Algorithm

Multi-factor analysis with 0-100 scale scoring system for accurate ghost load balancer identification

Comprehensive Load Balancer Analysis

Evaluates backend services, forwarding rules, health checks, and traffic patterns for complete assessment

Multi-Region Support

Scans across all GCP regions or targets specific regions for focused resource management

Authentication Verification

Built-in gcloud authentication testing with clear guidance for credential setup

Professional Reporting Engine

Dual-format output with structured CSV for analysis and rich HTML for executive presentation

Cost Impact Assessment

Identifies potential cost savings from unused load balancers with detailed resource utilization analysis

Intelligent Ghost Scoring System

Multi-factor analysis with 0-100 scale for accurate ghost load balancer identification

Ghost Classification Levels

80-100
DEFINITE GHOST
Load balancers with no backend services or all backends unhealthy
60-79
LIKELY GHOST
Load balancers with minimal traffic or inactive forwarding rules
40-59
SUSPICIOUS
Load balancers with questionable configuration or low utilization
20-39
REVIEW NEEDED
Load balancers requiring manual review for optimization opportunities
0-19
ACTIVE
Load balancers with healthy backends and active traffic patterns

Usage Examples

Real-world scenarios for effective GCP load balancer ghost hunting

Complete Organization Scan

Scan all accessible GCP projects for ghost load balancers

.\GCP-LoadBalancer-GhostHunter.ps1

Perfect for initial discovery and comprehensive ghost hunting across your entire GCP organization

Targeted Project Analysis

Focus on specific projects for detailed load balancer analysis

.\GCP-LoadBalancer-GhostHunter.ps1 -ProjectIds"project-prod","project-staging"

Ideal for focused analysis of critical production and staging environments

Regional Load Balancer Hunt

Target specific regions for geographically focused ghost hunting

.\GCP-LoadBalancer-GhostHunter.ps1 -Regions"us-central1","europe-west1"

Useful for regional cost optimization and compliance with data residency requirements

Custom Report Location

Specify custom paths for CSV and HTML report generation

.\GCP-LoadBalancer-GhostHunter.ps1 -CsvPath"./reports/gcp-ghosts.csv" -HtmlPath"./reports/gcp-report.html"

Perfect for automated reporting pipelines and integration with existing workflows

Technical Specifications

Enterprise-grade requirements and comprehensive feature documentation

Requirements

  • PowerShell 5.1+ with advanced cmdlet support and JSON processing capabilities
  • Google Cloud SDK (gcloud CLI) installed and configured with proper authentication
  • Valid GCP credentials configured via gcloud auth login or service account authentication
  • Compute Engine and Load Balancer read permissions across target projects and regions
  • Network connectivity to Google Cloud APIs and sufficient API quota for discovery operations

Parameters

-ProjectIds
Specific GCP project IDs to analyze (optional)
-Regions
Target regions for load balancer discovery (default: all)
-CsvPath
Custom path for CSV report output
-HtmlPath
Custom path for HTML report output

Core Analysis Features

Discovery Engine

  • • Automatic project enumeration and validation
  • • Multi-region load balancer discovery
  • • Authentication verification and guidance
  • • Comprehensive error handling and logging

Analysis Capabilities

  • • Backend service health evaluation
  • • Forwarding rule activity assessment
  • • Health check configuration analysis
  • • Traffic pattern and utilization review

Professional Reporting

Dual-format output for technical analysis and executive presentation

CSV Report

Structured data format perfect for analysis, filtering, and integration with existing workflows.

  • • Load balancer details and configuration
  • • Ghost scores and classification status
  • • Backend service and health check information
  • • Project and region metadata
  • • Timestamp and analysis metadata

HTML Report

Rich visual presentation with charts, summaries, and executive-friendly formatting.

  • • Executive summary with key metrics
  • • Visual ghost score distribution
  • • Detailed load balancer analysis tables
  • • Cost optimization recommendations
  • • Professional CloudCostChefs branding

Chef's Tips

Professional best practices for effective GCP load balancer ghost hunting

Authentication Setup

Ensure proper gcloud authentication withgcloud auth loginor configure service account credentials. The script includes built-in authentication verification to guide you through setup.

Performance Optimization

For large organizations, consider targeting specific projects or regions first to understand the scope. Use the project filtering feature to focus on critical environments before running organization-wide scans.

Ghost Analysis Strategy

Focus on"DEFINITE GHOST" and"LIKELY GHOST" classifications for immediate action. Review"SUSPICIOUS" load balancers manually, and use"REVIEW NEEDED" items for optimization opportunities.

Report Integration

Use CSV reports for detailed analysis and automation workflows. Share HTML reports with stakeholders for executive visibility. Both formats include comprehensive metadata for tracking and compliance.

What to do next

Pick the path that fits where you are right now.

Trust & run-safety metadata

Key execution details for GCP Load Balancer Ghost Hunter so users know what they are downloading or running before they act.

Need verification guidance? See Security & Trust and Responsible Disclosure.

Read-only / reportingGitHub sourceExplicit + inferred metadata

Maintainer

CloudCostChefs

Last Updated

July 6, 2025

Last Tested

February 23, 2026

Minimum Access

Read-only GCP load balancer/network resource visibility across target projects with `gcloud` auth

Execution Type

GitHub-hosted PowerShell reporting script (GCP load balancer ghost detection)

Version

2025-07-06

SHA256 Checksum

Not published yet (recommend adding checksum for downloadable files)

Verification Notes

GitHub-hosted GCP load balancer analysis workflow. Review project selection, regional coverage, and scoring assumptions before acting on findings.

Safe Usage Checklist

  • Confirm traffic patterns and reserved failover usage before treating a load balancer as orphaned.
  • Validate initial runs in a limited set of projects to confirm permission and API behavior.
  • Run in a non-production subscription/account/tenancy first and capture sample output before broader rollout.
  • Use least-privilege access. Current best hint from docs: Read-only GCP load balancer/network resource visibility across target projects with `gcloud` auth.

Quick start (fast path)

Minimal steps to safely get value from this tool without reading the entire page first.

Estimated time: 10-15 minutes per projectDifficulty: IntermediateAccess: Review / read-only
  1. 1. Confirm scope and permissions

    Use least privilege and test in a non-production scope first. Minimum access hint: Read-only GCP load balancer/network resource visibility across target projects with `gcloud` auth.

  2. 2. Get the tool package / source

    View on GitHub and review the files before running.

    GitHub
  3. 3. Check prerequisites

    • ✅ PowerShell 5.1+ with advanced cmdlet support and JSON processing capabilities
    • ✅ Google Cloud SDK (gcloud CLI) installed and configured with proper authentication
    • ✅ Valid GCP credentials configured via gcloud auth login or service account authentication
  4. 4. Run safely and review output

    GitHub-hosted GCP load balancer analysis workflow. Review project selection, regional coverage, and scoring assumptions before acting on findings. Start with a small sample scope, then expand once results look correct.