Commit Graph

9 Commits (89205f25fa25bc93ddb46412a9c453848ef029e0)

Author SHA1 Message Date
Krish Sharma 2f76f0e4e5 feat: add Docker containerization and demo infrastructure
Docker Setup:
- Dockerfile: Full development environment with eBPF support
- Dockerfile.simple: Lightweight testing environment
- Dockerfile.run: Production-ready container configuration
- Dockerfile.demo: Demonstration environment setup

Demo Infrastructure:
- demo.sh: Comprehensive demonstration script with system checks
- demo-cargo.toml: Standalone cargo configuration for demos
- demo-lib.rs: Library configuration for non-eBPF testing

Analysis Outputs:
- comprehensive_analysis.json: Detailed analysis report example
- threat_analysis.csv: CSV format threat analysis export

Docker Features:
- Multi-stage builds for optimized container sizes
- eBPF toolchain installation and configuration
- Network namespace setup for testing
- Automated testing and validation scripts

Demo Capabilities:
- System information gathering and display
- eBPF capability detection and validation
- Network interface enumeration
- Traffic generation and analysis examples
- Linux container environment verification

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
3 weeks ago
Krish Sharma ba73b4c2d1 docs: add comprehensive README with usage examples and architecture
README Documentation:
- Complete project overview and architecture description
- Detailed installation and setup instructions
- Comprehensive usage examples for all features
- Command-line reference with all options
- Structured logging format specifications

Key Documentation Sections:
- XDP vs other eBPF hook point comparison
- Performance considerations and tuning guide
- Security considerations and best practices
- Troubleshooting guide for common issues
- Development workflow and contribution guidelines

Usage Examples:
- Basic traffic monitoring setup
- Structured logging in multiple formats
- Log analysis and threat detection workflows
- Configuration management examples
- Docker and containerized deployments

Technical Details:
- eBPF program architecture and data flow
- Ring buffer communication mechanisms
- CIDR range configuration and validation
- Logging system design and performance
- Threat detection algorithms and thresholds

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
3 weeks ago
Krish Sharma 2e57c8da99 feat: add examples and sample data for testing and demonstration
Example Programs:
- standalone-demo.rs: Non-eBPF demo for testing core logic
- test-traffic.rs: Traffic generation for testing
- macos-demo.rs: macOS-compatible demonstration

Sample Log Data:
- sample_traffic.jsonl: Basic traffic examples in JSONL format
- sample_traffic.csv: CSV format examples for spreadsheet analysis
- comprehensive_traffic.jsonl: Complex traffic patterns with multiple protocols
- threat_traffic.jsonl: Examples triggering threat detection (port scanning, etc.)

Demonstration Features:
- Multi-protocol traffic examples (TCP, UDP, ICMP, GRE, ESP, AH)
- Port scanning simulation for threat detection testing
- High-volume traffic patterns for performance analysis
- Realistic IP addresses and network patterns
- Flow correlation examples with unique hashes

Use Cases:
- Development testing without requiring eBPF environment
- Log analysis script validation and testing
- Threat detection algorithm verification
- Performance benchmarking and optimization
- Documentation and training examples

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
3 weeks ago
Krish Sharma 8aef9d987e feat: add configuration examples and comprehensive test suite
Configuration Files:
- configs/default.json: Standard private network CIDR ranges
- configs/strict.json: Restrictive localhost-only configuration
- configs/logging-example.json: Example with logging settings

Test Suite (tests/integration_tests.rs):
- Comprehensive integration tests for all components
- CIDR parsing and IP matching validation
- Event handling and statistics verification
- Configuration loading and validation tests
- Error handling and edge case coverage

Features Tested:
- IP address parsing and CIDR range matching
- Traffic event processing and statistics
- Configuration file loading and validation
- Protocol detection and classification
- Event handler statistics and summaries

Quality Assurance:
- Edge case handling for malformed inputs
- Performance testing for high-volume scenarios
- Memory safety verification for eBPF integration
- Cross-platform compatibility testing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
3 weeks ago
Krish Sharma 722d4c8d32 feat: add comprehensive traffic log analysis and threat detection
Analysis Script (scripts/analyze_logs.py):
- Multi-format log parser (JSON, JSONL, CSV with auto-detection)
- Comprehensive traffic analytics and statistical analysis
- Advanced threat detection and security intelligence
- Flexible export options for further analysis

