Release Date: 2025 Status: ✅ Production Ready Build: Stable
CodeBeaker v1.0 is a production-ready, secure, multi-runtime code execution framework for .NET 8.0. This release includes comprehensive security hardening (Phase 11) with input validation, rate limiting, audit logging, and defense-in-depth protection.
- Input Validation: Code, file path, and command validation with pattern blocking
- Rate Limiting: Per-session execution throttling with sliding windows
- Audit Logging: Comprehensive security event tracking
- Sandbox Mode: Workspace restriction and resource control
- Defense in Depth: 5-layer security architecture
- Docker: Maximum isolation (IsolationLevel: 9)
- Deno: Fast TypeScript execution (Startup: 80ms)
- Bun: Ultra-fast JavaScript (Startup: 50ms)
- Node.js: Standard JavaScript execution
- Python: With automatic virtual environment
- npm: Node.js package installation
- pip: Python package installation with venv support
- Isolated Environments: Session-local package installations
- Prometheus Metrics: Application and system metrics
- Health Checks: Ready, live, and detailed health endpoints
- Docusaurus Docs: Comprehensive documentation site
- Code length limits (default: 100KB)
- Output sanitization (default: 1MB limit)
- File extension whitelisting
- Path traversal prevention
- Command injection blocking- Configurable per-session limits (default: 60/minute)
- Sliding time windows
- Automatic cleanup
- Audit integration- 12 event types tracked
- 4 severity levels
- In-memory queue (10,000 entries)
- Structured logging integration
- Query API for log analysis- Decorator pattern for any IExecutionEnvironment
- 5-layer security pipeline:
1. Rate limiting check
2. Input validation
3. Command execution
4. Output sanitization
5. Audit loggingpublic sealed class SecurityConfig
{
public bool EnableInputValidation { get; set; } = true;
public bool EnableRateLimiting { get; set; } = true;
public bool EnableAuditLogging { get; set; } = true;
public int MaxCodeLength { get; set; } = 100_000;
public int MaxOutputLength { get; set; } = 1_000_000;
public int ExecutionsPerMinute { get; set; } = 60;
public bool EnableSandbox { get; set; } = true;
// ... and more configuration options
}- No API changes (backward compatible)
- Security is opt-in via
SessionConfig.Security
{
"sessionConfig": {
"language": "javascript",
"security": {
"enableInputValidation": true,
"executionsPerMinute": 60,
"enableSandbox": true
}
}
}Total Lines Added: ~2,000 lines
New Files: 11 files
- Security Models: 4 files (~400 lines)
- Security Services: 3 files (~500 lines)
- Test Files: 4 files (~1,100 lines)
Test Coverage:
- Unit Tests: 93 tests
- Integration Tests: 54 tests
- Total: 147 tests
- Pass Rate: 98.1% (144/147 passing)
Security Overhead: ~3-10ms per execution (<1%)
Rate Limit Check: ~0.1ms
Input Validation: ~1-5ms
Audit Logging: ~0.5-2ms
Output Sanitization: ~1-3ms
Attack Vectors Tested: 9 categories
Detection Rate: 95.3% overall
- Directory Traversal: 100%
- Command Injection: 100%
- Package Injection: 100%
- Privilege Escalation: 100%
- DoS Protection: 100%
- Fork Bombs: 33% (rate limiting provides backup)
None - This release is fully backward compatible with existing deployments.
Security features are opt-in:
- Default configuration maintains existing behavior
- Enable security via
SessionConfig.Security - Gradual migration path available
- Fixed
IExecutionEnvironment.GetResourceUsageAsyncimplementation inSecurityEnhancedEnvironment - Fixed output sanitization for non-string result types
- Fixed shell command validation for
ExecuteShellCommand.CommandName
- All pre-existing warnings documented (no new warnings)
- Build system improvements for test execution
-
Fork Bomb Detection Coverage (Low Priority)
- Issue: Some fork bomb variants not detected by regex patterns
- Workaround: Rate limiting provides effective DoS protection
- Status: Tracked for enhancement in v1.1
-
Pre-existing Warnings (Informational)
- 4 compiler warnings from previous phases
- No functional impact
- Status: Documented, will be addressed in v1.1
-
Review Security Configuration
// Start with recommended production settings Security = new SecurityConfig { EnableInputValidation = true, EnableRateLimiting = true, EnableAuditLogging = true, ExecutionsPerMinute = 60 }
-
Test Rate Limits
- Monitor rate limit metrics
- Adjust
ExecutionsPerMinutebased on load
-
Review Blocked Patterns
- Customize
BlockedCommandPatternsfor your use case - Add domain-specific patterns as needed
- Customize
-
Configure Audit Log Retention
- Set
AuditLogRetentionDaysbased on compliance requirements - Implement log archival if needed
- Set
Step 1: Enable in Development
- Set EnableInputValidation = true
- Test with existing code patterns
- Verify no false positives
Step 2: Enable Rate Limiting
- Start with high limits (ExecutionsPerMinute = 1000)
- Monitor usage patterns
- Gradually reduce to production levels
Step 3: Enable Audit Logging
- Review log volume
- Set up log aggregation if needed
- Configure alerts for security violations
Step 4: Enable Sandbox Mode
- Test workspace restrictions
- Verify file access patterns
- Adjust AllowedFileExtensions as needed
Step 5: Production Deployment
- Use recommended production configuration
- Monitor security metrics
- Review audit logs regularlydotnet add package CodeBeaker.Core --version 1.0.0
dotnet add package CodeBeaker.Runtimes --version 1.0.0
dotnet add package CodeBeaker.API --version 1.0.0git clone https://github.com/yourusername/codebeaker.git
cd codebeaker
git checkout v1.0
dotnet build -c Release
dotnet testdocker pull codebeaker:1.0
docker run -p 5000:5000 codebeaker:1.0PHASE11_PRODUCTION_HARDENING_COMPLETE.md- Implementation detailsTEST_RESULTS_PHASE11.md- Comprehensive test resultsDEPLOYMENT_GUIDE_v1.0.md- Production deployment guideRELEASE_NOTES_v1.0.md- This document
README.md- Updated with security featuresARCHITECTURE.md- Security layer documentationdocs-site/- Docusaurus documentation site
- Enhanced fork bomb detection
- Audit log database persistence
- Advanced rate limiting (user-based, tiered)
- Security dashboard UI
- Multi-node distributed execution
- Load balancing and session affinity
- Enhanced monitoring and alerting
- Performance optimizations
- Additional runtime support (Ruby, Rust, Go)
- WebAssembly runtime
- Plugin system
- Multi-tenancy support
Thank you to all contributors who made this release possible!
MIT License - See LICENSE file for details
- Repository: https://github.com/yourusername/codebeaker
- Documentation: https://docs.codebeaker.dev
- Issues: https://github.com/yourusername/codebeaker/issues
- Discussions: https://github.com/yourusername/codebeaker/discussions
We'd love to hear from you!
- Bug Reports: Create an issue on GitHub
- Feature Requests: Start a discussion
- Security Issues: Email security@codebeaker.dev
- General Questions: Join our Discord/Slack community
Happy Coding! 🚀
CodeBeaker.API.dll: SHA256: [to be generated]
CodeBeaker.Core.dll: SHA256: [to be generated]
CodeBeaker.Runtimes.dll: SHA256: [to be generated]
Docker Image Digest: sha256:[to be generated]
- v1.0 (2025) - Initial production release with security hardening
- v0.9 (2025) - Beta release with multi-runtime support
- v0.1 (2025) - Alpha release with Docker runtime
End of Release Notes