DriftHound is a Rails WebApp that receives Terraform drift reports via API and provides visibility into infrastructure drift across your projects.
Live demo site: https://demo.drifthound.io
- API for Drift Reports: Receive Terraform drift check results via authenticated API
- Historical Data: Store and track drift check history per project
- Project Status: Display project status (OK / Drift / Error / Unknown)
- Web Dashboard: View all projects and their drift status at a glance
- Charts Dashboard: Visual analytics with interactive charts for drift monitoring
- Slack Notifications: Real-time alerts when drift is detected or resolved
- Ruby 3.x
- PostgreSQL
- Rails 8.0+
- Install Dependencies
bundle install- Start database
docker compose up postgres -d- Database Setup
bin/rails db:create db:migrate db:seed- Start the Server
bin/rails serverImportant
Running System tests requires google-chrome to be installed.
- Create Test DB
make prepare-test-db- Unit Tests
make run-testsProvision Database and Start Application
make docker-db-setupThis will start the services then create, migrate, and seed the database. Also automatically creates the API token in the seeding step.
DriftHound provides a CLI to automate drift checks in CI/CD pipelines.
sudo curl -L https://raw.githubusercontent.com/drifthoundhq/drifthound/main/bin/drifthound-cli -o /usr/local/bin/drifthound && sudo chmod +x /usr/local/bin/drifthounddrifthound --tool=terraform \
--project=my-project \
--environment=production \
--token=YOUR_API_TOKEN \
--api-url=http://localhost:3000 \
--dir=./terraformπ See docs/cli-usage.md for detailed CLI documentation, Docker usage, and CI/CD integration examples.
You can submit drift check results directly to the API:
curl -X POST \
http://localhost:3000/api/v1/projects/my-project/environments/my-env/checks \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"status": "drift",
"add_count": 2,
"change_count": 1,
"destroy_count": 0,
"duration": 8.2,
"raw_output": "Plan: 2 to add, 1 to change, 0 to destroy."
}'Generate an API Token:
- Log in as admin at
/login - Click API Tokens in the navigation bar
- Create a new token and copy it (it's only shown once!)
π See docs/api-usage.md for complete API documentation, including advanced features and examples.
Automate drift detection in your GitHub workflows with the official DriftHound GitHub Action.
π GitHub Action: https://github.com/drifthoundhq/drifthound-action
DriftHound can be deployed to production environments using Docker and Kubernetes.
Pre-built Docker images are available in the GitHub Container Registry:
docker pull ghcr.io/drifthoundhq/drifthound:latestA Helm chart is available for deploying DriftHound to Kubernetes clusters:
π¦ Helm Chart Repository: https://github.com/drifthoundhq/helm-chart/
For deployment instructions and configuration options, refer to the Helm chart documentation.
- Configuration Guide - Environment variables, database setup, Slack configuration, and deployment examples
- CLI Guide - Detailed CLI documentation, Docker usage, and CI/CD integration examples
- API Reference - Complete API documentation, advanced features, and integration examples
- Slack Notifications - Configure Slack alerts for drift detection
flowchart LR
A["CI/CD (Terraform)"] --> B["DriftHound API"]
B --> C["PostgreSQL (Storage)"]
AGPL-3.0