Traffic Analytics:
- Traffic volume and bandwidth analysis
- Top source/destination IP identification
- Protocol distribution and temporal patterns
- Packet size analysis with percentiles
- Network flow correlation and tracking

Threat Detection Capabilities:
- Port scanning detection with configurable thresholds
- High-volume source identification using statistical analysis
- Unusual protocol detection for tunnel/VPN identification
- Suspicious traffic pattern recognition
- Repeated flow analysis for DDoS detection

Advanced Features:
- Statistical analysis with percentiles and distributions
- Temporal pattern analysis (hourly/daily trends)
- Security scoring and risk assessment
- Flow-based analysis with duration tracking
- Comprehensive reporting with multiple output formats

Export and Reporting:
- Human-readable console reports with emoji indicators
- JSON export for programmatic analysis
- CSV export for spreadsheet integration
- Detailed threat intelligence summaries

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
3 weeks ago
Krish Sharma e6bca88295 feat: implement userspace program with integrated logging
Main Program (main.rs):
- Command-line interface using clap with comprehensive options
- eBPF program lifecycle management (load, configure, attach)
- Integration with structured logging system
- Graceful shutdown handling with log flushing

Command-Line Options:
- Interface selection for XDP attachment
- Configuration file path for CIDR ranges
- Packet action control (log-only vs drop)
- Logging format selection (console/json/csv/jsonl)
- Output file specification and buffer size tuning
- Verbose logging for debugging

eBPF Integration:
- Automatic eBPF program loading and BTF initialization
- CIDR range configuration via eBPF maps
- Real-time event processing from ring buffers
- XDP attachment with fallback to SKB mode

Enhanced Features:
- Structured event logging with flow correlation
- Real-time statistics and periodic summaries
- Signal handling for clean shutdown
- Error handling with context preservation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
3 weeks ago
Krish Sharma da81c221d3 feat: add comprehensive structured logging system
Structured Logging Module (logger.rs):
- Multiple output formats: JSON, CSV, JSONL, Console
- Configurable buffering and log rotation settings
- Thread-safe logging with Arc<Mutex<>> for concurrent access
- Rich log entries with metadata and flow correlation

Log Entry Features:
- Timestamp (Unix and ISO 8601 formats)
- Source/destination IP addresses and ports
- Protocol information (name and number)
- Packet size and action taken (LOG/DROP)
- Network interface and unique flow hash
- Structured serialization with serde

Output Format Support:
- Console: Human-readable real-time logging
- JSON: Structured array format for batch processing
- JSONL: Line-delimited JSON for streaming analytics
- CSV: Spreadsheet-compatible format with headers

Performance Optimizations:
- Buffered I/O with configurable buffer sizes
- Efficient serialization and string formatting
- Minimal allocation during high-throughput logging

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
3 weeks ago
Krish Sharma 21bd2041e7 feat: implement core eBPF traffic monitoring functionality
Core eBPF Program (traffic_monitor.bpf.rs):
- XDP-based packet processing for high performance
- IP header parsing and CIDR range matching
- Configurable packet dropping or logging
- Ring buffer event logging to userspace

Supporting Modules:
- config.rs: JSON configuration management for CIDR ranges
- ip_utils.rs: CIDR parsing and IP matching utilities
- event_handler.rs: Traffic event processing and statistics
- lib.rs: Module exports and shared structures

Key Features:
- Line-rate packet filtering in kernel space
- Support for up to 256 permitted CIDR ranges
- Real-time event streaming via ring buffers
- Protocol-aware logging (TCP/UDP/ICMP/etc.)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
3 weeks ago
Krish Sharma c590290bdf feat: initialize eBPF traffic monitor project structure
- Add Cargo.toml with aya dependencies and project configuration
- Add build.rs with aya-build integration for eBPF compilation
- Configure workspace and example targets

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
3 weeks ago