Network Anomaly Agent (secubox-network-anomaly): - 5 detection modules: bandwidth, connection flood, port scan, DNS, protocol - EMA-based baseline comparison - LocalAI integration for threat assessment - network-anomalyctl CLI LocalRecall Memory System (secubox-localrecall): - Persistent memory for AI agents - Categories: threats, decisions, patterns, configs, conversations - EMA-based importance scoring - LocalAI integration for summarization - localrecallctl CLI with 13 commands AI Insights Dashboard (luci-app-ai-insights): - Unified view across all AI agents - Security posture scoring (0-100) - Agent status grid with alert counts - Aggregated alerts from all agents - Run All Agents and AI Analysis actions LuCI Dashboards: - luci-app-network-anomaly with real-time stats - luci-app-localrecall with memory management Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
46 lines
1.0 KiB
Bash
46 lines
1.0 KiB
Bash
#!/bin/sh /etc/rc.common
|
|
# LocalRecall Memory Cleanup Daemon
|
|
|
|
START=99
|
|
STOP=10
|
|
USE_PROCD=1
|
|
|
|
CONFIG="localrecall"
|
|
|
|
start_service() {
|
|
local enabled auto_cleanup cleanup_hour
|
|
|
|
config_load "$CONFIG"
|
|
config_get enabled main enabled 0
|
|
config_get auto_cleanup cleanup auto_cleanup 1
|
|
config_get cleanup_hour cleanup cleanup_hour 3
|
|
|
|
[ "$enabled" = "1" ] || return 0
|
|
[ "$auto_cleanup" = "1" ] || return 0
|
|
|
|
# Schedule daily cleanup via cron instead of daemon
|
|
# This is more efficient for periodic tasks
|
|
local cron_entry="0 $cleanup_hour * * * /usr/bin/localrecallctl cleanup -q"
|
|
|
|
# Add to crontab if not present
|
|
if ! grep -q "localrecallctl cleanup" /etc/crontabs/root 2>/dev/null; then
|
|
echo "$cron_entry" >> /etc/crontabs/root
|
|
/etc/init.d/cron restart 2>/dev/null
|
|
fi
|
|
|
|
# Initialize storage
|
|
mkdir -p /var/lib/localrecall
|
|
}
|
|
|
|
stop_service() {
|
|
# Remove from crontab
|
|
if [ -f /etc/crontabs/root ]; then
|
|
sed -i '/localrecallctl cleanup/d' /etc/crontabs/root
|
|
/etc/init.d/cron restart 2>/dev/null
|
|
fi
|
|
}
|
|
|
|
service_triggers() {
|
|
procd_add_reload_trigger "$CONFIG"
|
|
}
|