| Recommend this page to a friend! |
| Info | Documentation | Reputation | Support forum | Blog | Links |
| Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
| 2026-07-29 (3 days ago) | Not yet rated by the users | Total: Not yet counted | Not yet ranked | |||||
| Version | License | PHP version | Categories | |||
| sentinela 1.0 | MIT/X Consortium ... | 5 | PHP 5, Web services, Security, Applic... |
| Description | Author | |||
This package provides a Linux protection tool with Web dashboard panel. Innovation Award
|
Please read this document to learn how to set up and run Linux DDoS protection tools.
> Firewall WAF + IDS/IPS + PHP Dashboard + Telegram Alerts ? todo en Bash, sin dependencias de Node.js o Python.
INPUT ? SENTINELA_INPUT ? SENTINELA_NEW ? DROP
| Chain | Purpose |
|-------|---------|
| SENTINELA_INPUT | base rules (loopback, ESTABLISHED, ICMP, anti-spoofing, port scan, SYN flood, ipsets, services) + DROP |
| SENTINELA_NEW | connlimit + rate limit for HTTP/HTTPS NEW connections |
Sentinela never runs iptables -F or iptables -P INPUT DROP. It only creates/manages its own named chains, ensuring SSH access is never accidentally locked out.
Scans Apache access logs for:
- SQLi: 40+ patterns (UNION, SLEEP, BENCHMARK, hex encoding, double URL encoding, stacked queries)
- XSS: <script>, onerror, onload, javascript:, event handlers
- LFI/RFI: ../, file://, php://filter, data://, expect://
- Scanners: .env, wp-config, .git/config, phpmyadmin, actuator, xmlrpc
- Malicious User-Agents: sqlmap, nikto, masscan, zgrab, Go-http-client
- DDoS: >100 requests from same IP in last 1000 log lines
- SSH brute force: failed login detection from /var/log/auth.log
- Honeypot: fake URL paths that trap and block scanners
Blocking is temporary via ipset with configurable timeout:
| ipset | Type | Default timeout | Purpose |
|-------|------|-----------------|---------|
| SENTINELA_TRUSTED | hash:ip | 86400s (24h) | Whitelisted IPs (auto: current SSH session) |
| SENTINELA_BLACKLIST | hash:ip | 600s (10 min) | All malicious IPs |
| SENTINELA_DDOS | hash:ip | 600s (10 min) | DDoS-behaving IPs |
| SENTINELA_REPUTATION | hash:net | 86400s (24h) | External blacklists (Spamhaus, Emerging Threats, etc.) |
| SENTINELA_HONEY | hash:ip | 3600s (1h) | Honeypot triggers |
Supports both rsyslog (Debian 12, file-based) and systemd-journald (Debian 13+, native):
- rsyslog: reads /var/log/auth.log, /var/log/apache2/access.log via tail -c with byte-position tracking
- journald: reads via journalctl with cursor-based tracking (no files needed)
- SSH auth detection works with both modes
- Apache access log detection works in both modes (Apache typically logs to files; journald mode reads from apache2.service journal)
- Switch by setting LOG_SYSTEM=rsyslog or LOG_SYSTEM=journald in /etc/sentinela/config.conf
| Service | Port | Access | Rate limit | Connlimit | |---------|------|--------|------------|-----------| | SSH | 7890 | WAN | 5/min per IP | 3/IP | | HTTP | 80 | WAN | 60/min per IP | 30/IP | | HTTPS | 443 | WAN | 60/min per IP | 30/IP | | MariaDB | 3306 | localhost only | ? | ? | | PHP-FPM | 8000-8008 | localhost only | ? | ? |
git clone https://github.com/zaer00t/sentinela.git /root/sentinela
cd /root/sentinela
bash install.sh
bash install.sh # Interactive (asks for each step)
bash install.sh --unattended # No prompts, use defaults
bash install.sh --dev # Symlinks instead of copies (for development)
# 1. Edit configuration
nano /etc/sentinela/config.conf
# 2. Set your Telegram bot (recommended)
# TELEGRAM_ENABLE=yes
# TELEGRAM_BOT_TOKEN=...
# TELEGRAM_CHAT_ID=...
# 3. Apply firewall
sentinela apply
# 4. Verify
sentinela status
File: /etc/sentinela/config.conf (root:root, chmod 600)
# === Network ===
IFACE=eth0
PORT_SSH=7890
PORT_HTTP=80
PORT_HTTPS=443
PORT_MYSQL=3306
# === Rate Limits ===
SSH_RATE_LIMIT=5
HTTP_RATE_LIMIT=60
HTTPS_RATE_LIMIT=60
SSH_CONNLIMIT=3
HTTP_CONNLIMIT=30
HTTPS_CONNLIMIT=30
# === Blocking ===
BAN_TIME=600
DDOS_BAN_TIME=600
# === Features ===
TELEGRAM_ENABLE=yes
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id
ROLLBACK_ENABLE=yes
ROLLBACK_TIMEOUT=90
REPUTATION_ENABLE=no
LOG_LEVEL=info
# === Services ===
ENABLE_SSH=yes
ENABLE_HTTP=yes
ENABLE_HTTPS=yes
ENABLE_MYSQL=yes
# === System Logger (rsyslog | journald) ===
# Debian 12 uses rsyslog (files), Debian 13+ uses journald by default.
LOG_SYSTEM=rsyslog
# === Logs ===
LOG_DIR=/var/log/sentinela
BACKUP_DIR=/var/backups/sentinela
BACKUP_RETENTION=7
# === IDS ===
IDS_APACHE_LOG=/var/log/apache2/access.log
IDS_SSH_LOG=/var/log/auth.log
sentinela apply # Apply firewall rules (with rollback)
sentinela stop # Remove Sentinela chains (safe)
sentinela restart # stop + apply
sentinela status # Show rule count, ipsets, active connections
sentinela ban 192.168.1.100 # Block IP (600s by default)
sentinela ban 192.168.1.100 "reason" # Block with reason
sentinela unban 192.168.1.100 # Unblock IP
sentinela flush # Clear all blocked IPs
sentinela banned # List currently banned IPs
sentinela scan # Scan Apache + SSH logs
sentinela reputation # Update external blacklists
sentinela health # Full system health check
sentinela attacks # Show attack log (last 50)
sentinela whitelist # Show trusted IPs
sentinela trust 1.2.3.4 # Add IP to TRUSTED (24h)
sentinela untrust 1.2.3.4 # Remove from TRUSTED
sentinela logs # Show general log (last 50 lines)
sentinela logs 100 # Show last 100 lines
sentinela attacks # Show attack detections
sentinela backup # Create full backup
sentinela restore # Restore from backup
sentinela geoip 8.8.8.8 # GeoIP lookup
sentinela telegram-test # Test Telegram connectivity
sentinela version # Show version
sentinela help # Full command reference
/usr/local/sentinela/
??? cli/
? ??? sentinela.sh # CLI entry point (dispatches all commands)
??? lib/
? ??? common.sh # Core functions, logging, config loading
? ??? rollback.sh # Firewall transaction + automatic rollback
? ??? snapshot.sh # iptables save/restore snapshots
? ??? ssh-session.sh # SSH session detection + TRUSTED ipset
??? firewall/
? ??? firewall.sh # Chain creation, rule orchestration
? ??? ssh.sh # SSH rules
? ??? http.sh # HTTP rules
? ??? https.sh # HTTPS rules
? ??? mysql.sh # MySQL/MariaDB rules
? ??? blacklist.sh # BLACKLIST ipset management
? ??? whitelist.sh # TRUSTED ipset management
? ??? geoip.sh # GeoIP lookup functions
??? ids/
? ??? apache.sh # Main Apache log scanner
? ??? sqli.sh # SQL injection patterns
? ??? xss.sh # XSS patterns
? ??? lfi.sh # LFI patterns
? ??? rfi.sh # RFI patterns
? ??? scanners.sh # Scanner detection + User-Agent check
? ??? ddos.sh # DDoS detection
? ??? ssh.sh # SSH brute force detection
??? ipset/
? ??? manager.sh # ipset create/destroy/list
??? telegram/
? ??? telegram.sh # Telegram alert sender with inline buttons
??? dashboard/
? ??? index.php # Bootstrap 5 + Chart.js frontend
? ??? api/index.php # REST API endpoints
? ??? assets/
? ??? css/dashboard.css
? ??? js/dashboard.js
??? cron/
? ??? cron.sh # Cron task definitions
??? backup/
? ??? restore.sh # Backup creation and restoration
??? systemd/
? ??? sentinela.service # Systemd oneshot unit
??? install.sh # Installer
??? uninstall.sh # Uninstaller
??? update.sh # Update script
/etc/sentinela/
??? config.conf # Configuration (root:root, chmod 600)
/var/log/sentinela/
??? sentinela.log # General log
??? banned.log # Banned IPs
??? attacks.log # Attack detections
/var/www/sentinela/ # Dashboard web root
The service applies firewall at boot and flushes on stop:
systemctl enable sentinela # Enable at boot
systemctl start sentinela # Apply firewall
systemctl stop sentinela # Remove Sentinela chains
systemctl status sentinela # Check status
Unit file: /etc/systemd/system/sentinela.service
[Unit]
Description=Sentinela ? Intelligent Linux Security Framework
After=network-online.target iptables.service ipset.service
Wants=network-online.target
DefaultDependencies=no
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/sentinela start
ExecStop=/usr/local/bin/sentinela stop
ExecReload=/usr/local/bin/sentinela restart
Installed via /etc/cron.d/sentinela:
| Interval | Command | Purpose |
|----------|---------|---------|
| /5 * | sentinela scan | IDS log scanning |
| 0 | sentinela reputation | Update external blacklists |
| 0 3 * | sentinela backup | Daily backup |
| 0 4 * | sentinela cleanup | Rotate logs, clean cache |
| /10 * | sentinela health | System health check |
| File | Content |
|------|---------|
| /var/log/sentinela/sentinela.log | All events (INFO, WARN, ERROR, FATAL) |
| /var/log/sentinela/banned.log | Block/unblock events with reason |
| /var/log/sentinela/attacks.log | Detected attacks with full context |
| /var/log/sentinela/dashboard.json | Dashboard stats cache |
Access: https://sen.moit.in/ (or http://<server>:8080 if using default vhost)
Features: - Firewall status overview (rules, ipsets, active connections) - Top 10 attacking IPs with geolocation - Attack timeline (last 24h by type) - Country distribution map - Ban/unban IP from web UI - Real-time auto-refresh every 10 seconds
| Endpoint | Method | Description |
|----------|--------|-------------|
| /api/ | GET | API status |
| /api?action=status | GET | Firewall status |
| /api?action=stats | GET | Statistics for charts |
| /api?action=banned | GET | Currently banned IPs |
| /api?action=attacks | GET | Recent attacks |
| /api?action=top_ips | GET | Top 10 attackers |
| /api?action=top_countries | GET | Attack distribution by country |
| /api?action=geoip&ip=X.X.X.X | GET | GeoIP lookup |
| /api?action=ban&ip=X.X.X.X | POST | Block an IP |
| /api?action=unban&ip=X.X.X.X | POST | Unblock an IP |
# 1. Edit files in /root/sentinela/
nano /root/sentinela/lib/common.sh
# 2. Sync to installed directory
cp /root/sentinela/lib/common.sh /usr/local/sentinela/lib/common.sh
# 3. Test syntax
bash -n /usr/local/sentinela/lib/common.sh
# 4. Test the command
sentinela apply
The CLI can run directly from the source directory:
export SENTINELA_DIR=/root/sentinela
export SENTINELA_CONFIG=/root/sentinela/config.conf
bash /root/sentinela/cli/sentinela.sh status
To test SQLi detection against a custom log line:
echo 'GET /?id=1%27%20UNION%20SELECT%201,2,3-- HTTP/1.1' >> /tmp/test.log
sed -i 's|IDS_APACHE_LOG=.*|IDS_APACHE_LOG=/tmp/test.log|' /etc/sentinela/config.conf
sentinela scan
If you lose SSH access:
# From console/out-of-band management:
sentinela flush
# or
systemctl stop sentinela
journalctl -u sentinela.service --no-pager -l
# Most common cause: SSH_CLIENT unbound variable
# Fix: ensure ${SSH_CLIENT:-} uses default value syntax
sentinela telegram-test
# Check /var/log/sentinela/sentinela.log for errors
# Verify TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID in config.conf
# Ensure jq is installed: apt-get install -y jq
# Check Apache error log
tail -50 /var/log/apache2/error.log
# Verify www-data has sudo access
sudo -u www-data sudo -n ipset list SENTINELA_BLACKLIST
# Check dashboard.json exists
cat /var/log/sentinela/dashboard.json
sentinela uninstall
This removes:
- iptables chains (SENTINELA_INPUT, SENTINELA_NEW)
- All ipsets
- Systemd service
- Cron jobs
- /usr/local/sentinela/
- /usr/local/bin/sentinela
- Logs and backups (prompts for confirmation)
Does not remove:
- Apache configuration
- GeoIP databases
- Packages (iptables, ipset, etc.)
- /etc/sentinela/config.conf (backed up to /etc/sentinela/config.conf.uninstalled)
MIT
Sentinela ? because your server deserves better than a default iptables policy.
<hr> <hr>
<div align="center"> <h1>?? Versión en Español</h1> </div>
> Firewall WAF + IDS/IPS + Panel PHP + Alertas Telegram ? todo en Bash, sin Node.js ni Python.
INPUT ? SENTINELA_INPUT ? SENTINELA_NEW ? DROP
| Cadena | Propósito |
|--------|-----------|
| SENTINELA_INPUT | reglas base (loopback, ESTABLISHED, ICMP, anti-spoofing, escaneo de puertos, SYN flood, ipsets, servicios) + DROP |
| SENTINELA_NEW | connlimit + rate limit para conexiones HTTP/HTTPS NEW |
Sentinela nunca ejecuta iptables -F ni iptables -P INPUT DROP. Solo crea/administra sus propias cadenas, garantizando que el acceso SSH nunca se pierda accidentalmente.
Escanea logs de Apache en busca de:
- SQLi: más de 40 patrones (UNION, SLEEP, BENCHMARK, codificación hex, doble URL encoding, consultas apiladas)
- XSS: <script>, onerror, onload, javascript:, manejadores de eventos
- LFI/RFI: ../, file://, php://filter, data://, expect://
- Escáneres: .env, wp-config, .git/config, phpmyadmin, actuator, xmlrpc
- User-Agents maliciosos: sqlmap, nikto, masscan, zgrab, Go-http-client
- DDoS: más de 100 peticiones de la misma IP en las últimas 1000 líneas del log
- Fuerza bruta SSH: detección de intentos de login fallidos desde /var/log/auth.log
- Honeypot: rutas URL falsas que atrapan y bloquean escáneres
El bloqueo es temporal via ipset con timeout configurable:
| ipset | Tipo | Timeout por defecto | Propósito |
|-------|------|---------------------|-----------|
| SENTINELA_TRUSTED | hash:ip | 86400s (24h) | IPs en lista blanca (automático: sesión SSH actual) |
| SENTINELA_BLACKLIST | hash:ip | 600s (10 min) | Todas las IPs maliciosas |
| SENTINELA_DDOS | hash:ip | 600s (10 min) | IPs con comportamiento DDoS |
| SENTINELA_REPUTATION | hash:net | 86400s (24h) | Listas negras externas (Spamhaus, Emerging Threats, etc.) |
| SENTINELA_HONEY | hash:ip | 3600s (1h) | Disparadores del honeypot |
Soporta rsyslog (Debian 12, basado en archivos) y systemd-journald (Debian 13+, nativo):
- rsyslog: lee /var/log/auth.log, /var/log/apache2/access.log via tail -c con seguimiento por posición de byte
- journald: lee via journalctl con seguimiento por cursor (sin necesidad de archivos)
- La detección de fuerza bruta SSH funciona con ambos modos
- La detección en logs de Apache funciona en ambos modos (Apache normalmente escribe a archivos; el modo journald lee del journal de apache2.service)
- Cambia configurando LOG_SYSTEM=rsyslog o LOG_SYSTEM=journald en /etc/sentinela/config.conf
| Servicio | Puerto | Acceso | Límite de tasa | Límite de conexiones | |----------|--------|--------|----------------|---------------------| | SSH | 7890 | WAN | 5/min por IP | 3/IP | | HTTP | 80 | WAN | 60/min por IP | 30/IP | | HTTPS | 443 | WAN | 60/min por IP | 30/IP | | MariaDB | 3306 | solo localhost | ? | ? | | PHP-FPM | 8000-8008 | solo localhost | ? | ? |
git clone https://github.com/zaer00t/sentinela.git /root/sentinela
cd /root/sentinela
bash install.sh
bash install.sh # Interactivo (pregunta en cada paso)
bash install.sh --unattended # Sin preguntas, usa valores por defecto
bash install.sh --dev # Enlaces simbólicos en lugar de copias (para desarrollo)
# 1. Editar configuración
nano /etc/sentinela/config.conf
# 2. Configurar bot de Telegram (recomendado)
# TELEGRAM_ENABLE=yes
# TELEGRAM_BOT_TOKEN=...
# TELEGRAM_CHAT_ID=...
# 3. Aplicar firewall
sentinela apply
# 4. Verificar
sentinela status
Archivo: /etc/sentinela/config.conf (root:root, chmod 600)
# === Red ===
IFACE=eth0
PORT_SSH=7890
PORT_HTTP=80
PORT_HTTPS=443
PORT_MYSQL=3306
# === Límites de tasa ===
SSH_RATE_LIMIT=5
HTTP_RATE_LIMIT=60
HTTPS_RATE_LIMIT=60
SSH_CONNLIMIT=3
HTTP_CONNLIMIT=30
HTTPS_CONNLIMIT=30
# === Bloqueo ===
BAN_TIME=600
DDOS_BAN_TIME=600
# === Funcionalidades ===
TELEGRAM_ENABLE=yes
TELEGRAM_BOT_TOKEN=token_de_tu_bot
TELEGRAM_CHAT_ID=tu_chat_id
ROLLBACK_ENABLE=yes
ROLLBACK_TIMEOUT=90
REPUTATION_ENABLE=no
LOG_LEVEL=info
# === Servicios ===
ENABLE_SSH=yes
ENABLE_HTTP=yes
ENABLE_HTTPS=yes
ENABLE_MYSQL=yes
# === Sistema de logging (rsyslog | journald) ===
LOG_SYSTEM=rsyslog
# === Logs ===
LOG_DIR=/var/log/sentinela
BACKUP_DIR=/var/backups/sentinela
BACKUP_RETENTION=7
# === IDS ===
IDS_APACHE_LOG=/var/log/apache2/access.log
IDS_SSH_LOG=/var/log/auth.log
sentinela apply # Aplicar reglas de firewall (con rollback)
sentinela stop # Eliminar cadenas de Sentinela (seguro)
sentinela restart # stop + apply
sentinela status # Mostrar conteo de reglas, ipsets, conexiones activas
sentinela ban 192.168.1.100 # Bloquear IP (600s por defecto)
sentinela ban 192.168.1.100 "motivo" # Bloquear IP con motivo
sentinela unban 192.168.1.100 # Desbloquear IP
sentinela flush # Limpiar todas las IPs bloqueadas
sentinela banned # Listar IPs bloqueadas actualmente
sentinela scan # Escanear logs de Apache + SSH
sentinela reputation # Actualizar listas negras externas
sentinela health # Verificación completa del sistema
sentinela attacks # Mostrar log de ataques (últimos 50)
sentinela whitelist # Mostrar IPs de confianza
sentinela trust 1.2.3.4 # Agregar IP a TRUSTED (24h)
sentinela untrust 1.2.3.4 # Eliminar de TRUSTED
sentinela logs # Mostrar log general (últimas 50 líneas)
sentinela logs 100 # Mostrar últimas 100 líneas
sentinela attacks # Mostrar detecciones de ataques
sentinela backup # Crear backup completo
sentinela restore # Restaurar desde backup
sentinela geoip 8.8.8.8 # Consulta GeoIP
sentinela telegram-test # Probar conectividad con Telegram
sentinela version # Mostrar versión
sentinela help # Referencia completa de comandos
/usr/local/sentinela/
??? cli/
? ??? sentinela.sh # Punto de entrada CLI (despacha todos los comandos)
??? lib/
? ??? common.sh # Funciones principales, logging, carga de configuración
? ??? rollback.sh # Transacción de firewall + rollback automático
? ??? snapshot.sh # Guardado/restauración de snapshots de iptables
? ??? ssh-session.sh # Detección de sesión SSH + ipset TRUSTED
??? firewall/
? ??? firewall.sh # Creación de cadenas, orquestación de reglas
? ??? ssh.sh # Reglas SSH
? ??? http.sh # Reglas HTTP
? ??? https.sh # Reglas HTTPS
? ??? mysql.sh # Reglas MySQL/MariaDB
? ??? blacklist.sh # Gestión del ipset BLACKLIST
? ??? whitelist.sh # Gestión del ipset TRUSTED
? ??? geoip.sh # Funciones de consulta GeoIP
??? ids/
? ??? apache.sh # Escáner principal de logs de Apache
? ??? sqli.sh # Patrones de inyección SQL
? ??? xss.sh # Patrones XSS
? ??? lfi.sh # Patrones LFI
? ??? rfi.sh # Patrones RFI
? ??? scanners.sh # Detección de escáneres + verificación de User-Agent
? ??? ddos.sh # Detección DDoS
? ??? ssh.sh # Detección de fuerza bruta SSH
??? ipset/
? ??? manager.sh # Crear/destruir/listar ipsets
??? telegram/
? ??? telegram.sh # Envío de alertas Telegram con botones inline
??? dashboard/
? ??? index.php # Frontend Bootstrap 5 + Chart.js
? ??? api/index.php # Endpoints de la API REST
? ??? assets/
? ??? css/dashboard.css
? ??? js/dashboard.js
??? cron/
? ??? cron.sh # Definiciones de tareas cron
??? backup/
? ??? restore.sh # Creación y restauración de backups
??? systemd/
? ??? sentinela.service # Unidad oneshot de systemd
??? install.sh # Instalador
??? uninstall.sh # Desinstalador
??? update.sh # Script de actualización
/etc/sentinela/
??? config.conf # Configuración (root:root, chmod 600)
/var/log/sentinela/
??? sentinela.log # Log general
??? banned.log # IPs bloqueadas
??? attacks.log # Detecciones de ataques
/var/www/sentinela/ # Raíz web del panel
El servicio aplica el firewall al inicio y lo limpia al detenerse:
systemctl enable sentinela # Habilitar al inicio
systemctl start sentinela # Aplicar firewall
systemctl stop sentinela # Eliminar cadenas de Sentinela
systemctl status sentinela # Ver estado
Archivo de unidad: /etc/systemd/system/sentinela.service
[Unit]
Description=Sentinela ? Intelligent Linux Security Framework
After=network-online.target iptables.service ipset.service
Wants=network-online.target
DefaultDependencies=no
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/sentinela start
ExecStop=/usr/local/bin/sentinela stop
ExecReload=/usr/local/bin/sentinela restart
Instaladas via /etc/cron.d/sentinela:
| Intervalo | Comando | Propósito |
|-----------|---------|-----------|
| /5 * | sentinela scan | Escaneo IDS de logs |
| 0 | sentinela reputation | Actualizar listas negras externas |
| 0 3 * | sentinela backup | Backup diario |
| 0 4 * | sentinela cleanup | Rotar logs, limpiar caché |
| /10 * | sentinela health | Verificación de salud del sistema |
| Archivo | Contenido |
|---------|-----------|
| /var/log/sentinela/sentinela.log | Todos los eventos (INFO, WARN, ERROR, FATAL) |
| /var/log/sentinela/banned.log | Eventos de bloqueo/desbloqueo con motivo |
| /var/log/sentinela/attacks.log | Ataques detectados con contexto completo |
| /var/log/sentinela/dashboard.json | Caché de estadísticas del panel |
Acceso: https://sen.moit.in/ (o http://<servidor>:8080 si se usa el vhost por defecto)
Características: - Resumen del estado del firewall (reglas, ipsets, conexiones activas) - Top 10 IPs atacantes con geolocalización - Línea de tiempo de ataques (últimas 24h por tipo) - Mapa de distribución por país - Bloquear/desbloquear IP desde la interfaz web - Auto-actualización en tiempo real cada 10 segundos
| Endpoint | Método | Descripción |
|----------|--------|-------------|
| /api/ | GET | Estado de la API |
| /api?action=status | GET | Estado del firewall |
| /api?action=stats | GET | Estadísticas para gráficos |
| /api?action=banned | GET | IPs bloqueadas actualmente |
| /api?action=attacks | GET | Ataques recientes |
| /api?action=top_ips | GET | Top 10 atacantes |
| /api?action=top_countries | GET | Distribución de ataques por país |
| /api?action=geoip&ip=X.X.X.X | GET | Consulta GeoIP |
| /api?action=ban&ip=X.X.X.X | POST | Bloquear una IP |
| /api?action=unban&ip=X.X.X.X | POST | Desbloquear una IP |
# 1. Editar archivos en /root/sentinela/
nano /root/sentinela/lib/common.sh
# 2. Sincronizar al directorio de instalación
cp /root/sentinela/lib/common.sh /usr/local/sentinela/lib/common.sh
# 3. Probar sintaxis
bash -n /usr/local/sentinela/lib/common.sh
# 4. Probar el comando
sentinela apply
El CLI puede ejecutarse directamente desde el directorio fuente:
export SENTINELA_DIR=/root/sentinela
export SENTINELA_CONFIG=/root/sentinela/config.conf
bash /root/sentinela/cli/sentinela.sh status
Para probar la detección SQLi con una línea de log personalizada:
echo 'GET /?id=1%27%20UNION%20SELECT%201,2,3-- HTTP/1.1' >> /tmp/test.log
sed -i 's|IDS_APACHE_LOG=.*|IDS_APACHE_LOG=/tmp/test.log|' /etc/sentinela/config.conf
sentinela scan
Si pierdes el acceso SSH:
# Desde la consola o gestión fuera de banda:
sentinela flush
# o
systemctl stop sentinela
journalctl -u sentinela.service --no-pager -l
# Causa más común: variable SSH_CLIENT sin valor
# Solución: asegurarse de usar ${SSH_CLIENT:-} con sintaxis de valor por defecto
sentinela telegram-test
# Revisar /var/log/sentinela/sentinela.log para errores
# Verificar TELEGRAM_BOT_TOKEN y TELEGRAM_CHAT_ID en config.conf
# Asegurar que jq está instalado: apt-get install -y jq
# Revisar el log de errores de Apache
tail -50 /var/log/apache2/error.log
# Verificar que www-data tiene acceso sudo
sudo -u www-data sudo -n ipset list SENTINELA_BLACKLIST
# Verificar que dashboard.json existe
cat /var/log/sentinela/dashboard.json
sentinela uninstall
Esto elimina:
- Cadenas de iptables (SENTINELA_INPUT, SENTINELA_NEW)
- Todos los ipsets
- Servicio systemd
- Tareas cron
- /usr/local/sentinela/
- /usr/local/bin/sentinela
- Logs y backups (pide confirmación)
No elimina:
- Configuración de Apache
- Bases de datos GeoIP
- Paquetes (iptables, ipset, etc.)
- /etc/sentinela/config.conf (se respalda como /etc/sentinela/config.conf.uninstalled)
MIT
Sentinela ? porque tu servidor merece algo mejor que una política iptables por defecto.
| File | Role | Description | ||
|---|---|---|---|---|
| Data | Auxiliary data | |||
| Doc. | Documentation | |||
| Data | Auxiliary data | |||
| Data | Auxiliary data | |||
| / | dashboard |
| / | firewall |
| File | Role | Description |
|---|---|---|
| |
Data | Auxiliary data |
| |
Data | Auxiliary data |
| |
Data | Auxiliary data |
| |
Data | Auxiliary data |
| |
Data | Auxiliary data |
| |
Data | Auxiliary data |
| |
Data | Auxiliary data |
| |
Data | Auxiliary data |
| / | ids |
| / | lib |
| File | Role | Description |
|---|---|---|
| |
Data | Auxiliary data |
| |
Data | Auxiliary data |
| |
Data | Auxiliary data |
| |
Data | Auxiliary data |
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
| Version Control | Unique User Downloads | |||||||
| 100% |
|
| Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.