Skip to content

TFDrift-Falco Documentation

Welcome to the official documentation for TFDrift-Falco, a real-time multi-cloud Terraform drift detection system with an integrated React Dashboard UI.

Version: v0.12.0 | Status: Production Ready | Providers: AWS (40+ services) + GCP (27+ services) + Azure

New in v0.12.0: Policy-as-Code (OPA/Rego) β€’ Drift Auto-Remediation (GitHub PRη”Ÿζˆ) β€’ OpenTelemetryεˆ†ζ•£γƒˆγƒ¬γƒΌγ‚·γƒ³γ‚° | New in v0.11.0: クロスクラウド相閒エンジン β€’ Provider Status UI β€’ Grafanaダッシγƒ₯γƒœγƒΌγƒ‰ (Azure対応) | New in v0.10.0: E2Eγƒ†γ‚Ήγƒˆη’°ε’ƒ β€’ γƒ†γ‚Ήγƒˆγ‚«γƒγƒ¬γƒƒγ‚Έ65%+ β€’ CI Gate


What is TFDrift-Falco?

TFDrift-Falco detects when your cloud infrastructure changes outside of Terraform by:

  1. Monitoring cloud audit logs in real-time (AWS CloudTrail, GCP Audit Logs, Azure Activity Log)
  2. Comparing changes against Terraform state (S3, GCS, or local)
  3. Evaluating drift policies via OPA/Rego (allow / alert / remediate / deny)
  4. Auto-remediating by generating Terraform code and GitHub PRs
  5. Alerting via Falco when drift is detected
  6. Visualizing drift in Grafana dashboards with cross-cloud correlation

Key Features

πŸ“œ Policy-as-Code with OPA/Rego (v0.12.0+)

Classify every drift with Rego policies:

  • Allow β€” suppress false positives (Auto Scaling, ECS desired_count, tag-only changes)
  • Alert β€” default: notify via Slack/Discord/Falco
  • Remediate β€” auto-generate Terraform code and create GitHub PRs
  • Deny β€” escalate policy violations (IAM changes by unknown users, encryption disabled)

Sample policies included for AWS and GCP. Custom policies can be added to the policies/ directory.

πŸ”§ Drift Auto-Remediation (v0.12.0+)

Automatically propose fixes for detected drifts:

  • Terraform HCL code generation for unmanaged resources
  • terraform import / terraform plan command generation
  • GitHub PR auto-creation via API
  • Real-time broadcast of remediation proposals via WebSocket/SSE

πŸ”­ OpenTelemetry Distributed Tracing (v0.12.0+)

Full observability across the drift detection pipeline:

  • OTLP gRPC traces and metrics export
  • Span instrumentation for Falco subscriber, detector, notifier
  • W3C trace context propagation in HTTP middleware
  • Integration with Jaeger, Grafana Tempo, or any OTLP-compatible backend

🌍 Cross-Cloud Drift Correlation (v0.11.0+)

Detect coordinated changes across AWS, GCP, and Azure:

  • Correlation engine links related drifts across providers
  • Provider Status API with health monitoring
  • Grafana dashboards for unified multi-cloud visibility

🎨 Dashboard UI (v0.6.0+)

React web interface for real-time drift monitoring: - Real-time event stream with live updates - Interactive topology graphs with relationship visualization - Drift details panel with change history and remediation - Statistics dashboard with service metrics - Dark/Light theme support - Graph export (PNG, SVG, JSON)

Access at: http://localhost:3000

πŸ“– Why Falco? (v0.6.1+)

Explore the design philosophy behind TFDrift-Falco: - Interactive "Why Falco?" page on the Vercel-hosted UI - Comparison of Terraform plan-based vs event-driven drift detection - Architecture story: from blueprint to real-time witness

Access at: tfdrift-falco.vercel.app (click "Why Falco?" toggle)

Read the full story β†’

🌐 Multi-Cloud Support (40+ AWS services, 27+ GCP services)

AWS Coverage (v0.6.0)

