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 range | Classification | What to do next |
|---|---|---|
| 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 |
Use score ranges for triage, then validate ownership and traffic before any cleanup actions.
Standard ghost-hunt workflow
- 1Start with an organization-wide scan to establish a baseline of GCP load balancer candidates.
- 2Run targeted project or regional scans for critical environments before remediation decisions.
- 3Use ghost scoring to prioritize `Definite Ghost` and `Likely Ghost` entries first.
- 4Review backend services, forwarding rules, and owner context before cleanup.
.\GCP-LoadBalancer-GhostHunter.ps1.\GCP-LoadBalancer-GhostHunter.ps1 -ProjectIds"project-prod","project-staging".\GCP-LoadBalancer-GhostHunter.ps1 -Regions"us-central1","europe-west1"Common parameters
| Parameter | Purpose | Example |
|---|---|---|
| -ProjectIds | Scope scan to specific GCP projects | "project-prod","project-staging" |
| -Regions | Limit analysis to selected regions | "us-central1","europe-west1" |
| -CsvPath | Set custom CSV report location | "./reports/gcp-ghosts.csv" |
| -HtmlPath | Set custom HTML report location | "./reports/gcp-report.html" |
Expected outputs
| Output | Best for | Audience |
|---|---|---|
| CSV | Filtering and automation workflows | Engineers / analysts |
| HTML | Executive visibility and reviews | Leads / 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
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.ps1Perfect 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
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.
Related CloudCostChefs Tools
Complete your GCP optimization toolkit with these complementary tools
What to do next
Pick the path that fits where you are right now.