✅ All phases completed:
Phase 1 - Backend (botserver):
- Protection module with manager, API routes, tool integrations
- Lynis, RKHunter, Chkrootkit, Suricata, LMD support
- Routes registered in main.rs
Phase 2 - Frontend (botui):
- Security page with Protection tab
- Removed unused askama dependencies
Phase 3 - Documentation (botbook):
- Comprehensive protection-tools.md documentation
- Added to SUMMARY.md
Phase 4 - BASIC Keywords:
- 8 new keywords for scripting security operations
- security_protection.rs with ETL functions
Closes security protection TODO.
6.6 KiB
6.6 KiB
Security Protection Module - Implementation TODO
Version: 1.0.0 Created: 2025 Status: ✅ COMPLETE
Overview
Implement a comprehensive Security Protection module that allows administrators to manage Linux server security tools (Lynis, RKHunter, Chkrootkit, Suricata, LMD, ClamAV) through the General Bots UI.
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ botui (Port 3000) │
│ ┌─────────────────────────────────────────────────────────────┐│
│ │ /suite/tools/security.html ││
│ │ ├── Tab: API Compliance Report (existing code_scanner) ││
│ │ └── Tab: Protection (NEW - security tools management) ││
│ └─────────────────────────────────────────────────────────────┘│
│ │ │
│ ▼ HTMX/API calls │
└──────────────────────────────┼───────────────────────────────────┘
│
┌──────────────────────────────┼───────────────────────────────────┐
│ botserver (Port 8088) │
│ ┌─────────────────────────────────────────────────────────────┐│
│ │ src/security/protection/ ││
│ │ ├── mod.rs # Module exports ││
│ │ ├── manager.rs # ProtectionManager orchestrator ││
│ │ ├── api.rs # Axum API routes ││
│ │ ├── lynis.rs # Lynis integration ││
│ │ ├── rkhunter.rs # RKHunter integration ││
│ │ ├── chkrootkit.rs # Chkrootkit integration ││
│ │ ├── suricata.rs # Suricata IDS/IPS integration ││
│ │ ├── lmd.rs # Linux Malware Detect integration ││
│ │ └── clamav.rs # ClamAV integration (extend existing)││
│ └─────────────────────────────────────────────────────────────┘│
└─────────────────────────────────────────────────────────────────┘
Phase 1: Backend Infrastructure (botserver) ✅ COMPLETE
1.1 Create Protection Module Structure ✅ DONE
1.2 Protection Manager ✅ DONE
1.3 Individual Tool Integrations ✅ DONE
- Lynis (
lynis.rs) - RKHunter (
rkhunter.rs) - Chkrootkit (
chkrootkit.rs) - Suricata (
suricata.rs) - LMD (
lmd.rs)
1.4 API Routes ✅ DONE
1.5 Update security/mod.rs ✅ DONE
1.6 Register Routes in Main ✅ DONE
1.7 Update command_guard.rs ✅ DONE
Phase 2: Frontend Updates (botui) ✅ COMPLETE
2.1 Security Page ✅ DONE
2.2 Navigation Updates ✅ DONE
2.3 Report Modal ✅ DONE
Phase 3: Documentation (botbook) ✅ COMPLETE
3.1 Create Protection Documentation ✅ DONE
File: botbook/src/23-security/protection-tools.md
3.2 Update SUMMARY.md ✅ DONE
Phase 4: BASIC/ETL Integration (botlib) ✅ COMPLETE
4.1 Add BASIC Keywords ✅ DONE
File: botserver/src/basic/keywords/security_protection.rs
New keywords added:
SECURITY TOOL STATUSSECURITY RUN SCANSECURITY GET REPORTSECURITY UPDATE DEFINITIONSSECURITY START SERVICESECURITY STOP SERVICESECURITY INSTALL TOOLSECURITY HARDENING SCORE
4.2 ETL Functions ✅ DONE
security_tool_status(tool_name)- Returns tool statussecurity_run_scan(tool_name)- Runs scansecurity_get_report(tool_name)- Gets latest reportsecurity_hardening_score()- Gets Lynis hardening indexsecurity_update_definitions(tool_name)- Updates signaturessecurity_start_service(tool_name)- Starts servicesecurity_stop_service(tool_name)- Stops servicesecurity_install_tool(tool_name)- Installs tool
Phase 5: Cleanup ✅ COMPLETE
5.1 Remove Unused Dependencies ✅ DONE
- Removed
askamafrom botui (not being used) - Removed
askama_axumfrom botui - Deleted
askama.tomlconfiguration file
File Checklist ✅ ALL COMPLETE
botserver/src/security/protection/
mod.rs✅manager.rs✅api.rs✅lynis.rs✅rkhunter.rs✅chkrootkit.rs✅suricata.rs✅lmd.rs✅installer.rs✅
botserver/src/security/
mod.rs- Updated with protection module exports ✅command_guard.rs- Added security tools to whitelist ✅
botserver/src/basic/keywords/
security_protection.rs✅mod.rs- Updated with security_protection module ✅
botserver/src/
main.rs- Registered protection routes ✅
botui/ui/suite/tools/
security.html✅
botui/
Cargo.toml- Removed askama dependencies ✅askama.toml- Deleted ✅
botbook/src/23-security/
protection-tools.md✅SUMMARY.md- Entry added ✅
Summary
All phases of the Security Protection Module have been completed:
- Backend Infrastructure - Full protection module with manager, API routes, and individual tool integrations
- Frontend UI - Security page with Protection tab showing all 6 tools
- Documentation - Comprehensive documentation in botbook
- BASIC Keywords - 8 new keywords for scripting security operations
- Cleanup - Removed unused askama dependencies from botui
The module is ready for integration testing with actual security tools installed on a Linux host.