secubox-openwrt/package/secubox/secubox-dns-guard/files/etc/init.d/dns-guard
CyberMind-FR 0e0749ed08 feat: Add threat-analyst, dns-guard, mcp-server and DNS provider DynDNS
New packages:
- secubox-threat-analyst: AI-powered threat analysis with CrowdSec integration
- luci-app-threat-analyst: LuCI dashboard for threat intelligence
- secubox-dns-guard: DNS security monitoring and blocking
- secubox-mcp-server: Model Context Protocol server for AI assistant integration

Enhancements:
- dns-provider: Add DynDNS support (dyndns, get, update, domains commands)
- gandi.sh: Full DynDNS with WAN IP detection and record updates
- luci-app-dnsguard: Upgrade to v1.1.0 with improved dashboard

Infrastructure:
- BIND9 DNS setup for secubox.in with CAA records
- Wildcard SSL certificates via DNS-01 challenge
- HAProxy config fixes for secubox.in subdomains
- Mail server setup with Roundcube webmail

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 08:30:28 +01:00

69 lines
1.3 KiB
Bash

#!/bin/sh /etc/rc.common
# SecuBox DNS Guard - AI-powered DNS anomaly detection
START=95
STOP=10
USE_PROCD=1
NAME="dns-guard"
PROG="/usr/bin/dns-guard"
start_service() {
local enabled
config_load dns-guard
config_get enabled main enabled 0
[ "$enabled" != "1" ] && {
logger -t "$NAME" "Service disabled in config"
return 0
}
# Ensure dnsmasq logging is enabled
ensure_dnsmasq_logging
procd_open_instance
procd_set_param command "$PROG" daemon
procd_set_param respawn
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param pidfile /var/run/${NAME}.pid
procd_close_instance
logger -t "$NAME" "Started DNS Guard daemon"
}
stop_service() {
logger -t "$NAME" "Stopped DNS Guard daemon"
}
reload_service() {
stop
start
}
service_triggers() {
procd_add_reload_trigger "dns-guard"
}
ensure_dnsmasq_logging() {
# Check if dnsmasq query logging is enabled
local log_queries=$(uci -q get dhcp.@dnsmasq[0].logqueries)
local log_facility=$(uci -q get dhcp.@dnsmasq[0].logfacility)
if [ "$log_queries" != "1" ]; then
logger -t "$NAME" "Enabling dnsmasq query logging for DNS Guard"
uci set dhcp.@dnsmasq[0].logqueries='1'
uci set dhcp.@dnsmasq[0].logfacility='/var/log/dnsmasq.log'
uci commit dhcp
/etc/init.d/dnsmasq restart
fi
}
status() {
"$PROG" status
}
boot() {
start
}