Before deploying Snapshot Sleuth, ensure you have:
- AWS Account with appropriate permissions
- AWS CLI configured (
aws configure) - Node.js >= 18.0.0
- Bun >= 1.0.0
- AWS CDK CLI (
npm install -g aws-cdk)
- Clone the repository:
git clone https://github.com/Stealinglight/Snapshot-Sleuth.git
cd Snapshot-Sleuth- Install dependencies:
bun install- Build all packages:
bun run buildCreate a .env file in the CDK package:
cd packages/cdk
cat > .env << EOF
ENVIRONMENT=production
AWS_REGION=us-east-1
PROJECT_NAME=snapshot-sleuth
ALARM_EMAIL=security@yourcompany.com
# GitHub Integration
GITHUB_TOKEN=your_github_token
GITHUB_OWNER=your_org
GITHUB_REPO=security-cases
# Slack Integration (optional)
SLACK_WEBHOOK_URL=your_slack_webhook
# Email Notification (optional)
EMAIL_FROM=noreply@yourcompany.com
EMAIL_TO=security-team@yourcompany.com
EOF- Bootstrap CDK (first time only):
cd packages/cdk
bun run cdk bootstrap- Review changes:
bun run cdk diff- Deploy the stack:
bun run cdk deploy- Note the outputs:
Outputs:
snapshot-sleuth-production.StateMachineArn = arn:aws:states:...
snapshot-sleuth-production.EvidenceBucketName = snapshot-sleuth-evidence-production
snapshot-sleuth-production.DashboardUrl = https://console.aws.amazon.com/...
- Connect your GitHub repository to AWS Amplify
- Configure build settings:
version: 1
frontend:
phases:
preBuild:
commands:
- curl -fsSL https://bun.sh/install | bash
- bun install
build:
commands:
- cd packages/frontend
- bun run build
artifacts:
baseDirectory: packages/frontend/dist
files:
- '**/*'
cache:
paths:
- node_modules/**/*cd packages/frontend
bun run build
aws s3 sync dist/ s3://your-frontend-bucket- Verify the deployment:
aws stepfunctions list-state-machines- Test with a sample snapshot:
aws stepfunctions start-execution \
--state-machine-arn YOUR_STATE_MACHINE_ARN \
--input '{"snapshotId":"snap-xxxxx","region":"us-east-1"}'- Monitor the execution:
- Check CloudWatch Dashboard
- Review CloudWatch Logs
- Check GitHub Issues for case creation
- Permission Denied: Ensure your AWS credentials have sufficient permissions
- Stack Already Exists: Delete the existing stack or use a different name
- Resource Limits: Check AWS service quotas
- CloudWatch Logs:
/aws/snapshot-sleuth/{environment} - CloudTrail: Check S3 logs bucket
- Lambda Logs: Each function has its own log group
To remove all resources:
cd packages/cdk
bun run cdk destroyNote: S3 buckets with versioning enabled will need manual deletion.