Supports 500+ CloudTrail events across 40+ AWS services: - Compute: EC2, Lambda, Auto Scaling, ECS, EKS, ECR - Networking: VPC, Security Groups, ELB/ALB, Route53, CloudFront, EFS - Storage: S3, EBS - Databases: RDS, Aurora, DynamoDB, ElastiCache - Security: IAM, KMS, GuardDuty, AWS Config - DevOps: CodePipeline, CodeBuild, CodeDeploy - Messaging: SNS, SQS - and 13 more services...

View AWS Service Coverage β†’

GCP Coverage (v0.6.0)

Supports 170+ Audit Log events across 27+ GCP services: - Compute: Compute Engine, Disks, Cloud Run - Networking: VPC, Firewall, Routes, Cloud Armor, Cloud DNS - Storage: Cloud Storage - Databases: Cloud SQL, Spanner, Cloud Firestore - Security: IAM, KMS, Secret Manager - DevOps: Cloud Build, Artifact Registry - Data & Analytics: BigQuery, Pub/Sub, Dataproc - and 19 more services...

View GCP Service Coverage β†’

πŸ”Œ API Server with Real-time Streaming (v0.6.0+)

REST API Server on port 8080: - REST endpoints for querying graph, events, and drifts - WebSocket streaming for real-time drift alerts - Server-Sent Events (SSE) for lightweight real-time updates - In-memory causal graph store with relationship tracking - Graph export capabilities (PNG, SVG, JSON)

Endpoints:

REST API:   http://localhost:8080/api/v1
WebSocket:  ws://localhost:8080/ws
SSE Stream: http://localhost:8080/api/v1/stream

REST API Documentation β†’ | WebSocket Documentation β†’ | SSE Documentation β†’

⚑ Real-time Detection

  • Sub-minute latency from cloud change to alert
  • Asynchronous audit log processing (CloudTrail, GCP Audit Logs)
  • Parallel multi-cloud service detection
  • Event-driven architecture with Falco
  • Real-time Dashboard UI updates via WebSocket/SSE

πŸ” Security-Focused

  • IAM policy drift detection (AWS IAM, GCP IAM)
  • Encryption configuration monitoring (S3, KMS, Cloud Storage)
  • Firewall rule changes (Security Groups, GCP Firewall)
  • Key management (AWS KMS, GCP KMS)
  • Service account modifications (GCP Service Accounts)

πŸ“Š Production-Ready Monitoring

  • Grafana dashboards for multi-cloud visibility
  • Falco rules with severity levels
  • User attribution for every change (IAM principals, service accounts)
  • Alert integration ready (Slack, Discord, webhooks)
  • Multi-cloud unified view in single dashboard

Quick Start

Prerequisites

For AWS: - AWS account with CloudTrail enabled - Falco with cloudtrail plugin

For GCP (v0.5.0+): - GCP project with Audit Logs enabled - Falco with gcpaudit plugin - Pub/Sub subscription for Audit Logs

Common: - Terraform state file (S3, GCS, or local backend) - Kubernetes cluster (for Falco deployment) - Grafana + Prometheus (optional, for visualization)

Installation

Quick Start (5 minutes, v0.6.0)

# Clone the repository
git clone https://github.com/higakikeita/tfdrift-falco.git
cd tfdrift-falco

# Run quick start script
./quick-start.sh

# Launch with Docker Compose
docker compose up -d

# Access Dashboard
# Dashboard:  http://localhost:3000
# API Server: http://localhost:8080

Full Quickstart Guide β†’

AWS Setup (Manual)

# Clone the repository
git clone https://github.com/higakikeita/tfdrift-falco.git
cd tfdrift-falco

# Deploy Falco with cloudtrail plugin
kubectl apply -f deployments/falco/

# Deploy API Server & Dashboard
kubectl apply -f deployments/api/
kubectl apply -f deployments/ui/

# Configure TFDrift for AWS
vim config.yaml  # Configure AWS provider and S3 state

