Red Asgard Threat Intelligence
A comprehensive threat intelligence framework for Rust applications with multi-source aggregation, CVE integration, and risk assessment.
Features
- Multi-Source Aggregation: Combine intelligence from MITRE ATT&CK, CVE databases, OSINT sources
- HTTP Fetching: Built-in authenticated API calls with automatic retry logic
- Multiple Auth Methods: API Key, Bearer token, Basic auth support
- Format Parsers: JSON support (XML, STIX planned)
- Configurable Updates: Realtime, hourly, daily, weekly, or manual sync
- Priority Management: Source prioritization for conflict resolution
- Capability-Based: Query sources by capability (vulnerabilities, IOCs, tactics, etc.)
- Risk Assessment: Built-in risk scoring and assessment engine
- Optional Tracing: Built-in observability with
tracingfeature
Installation
[]
= "0.1"
# With tracing support
= { = "0.1", = ["tracing"] }
Quick Start
use ;
async
Default Sources
The library comes with three pre-configured sources:
1. MITRE ATT&CK
- Type: Tactics, Techniques, and Procedures (TTPs)
- Capabilities: Threat Actors, Tactics, Techniques
- Update Frequency: Daily
- Priority: 10 (highest)
2. CVE Database (NIST NVD)
- Type: Common Vulnerabilities and Exposures
- Capabilities: Vulnerabilities, Exploits, Patches
- Update Frequency: Realtime
- Priority: 9
3. Abuse.ch
- Type: OSINT threat intelligence
- Capabilities: Indicators of Compromise (IOCs), Malware
- Update Frequency: Hourly
- Priority: 7
Custom Sources
Add your own threat intelligence sources:
use ;
let mut config = default;
// Add custom source
let custom_source = SourceConfig ;
config.add_source;
Authentication Methods
API Key (Header)
auth_type: ApiKey,
api_key: Some,
// Sends: X-API-Key: your-api-key
Bearer Token
auth_type: Bearer,
api_key: Some,
// Sends: Authorization: Bearer your-token
Basic Auth
auth_type: Basic,
api_key: Some,
// Sends: Authorization: Basic base64(username:password)
No Auth
auth_type: None,
api_key: None,
Querying Intelligence
By Vulnerability
let vulns = engine.query_vulnerabilities.await?;
for vuln in vulns
By IOC Type
use IOCType;
let malicious_ips = engine.query_iocs.await?;
let malicious_domains = engine.query_iocs.await?;
let file_hashes = engine.query_iocs.await?;
By Threat Actor
let actors = engine.query_threat_actors.await?;
for actor in actors
Risk Assessment
let vulns = engine.query_vulnerabilities.await?;
let assessment = engine.assess_risk;
match assessment.level
println!;
println!;
println!;
println!;
println!;
Configuration Options
Sync Interval
config.sync_interval_hours = 6; // Sync every 6 hours
Cache Settings
config.cache_enabled = true;
config.cache_ttl_hours = 3; // Cache expires after 3 hours
Source Management
// Disable a source
config.set_source_enabled;
// Remove a source
config.remove_source;
// Get sources by capability
let vuln_sources = config.get_sources_by_capability;
Manual Sync
// Force sync all sources
engine.sync.await?;
// Get last sync time
let stats = engine.get_stats;
if let Some = stats.last_sync
Use Cases
- Vulnerability Management: Track CVEs affecting your stack
- SIEM Integration: Enrich security events with threat intelligence
- SOC Tools: Real-time threat actor tracking and IOC lookups
- Security Auditing: Risk assessment for codebases and infrastructure
- Incident Response: Quick lookup of threats and indicators
- Threat Hunting: Proactive threat intelligence queries
Architecture
âââââââââââââââââââââââââââââââââââââââ
â ThreatIntelEngine â
â (Aggregation & Query Interface) â
âââââââââââââââââââââââââââââââââââââââ
â
âââââââââââââââŦââââââââââââââŦââââââââââââââ
âŧ âŧ âŧ âŧ
ââââââââââââ ââââââââââââ ââââââââââââ ââââââââââââ
â MITRE â â CVE â â Abuse.ch â â Custom â
â ATT&CK â â Database â â (OSINT) â â Source â
ââââââââââââ ââââââââââââ ââââââââââââ ââââââââââââ
â â â â
âââââââââââââââ´ââââââââââââââ´ââââââââââââââ
â
âŧ
ââââââââââââââââââââ
â FeedFetcher â
â (HTTP + Auth) â
ââââââââââââââââââââ
Performance
- Lazy Loading: Sources loaded on-demand
- Caching: Configurable TTL to reduce API calls
- Async: Non-blocking fetching from multiple sources
- Retry Logic: Exponential backoff for failed requests
- Timeout: Configurable per-source timeouts
Error Handling
use ThreatIntelError;
match engine.initialize.await
// Individual source failures don't stop others
engine.sync.await?; // Continues even if one source fails
Testing
# Run tests
# Run with tracing
# Run specific test
# Run ignored network tests (requires internet)
Roadmap
- XML and STIX format parsers
- Database backend support (PostgreSQL, SQLite)
- Webhook notifications for new threats
- ML-based threat correlation
- GraphQL API
- TLS certificate pinning
- Threat feed validation
Origin
Extracted from Red Asgard, a security platform where it aggregates threat intelligence for vulnerability detection.
License
Licensed under the MIT License. See LICENSE for details.
Contributing
Contributions welcome! Areas of interest:
- Additional threat intelligence sources
- Format parsers (XML, STIX, TAXII)
- Performance optimizations
- Documentation improvements
Security
To report security vulnerabilities, email hello@redasgard.com.
Do not open public GitHub issues for security bugs.
Contact
- Email: hello@redasgard.com
- GitHub: https://github.com/redasgard/threat-intel