A unified security management solution for Linux servers | Унифицированное решение для управления безопасностью Linux серверов
Linux Defender is an open-source security orchestration tool that unifies multiple security tools into a single, easy-to-use interface. Manage ClamAV, Fail2ban, Lynis, AIDE, Trivy, and more from one place.
Linux Defender — это open-source инструмент оркестрации безопасности, объединяющий множество инструментов безопасности в единый простой интерфейс.
- 🦠 ClamAV - Antivirus scanning with automatic database updates | Антивирусное сканирование с автоматическим обновлением баз данных
- 🚫 Fail2ban - Brute-force protection and automatic IP blocking | Защита от брутфорса и автоматическая блокировка IP
- 🔍 Lynis - Automated security auditing and hardening | Автоматический аудит безопасности и hardening
- 🕵️ Rootkit Detection - Rootkit and backdoor detection (rkhunter/chkrootkit) | Обнаружение руткитов и бэкдоров
- 📋 AIDE - File Integrity Monitoring (FIM) | Контроль целостности файлов
- 🔎 Trivy - Vulnerability scanner for installed packages | Сканер уязвимостей для установленных пакетов
- ⚙️ Wazuh - IDS/IPS, log monitoring, FIM (optional) | IDS/IPS, мониторинг логов (опционально)
- ⚡ Falco - Runtime security via eBPF (optional) | Runtime security через eBPF (опционально)
- 📧 Email Notifications - Get alerts via email | Получайте уведомления по email
- 🔔 Telegram Notifications - Real-time alerts via Telegram bot | Уведомления в реальном времени через Telegram бота
- 🌐 Webhook Support - Integrate with external services | Интеграция с внешними сервисами
- 📊 Daily Reports - Automated daily system and security status reports | Автоматические ежедневные отчеты о статусе системы и безопасности
- ⚡ Real-time Monitoring - Continuous monitoring of security events | Непрерывный мониторинг событий безопасности
- 🚨 Threat Alerts - Instant notifications when threats are detected | Мгновенные уведомления при обнаружении угроз
- Python 3.12+
- Ubuntu/Debian Linux (recommended | рекомендуется)
- Root/sudo access for security tool management | Доступ root/sudo для управления инструментами безопасности
- Install system security tools | Установите системные инструменты безопасности:
# ClamAV
sudo apt update
sudo apt install -y clamav clamav-daemon
# Fail2ban
sudo apt install -y fail2ban
# Lynis
sudo apt install -y lynis
# Rootkit detection | Обнаружение руткитов
sudo apt install -y rkhunter chkrootkit
# AIDE (File Integrity Monitoring | Контроль целостности файлов)
sudo apt install -y aide aide-common
# Trivy (Vulnerability Scanner | Сканер уязвимостей)
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo "deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/trivy.list
sudo apt update
sudo apt install -y trivy- Install Linux Defender | Установите Linux Defender:
# Clone the repository | Клонируйте репозиторий
git clone https://github.com/FUYOH666/linux-defender.git
cd linux-defender
# Install dependencies | Установите зависимости
uv sync
# or | или
pip install -e .
# Copy and configure | Скопируйте и настройте
cp config.yaml.example config.yaml
# Edit config.yaml to suit your needs | Отредактируйте config.yaml под свои нужды- Run Linux Defender | Запустите Linux Defender:
# Check status | Проверить статус
uv run linux-defender status
# Health check | Проверка здоровья
uv run linux-defender health
# Start daemon | Запустить демон
uv run linux-defender daemon# Check status of all modules | Проверить статус всех модулей
linux-defender status
# Detailed health check | Детальная проверка здоровья
linux-defender health
# Scan a path with ClamAV | Сканировать путь с ClamAV
linux-defender scan /home --module clamav
# Run security audit | Запустить аудит безопасности
linux-defender audit
# Update ClamAV databases | Обновить базы данных ClamAV
linux-defender update --module clamav
# Start/stop/restart modules | Запустить/остановить/перезапустить модули
linux-defender start --module fail2ban
linux-defender stop --module clamav
linux-defender restart --module fail2banRun Linux Defender as a background service | Запустите Linux Defender как фоновый сервис:
linux-defender daemonOr install as a systemd service (see linux-defender.service.example) | Или установите как systemd сервис (см. linux-defender.service.example).
Edit config.yaml to customize | Отредактируйте config.yaml для настройки:
- Module enable/disable | Включение/отключение модулей
- Scan schedules (cron format) | Расписания сканирования (формат cron)
- Scan paths and exclusions | Пути сканирования и исключения
- Notification settings (email/webhook/Telegram) | Настройки уведомлений (email/webhook/Telegram)
- Module-specific settings | Специфичные настройки модулей
-
Create a Telegram bot | Создайте Telegram бота:
- Message @BotFather on Telegram
- Send
/newbotand follow instructions - Save the bot token
-
Get your chat ID | Получите ваш chat ID:
- Send a message to your bot
- Visit:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Find your chat ID in the response
-
Configure | Настройте:
# Set environment variables | Установите переменные окружения export LINUX_DEFENDER__NOTIFICATIONS__TELEGRAM__BOT_TOKEN="your_bot_token" export LINUX_DEFENDER__NOTIFICATIONS__TELEGRAM__CHAT_ID="your_chat_id" # Or add to .env file | Или добавьте в .env файл echo 'LINUX_DEFENDER__NOTIFICATIONS__TELEGRAM__BOT_TOKEN="your_bot_token"' >> .env echo 'LINUX_DEFENDER__NOTIFICATIONS__TELEGRAM__CHAT_ID="your_chat_id"' >> .env
-
Enable in config.yaml | Включите в config.yaml:
notifications: telegram: enabled: true chat_id: "your_chat_id" # Can be numeric ID or username
Linux Defender can send daily system and security status reports via Telegram | Linux Defender может отправлять ежедневные отчеты о статусе системы и безопасности через Telegram:
- Automatic scheduling | Автоматическое планирование - Reports sent daily at configured time
- Delayed execution | Отложенное выполнение - If server is off, report sends on next boot
- Comprehensive information | Полная информация - System metrics, security status, module health
See INSTALL.md for detailed setup instructions | См. INSTALL.md для подробных инструкций по настройке.
See config.yaml.example for all available options | См. config.yaml.example для всех доступных опций.
- Installation Guide | Руководство по установке
- Configuration Example | Пример конфигурации
- Changelog | История изменений
- Contributing Guide | Руководство по участию
- Code of Conduct | Кодекс поведения
Contributions are welcome! | Вклад приветствуется!
Please read CONTRIBUTING.md for details | Пожалуйста, прочитайте CONTRIBUTING.md для деталей.
This project is licensed under the MIT License - see the LICENSE file for details | Этот проект лицензирован под MIT License - см. файл LICENSE для деталей.
- ClamAV team | Команда ClamAV
- Fail2ban developers | Разработчики Fail2ban
- Lynis project | Проект Lynis
- All security tool maintainers | Все поддерживающие инструменты безопасности
Made with ❤️ for Linux security | Сделано с ❤️ для безопасности Linux