# Run the detector
./tfdrift --config config.yaml

Full AWS Setup Guide β†’

GCP Setup (v0.5.0+)

# Quick start (recommended)
./scripts/gcp-quick-start.sh

# Or manual setup
# See full GCP setup guide

Full GCP Setup Guide β†’

Multi-Cloud Setup

# config.yaml - Monitor both AWS and GCP
providers:
  aws:
    enabled: true
    regions: ["us-east-1", "us-west-2"]
    state:
      backend: "s3"
      s3_bucket: "my-terraform-state"
      s3_key: "aws/terraform.tfstate"

  gcp:
    enabled: true
    projects: ["my-gcp-project-123"]
    state:
      backend: "gcs"
      gcs_bucket: "my-terraform-state"
      gcs_prefix: "gcp/terraform.tfstate"

Full Quickstart Guide β†’


Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ AWS Console β”‚ User makes manual change
β”‚   / CLI     β”‚ (e.g., modify EC2 instance type)
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CloudTrail  β”‚ Event: ModifyInstanceAttribute
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  TFDrift    β”‚ 1. Fetch event
β”‚  Detector   β”‚ 2. Load Terraform state
β”‚             β”‚ 3. Compare attributes
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    Falco    β”‚ Drift detected!
β”‚    Rules    β”‚ Severity: WARNING
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜
       β”‚
       β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
       β–Ό               β–Ό              β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Grafana   β”‚ β”‚ API Server   β”‚ β”‚ Alerting β”‚
β”‚  Dashboard  β”‚ β”‚ + Graph Storeβ”‚ β”‚(Slack/PD)β”‚
β”‚  (Legacy)   β”‚ β”‚ (Chi Router) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
                    WS/SSE
                       β”‚
                       β–Ό
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚   Dashboard  β”‚
                β”‚ (React 19+   β”‚
                β”‚  Tailwind)   β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    :3000

    Docs: higakikeita.github.io/tfdrift-falco/
    Storybook: .../tfdrift-falco/storybook/
    Vercel UI: tfdrift-falco.vercel.app

New in v0.6.1: Unified icon system + Why Falco? page + Unified docs deployment

v0.6.0: React Dashboard UI + API Server with real-time WebSocket/SSE streaming

Learn More About Architecture β†’


Use Cases

1. Detect Unplanned Changes

Problem: Someone modifies infrastructure via cloud console or CLI, bypassing Terraform.

Solution: TFDrift-Falco alerts you immediately with: - What changed - Resource type and modified attributes - Who made the change - IAM user/role (AWS) or principal email (GCP) - When it happened - Precise timestamp with timezone - Where - Account/project, region/zone

Examples: - AWS: EC2 instance type changed via AWS Console - GCP: Compute Engine metadata modified via gcloud CLI

2. Security Compliance

Problem: Security configurations modified without approval across multiple clouds.

Solution: Critical severity alerts for security-related drift:

AWS: - IAM role trust policy changes - S3 bucket made public - Security group rules opened to 0.0.0.0/0 - KMS key deletion scheduled

GCP: - Firewall rules allowing public access - GCS bucket IAM policy changes - Service account key creation - KMS crypto key rotation disabled

3. Multi-Cloud Governance

Problem: Managing drift across multiple cloud providers, accounts, and projects.

Solution: Unified monitoring with multi-cloud support: - AWS: Monitor 10+ accounts across multiple regions - GCP: Monitor multiple projects and organizations - Hybrid: Single dashboard for AWS + GCP resources - Filtering: Account/project, region/zone, service-level filtering


Documentation Sections

Getting Started

AWS Service Coverage (203+ events, 19 services)

GCP Service Coverage (100+ events, 12+ services) - New in v0.5.0

Release Notes


Community


License

TFDrift-Falco is open source under the MIT License.


Next Steps

  1. Understand how TFDrift-Falco works β†’
  2. Check service coverage for your infrastructure β†’
  3. Deploy TFDrift-Falco β†’