- Node.js 18+
- AWS CLI configured with appropriate credentials
- Terraform 1.5+
- PostgreSQL 13+ (or AWS RDS)
- Docker (for local Grafana)
git clone https://github.com/yourusername/scada-topology-discovery.git
cd scada-topology-discovery
npm installcp .env.example .env
# Edit .env with your configuration# Initialize and deploy AWS infrastructure
./scripts/deploy-infrastructure.sh dev apply
# Get outputs (IoT endpoint, RDS endpoint, etc.)
./scripts/deploy-infrastructure.sh dev output./scripts/generate-certs.sh scada-collector-01./scripts/run-migrations.sh --seed# Start Grafana and PostgreSQL
cd grafana && docker-compose up -d
# Start collectors
npm run collector:start-
Configure Variables
# infrastructure/terraform.tfvars environment = "prod" db_instance_class = "db.r6g.large" enable_deletion_protection = true alert_email = "security@example.com"
-
Deploy
./scripts/deploy-infrastructure.sh prod apply
-
Deploy Lambda Functions
npm run build ./scripts/deploy-lambda.sh prod
- Install on edge server in OT network
- Configure MQTT endpoint from Terraform outputs
- Copy certificates to
./certs/ - Configure SNMP credentials for devices
- Start collector service
- Access Grafana at configured URL
- Import dashboards from
grafana/dashboards/ - Configure PostgreSQL data source
- Set up alert notification channels
| Variable | Description | Required |
|---|---|---|
IOT_ENDPOINT |
AWS IoT Core endpoint | Yes |
DB_HOST |
PostgreSQL host | Yes |
DB_PASSWORD |
Database password | Yes |
ENCRYPTION_KEY |
32-char encryption key | Yes |
SNMP_AUTH_KEY |
SNMPv3 auth key | Yes |
SNMP_PRIV_KEY |
SNMPv3 priv key | Yes |
# Run tests
npm test
# Check collector status
curl http://localhost:8080/health
# Verify database
psql -h $DB_HOST -U $DB_USER -d scada_topology -c "SELECT COUNT(*) FROM devices"See troubleshooting.md for common issues.