Habr•September 16, 2026•🇷🇺Translated from Russian

Developer Builds Custom Bouncer Tool to Automatically Block .env and SSH Probing on VPS

A system administrator managing a modest VPS hosting static sites behind Caddy decided to stop manually watching logs filled with brute-force attempts against SSH and automated scans for common sensitive files.

The server regularly received requests for wp-admin, .env, phpmyadmin, and backup configuration files even though no WordPress instance was present. At the same time, systemd-journal recorded repeated OpenSSH messages such as “Invalid user admin” and “Invalid user oracle”.

Although Fail2ban is widely used, the administrator found its configuration of jails, filters, and actions too cumbersome for web-related blocking and preferred a single binary with minimal dependencies.

How the custom solution works

The resulting tool, called Bouncer, first performs a controlled crawl of the site using a breadth-first queue limited by depth and total page count. It extracts internal links from HTML, records all discovered paths, and allows additional routes such as API endpoints to be added manually in the configuration.

When new entries appear in the Caddy access log showing a 404 response, the path is checked against the discovered list. Five unknown paths within a sliding time window trigger addition of the source IP to an nftables set that drops traffic before it reaches listening ports. Direct requests to files such as /.env result in immediate blocking without waiting for the threshold.

For SSH, the program parses journal entries and treats an “Invalid user” message as an immediate ban because legitimate users do not attempt non-existent accounts. Failed password attempts for existing users are counted within a time window instead.

  • The tool never replays old log files on startup, processing only new lines from the moment it begins.
  • Each site maintains its own path list and log source, allowing multiple Caddy virtual hosts to be protected by one process.
  • An installation script places the binary, generates a systemd unit, populates a whitelist with the administrator’s current IP, and inserts the required nftables drop rule in the correct chain order.

After switching from a previous prototype named CaddyBan, the administrator reported significantly cleaner logs and fewer manual reviews of connection attempts.

Related articles

Habr•Other

Rostelecom Refactors InfoSec Careers: Matching Employee Skills to Evolving Business Priorities

Rostelecom's information security block developed a systematic approach to reassess employee expertise and redirect talent to new roles when business structures change rapidly. In one case, an architect hired for a specific team was reassigned after the unit was disbanded, initially moving to a similar position that did not fully align with his broader competencies. HR-business partner Olga Lapshina examined the specialist's full background, including prior work in audits, methodology development, regulatory documentation, university teaching, and scientific research, plus strong mentoring abilities with younger staff. These skills matched the needs of the methodology department, leading to a transfer supported by an individual development plan and a mentor via the internal Tochka Rosta platform. Within two months the employee contributed improvements that accelerated preliminary InfoSec audits by 30 percent and risk assessments by 20 percent while expanding threat scenario coverage by 10 percent. The initiative demonstrates Rostelecom's emphasis on horizontal career movement and retention of experienced professionals through structured career tracks.

Habr•Other

How to Avoid Becoming the Hero of 'My Program Deleted 800 GB': Safe Recursive Deletion in Bash and Python

A recent Habr article examines dangerous patterns in recursive file deletion scripts that have caused massive data loss incidents, including an 800 GB wipe triggered by Telegram Desktop on Windows. The piece analyzes classic mistakes such as empty variables in rm commands and extra spaces that turned single paths into multiple destructive arguments, referencing the 2015 Steam Linux bug and the 2011 Bumblebee installer error. It provides hardened Bash templates using set -euo pipefail, ${VAR:?} checks, realpath validation, and --one-file-system flags to prevent deletion of forbidden directories or symlinked targets. The Python section introduces a safe_rmtree wrapper that enforces root boundaries, rejects symlinks, uses resolve(strict=True), and checks shutil.rmtree.avoids_symlink_attacks before proceeding. Additional recommendations include dry-run modes, marker files, temporary directory usage, and logging to make deletion operations auditable and reversible where possible.

AntiMalware•Other

Hackers tamper with refrigeration units in European supermarkets, setting temperatures to +50 °C

Attackers gained unauthorized access to refrigeration and freezer control systems in supermarkets across several European countries, including Sweden, Belgium, Luxembourg, and Estonia. In multiple locations they altered temperature settings to +50 °C, risking widespread spoilage of perishable goods. The incidents primarily affected older, unpatched Danfoss controllers that had been connected to networks for remote maintenance. Estonian manufacturer Kitman Coldtech reported that one attack on a legacy Danfoss system was detected and stopped within approximately ten minutes, preventing any damage. Similar intrusions were confirmed by Swedish chains ICA and Coop, following earlier incidents in French supermarkets in October that resulted in product losses. Experts note that legacy industrial controllers remain attractive targets because they are often left exposed once placed online for convenience.

Habr•Other

AmneziaWG Container for MikroTik Routers Delivers Top Performance Six Months After Launch

A developer released an AmneziaWG container for MikroTik devices in February 2026 and has since added major improvements in speed, protocol support, and stability. The lightweight container leverages the router's native WireGuard implementation for cryptography while handling AmneziaWG obfuscation in software. Performance now reaches 250-350 Mbit/s on models such as Hap Ax3 and RB5009B after switching to C code and increasing buffer sizes with RouterOS 7.24. New features include server mode for connecting multiple MikroTik devices, random port hopping, IPv6 support, dynamic DNS, and offline configuration. The project survived an early GitHub ban caused by test scripts and has grown to over 370 stars while remaining fully offline and privacy-focused.