A serverless AWS-based security service that integrates with Captis API for threat detection, providing tiered alerting (SMS/webhooks/email), quota management, consent controls, and location tracking.
- API Layer: API Gateway with API keys and rate limiting
- Processing: Lambda functions for quota validation, Captis integration, polling, and response parsing
- Storage: DynamoDB for quotas, threat locations, scan logs, and consent status
- Notifications: SNS topics triggering Twilio (SMS), SendGrid (email), FCM (in-app), and webhooks
- Monitoring: CloudWatch for metrics, alarms, and logging
- Infrastructure: AWS CDK for IaC
spartan-ai/
├── infrastructure/ # AWS CDK infrastructure code
├── functions/ # Lambda function handlers
├── shared/ # Shared code (services, models, utils)
└── tests/ # Unit, integration, and load tests
Quick Start: See QUICK_START.md for step-by-step instructions.
- Node.js 20+ and npm
- AWS CLI configured
- AWS CDK CLI installed (
npm install -g aws-cdk) - Captis access key (provided:
485989b1-7960-4932-bb91-cd15d406df33)
- Configure Captis Access Key (Required):
# Quick setup
./scripts/setup-captis-key.sh 485989b1-7960-4932-bb91-cd15d406df33- Install infrastructure dependencies:
cd infrastructure
npm install- Install shared dependencies:
cd ../shared
npm install- Bootstrap CDK (first time only):
cd infrastructure
cdk bootstrap- Deploy the stack:
# Option 1: With SSM parameter (recommended)
cdk deploy
# Option 2: With environment variable
export CAPTIS_ACCESS_KEY=485989b1-7960-4932-bb91-cd15d406df33
cdk deploySee QUICK_START.md for detailed instructions.
Required environment variables (set in AWS Systems Manager Parameter Store or Lambda environment):
CAPTIS_ACCESS_KEY- Captis API access key (per account)CAPTIS_BASE_URL- https://asi-api.solveacrime.comTWILIO_SID,TWILIO_AUTH_TOKEN,TWILIO_PHONE_NUMBERFCM_SERVER_KEYSENDGRID_API_KEYDYNAMODB_TABLE_PREFIXSNS_TOPIC_ARN
POST /api/v1/scan- Image threat lookupGET /api/v1/scan/{id}- Scan detailsGET /api/v1/scans- List scans (with pagination)PUT /api/v1/consent- Update opt-in/opt-out statusPOST /api/v1/webhooks- Register NOC webhook URLs
MIT