Automation and SOAR
Automation is critical for scaling SOC operations and reducing response times. This layer combines security orchestration (Cortex SOAR) with infrastructure automation (Terraform/PyInfra) to enable rapid, consistent responses to security events and efficient infrastructure management.Automation reduces manual work, eliminates human error, and enables your team to focus on complex investigations while repetitive tasks are handled automatically.
Architecture Overview
Cortex SOAR
Security orchestration for investigation and response automation
Infrastructure as Code
Terraform and PyInfra for automated infrastructure management
Cortex SOAR Platform
Cortex is the automation engine that powers TheHive, providing analyzers for enrichment and responders for automated actions.Core Concepts
- Analyzers
- Responders
- Jobs
Observable Enrichment:Analyzers automatically enrich observables with contextual information:
- Threat Intelligence: VirusTotal, MISP, OTX
- Reputation: AbuseIPDB, URLhaus, PhishTank
- Sandboxing: Joe Sandbox, Cuckoo, ANY.RUN
- DNS/WHOIS: PassiveTotal, DomainTools
- File Analysis: YARA, ClamAV, PEFile
- Network: Shodan, Censys, MaxMind GeoIP
Analyzer Configuration
Analyzer Types by Data Type
Analyzer Types by Data Type
IP Address Analyzers:
- AbuseIPDB_1: IP reputation and reports
- GreyNoise: Internet scanner identification
- IPVoid: Multi-engine reputation check
- MaxMind GeoIP: Geographic location
- Shodan: Internet exposure scanning
- Tor Project: Tor exit node detection
- VirusTotal: Multi-AV scanning
- MISP: Threat intelligence correlation
- MalwareBazaar: Known malware repository
- HybridAnalysis: Sandbox analysis
- URLhaus: Malware distribution URLs
- PhishTank: Phishing URL database
- Google Safe Browsing: URL safety
- Censys: Certificate and host analysis
Analyzer Configuration Example
Analyzer Configuration Example
Custom Analyzer Development
Custom Analyzer Development
Create custom analyzers for internal tools:
Responder Configuration
- Network Responders
- Endpoint Responders
- Notification Responders
Firewall Integration:
Automation Workflows
Chain multiple analyzers and responders for complete automation:Automated Triage Workflow
Automated Triage Workflow
Observable Added → Automatic Enrichment:
- IP address added to case
- Run AbuseIPDB analyzer (reputation)
- Run GreyNoise analyzer (scanner detection)
- Run Shodan analyzer (exposure check)
- Run MaxMind analyzer (geolocation)
- If malicious score > threshold:
- Run firewall block responder
- Send Slack notification
- Create blocking task
Phishing Response Workflow
Phishing Response Workflow
Email Observable → Automated Response:
- URL extracted from phishing email
- Run URLhaus analyzer
- Run PhishTank analyzer
- Run VirusTotal analyzer
- If confirmed phishing:
- Report to email gateway
- Block sender domain
- Search for similar emails
- Notify affected users
Malware Detection Workflow
Malware Detection Workflow
File Hash → Sandbox Analysis:
- File hash observable created
- Run VirusTotal analyzer
- If unknown or suspicious:
- Submit to Joe Sandbox
- Submit to Hybrid Analysis
- If confirmed malicious:
- Quarantine affected hosts
- Search for hash in environment
- Update antivirus signatures
- Block at proxy/firewall
Infrastructure as Code (IaC)
Terraform Automation
Terraform manages SOC infrastructure deployment and configuration:- Infrastructure Provisioning
- Network Configuration
- State Management
PyInfra Automation
PyInfra provides Python-based configuration management:System Configuration
System Configuration
Security Hardening
Security Hardening
Deployment Automation
Deployment Automation
Integration Patterns
Automated Incident Response
Detection
IDS/SIEM detects threat → Creates alert
Enrichment
Cortex analyzers gather intelligence
Decision
Automated scoring determines severity
Response
Cortex responders execute containment
Continuous Deployment
Best Practices
SOAR Automation
SOAR Automation
- Start conservative: Begin with analyzers only, add responders gradually
- Test thoroughly: Validate in lab before production deployment
- Implement approvals: Require human approval for destructive actions
- Monitor job failures: Alert on analyzer/responder errors
- Document workflows: Maintain runbooks for automated procedures
- Rate limiting: Prevent API quota exhaustion
Infrastructure as Code
Infrastructure as Code
- Version control: Store all Terraform/PyInfra code in Git
- Code review: Require peer review for infrastructure changes
- State management: Use remote backends with locking
- Secrets management: Never commit credentials, use vaults
- Modular design: Create reusable modules and roles
- Testing: Validate configurations before applying
Security
Security
- Least privilege: Grant minimum necessary permissions
- Audit logging: Log all automated actions
- Credential rotation: Regularly update API keys and passwords
- Network segmentation: Isolate automation systems
- Change management: Follow approval processes for automation changes
Metrics and Monitoring
- SOAR Metrics
- IaC Metrics
Track automation effectiveness:
- Analyzer success/failure rates
- Average enrichment time
- Responder execution success
- API quota utilization
- Time saved through automation
- Manual intervention frequency
Official Documentation
Cortex Documentation
Official Cortex documentation and analyzer catalog
Terraform Docs
Complete Terraform documentation and provider registry
PyInfra Documentation
PyInfra operations reference and examples
Cortex Analyzers
Open-source analyzer and responder repository
Next Steps
- Review Operations Guide for automation best practices
- Explore Incident Handling playbooks for automation opportunities
- Check Threat Detection strategies for automated enrichment workflows
