A comprehensive web-based security dashboard for Active Directory environments, designed to integrate with existing CLI audit tools and provide actionable security insights.
- Multi-user Authentication: Secure role-based access control (Admin, Analyst, Viewer)
- JSON Upload & Processing: Parse and analyze CLI audit tool output
- Interactive Dashboards: Real-time security metrics and threat analysis
- Professional Reporting: Export reports in JSON, HTML, and PDF formats
- Remediation Scripts: Auto-generate PowerShell and Bash scripts
- SIEM Integration: RESTful APIs for Grafana, Splunk, and ELK Stack
- Audit History: Complete versioning and tracking system
- Role-based Permissions: Granular access control system
- Secure Session Management: JWT-based authentication
- Data Encryption: Secure handling of sensitive AD data
- Audit Logging: Complete activity tracking
- Rate Limiting: API protection against abuse
- Security Overview: Overall security score and key metrics
- Threat Analysis: Categorized threats with severity indicators
- User Risk Matrix: Risk-based user categorization
- GPO Analysis: Group Policy Object security assessment
- Network Topology: Infrastructure visualization
- Compliance Reporting: Standards compliance tracking
- Frontend: Next.js 14, React, TypeScript, TailwindCSS
- Backend: Next.js API Routes, Node.js
- Database: SQLite with Drizzle ORM
- Authentication: JWT with secure session management
- UI Components: shadcn/ui with custom dark theme
- Deployment: Docker with Nginx reverse proxy
- Node.js 18+
- npm, yarn, or pnpm
- Docker and Docker Compose (for containerized deployment)
- Active Directory environment with CLI audit tool
-
Clone the repository
git clone <repository-url> cd adwatch
-
Install dependencies
npm install # or yarn install # or pnpm install
-
Set up environment variables
cp .env.example .env.local
Configure the following variables:
JWT_SECRET=your-secure-jwt-secret-here NODE_ENV=development
-
Initialize the database
npm run db:generate npm run db:push
-
Start the development server
npm run dev
-
Access the application
- Open http://localhost:3000
- Register your first admin account
-
Clone and configure
git clone <repository-url> cd adwatch
-
Create environment file
cp .env.example .env
Update production values:
JWT_SECRET=your-production-jwt-secret NODE_ENV=production
-
Deploy with Docker Compose
# Basic deployment docker-compose up -d # Production deployment with SSL and backups docker-compose --profile production up -d
-
Access the application
- HTTP: http://localhost:3000
- HTTPS: https://localhost (with production profile)
| Variable | Description | Default | Required |
|---|---|---|---|
JWT_SECRET |
Secret key for JWT token signing | adwatch-dev-secret |
Yes |
NODE_ENV |
Environment mode | development |
No |
DATABASE_URL |
Database connection string | file:./data/adwatch.db |
No |
| Role | Permissions |
|---|---|
| Admin | Full system access, user management, all features |
| Analyst | Upload reports, generate scripts, export data |
| Viewer | Read-only access to dashboards and reports |
POST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logoutGET /api/auth/me- Get current user
POST /api/audit/upload- Upload audit reportGET /api/audit/history- Get audit historyDELETE /api/audit/history- Delete audit report
POST /api/reports/generate- Generate security reportPOST /api/remediation/generate- Generate remediation script
GET /api/siem/endpoints- SIEM data endpoints- Query parameters:
endpoint,format,timeRange - Supported endpoints:
metrics,threats,alerts,users,health
- Query parameters:
GET /api/admin/users- List users (Admin only)PUT /api/admin/users- Update user (Admin only)DELETE /api/admin/users- Delete user (Admin only)
- Change default JWT secret
- Enable HTTPS with valid SSL certificates
- Configure rate limiting
- Set up database backups
- Enable audit logging
- Configure firewall rules
- Regular security updates
- All sensitive data is encrypted at rest
- JWT tokens have configurable expiration
- Session management with secure cookies
- Input validation and sanitization
- SQL injection protection via ORM
- adwatch: Main application container
- nginx: Reverse proxy with SSL termination
- backup: Automated database backup service
adwatch_data: Database storageadwatch_uploads: File uploadsadwatch_backups: Database backupsadwatch_logs: Nginx logs
The application includes comprehensive health checks:
- Database connectivity
- Memory usage monitoring
- Uptime tracking
- API endpoint validation
Automated daily backups are configured in the Docker setup:
# Manual backup
docker exec adwatch-app cp /app/data/adwatch.db /backups/manual-backup-$(date +%Y%m%d).db
# Restore from backup
docker exec adwatch-app cp /backups/backup-file.db /app/data/adwatch.db# View application logs
docker logs adwatch-app
# View nginx logs
docker logs adwatch-nginx
# Follow logs in real-time
docker logs -f adwatch-app# Pull latest changes
git pull origin main
# Rebuild and restart
docker-compose down
docker-compose build --no-cache
docker-compose up -d- Configure your AD audit CLI tool to output JSON format
- Use the
/api/audit/uploadendpoint to submit reports - Monitor processing status via the dashboard
- Generate remediation scripts based on findings
{
"targets": [
{
"url": "https://adwatch.company.com/api/siem/endpoints?endpoint=metrics",
"headers": {
"X-API-Key": "your-api-key"
}
}
]
}curl -H "X-API-Key: your-api-key" \
"https://adwatch.company.com/api/siem/endpoints?endpoint=alerts&format=json" \
| splunk add oneshot- Security score trends
- Threat detection rates
- User risk distribution
- System performance metrics
- API usage statistics
Configure alerts for:
- Critical security threats
- Failed audit uploads
- System health issues
- Unusual user activity
-
Database Connection Failed
- Check file permissions on data directory
- Verify SQLite installation
- Check disk space
-
Authentication Issues
- Verify JWT_SECRET configuration
- Check session cookie settings
- Validate user permissions
-
Upload Failures
- Check file size limits
- Verify JSON format
- Check disk space
Enable debug logging:
NODE_ENV=development
DEBUG=adwatch:*This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
For technical support or questions:
- Create an issue in the repository
- Contact your system administrator
- Review the troubleshooting guide
ADWATCH - Securing Active Directory environments through comprehensive audit analysis and automated remediation.