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

How a Personal Site Counts Bots Without Storing Any IPs: Pure PHP, No Database, Strict CSP and 160 Tests

A personal website built entirely in pure PHP without frameworks or databases demonstrates advanced defensive security practices while tracking bot activity from an SSH honeypot. The site stores all content in a single JSON file with atomic writes and automatic backups, eliminating database-related attack surfaces and simplifying deployment to folder copying. Strict Content-Security-Policy rules prohibit inline styles and scripts without nonces, forcing the use of SVG attributes, CSSOM updates, and JSON data blocks instead of direct attribute injection. Over 160 automated tests written in PHP attack the site with XSS payloads, CSRF attempts, path traversals, and malformed Markdown to verify that no malicious output reaches the browser. Bot identification relies on behavioral signatures derived from the first twelve cleaned commands of each session, combined with HASSH fingerprints and activity patterns, allowing the site to report unique bot families and address counts without ever publishing IPs. Additional browser-based tests using Chromium validate accessibility, performance budgets, and CSP compliance across desktop and mobile viewports. The entire system runs with zero external dependencies and integrates tests directly into the deployment pipeline.

AntiMalware•Other

Russian Finance Ministry Seeks Central Bank Reports on Systematic P2P Transfers to Tax Authorities

The Russian Ministry of Finance has proposed amendments requiring the Central Bank to share data with the Federal Tax Service on individuals whose bank accounts show signs of regular income received from other private citizens. The changes target article 85 of the Tax Code and form part of the budget package bill numbered 617-9. Under the new rules, the Central Bank would identify such citizens through transaction analysis and transmit the information according to a future agreement with the tax service. The Federal Tax Service would also gain expanded powers to request bank statements from non-entrepreneurs without needing prior debt collection or audit triggers. If approved, the provisions would take effect on 1 January 2027 and apply to operations conducted after 1 January 2026. Separate bills under discussion would impose monthly transfer limits of 30,000 rubles on suspected clients starting in 2028 and require the tax service to notify the Central Bank about account openings and income categories.

安全客•Other

Baidu Launches Ciyuan Exchange to Establish Trust Standards for AI Model Trading

Baidu Intelligent Cloud has introduced the Ciyuan Exchange, a dedicated trading platform for large AI models that aims to solve quality verification and credit issues in an increasingly crowded market. The platform, unveiled at the Baidu World 2026 Conference, already hosts over 100 supply resources with daily calls exceeding 50 million and daily token usage surpassing 700 billion. Founder Li Yanhong positioned the exchange as an infrastructure layer that moves beyond simple model aggregation toward verifiable identity, ongoing performance monitoring, and supplier credit records. The initiative addresses real procurement risks where identical models from different providers show up to twofold differences in throughput and reliability, according to a China Academy of Information and Communications Technology report. By combining model fingerprinting, capability testing, periodic audits, and continuous credit scoring, the platform seeks to create transparent market mechanisms similar to commodity exchanges. This development signals a broader industry shift from raw model capability competition toward standardized service quality, pricing transparency, and reliable delivery infrastructure.

Habr•Other

Windows and MacBook Pro Setup Combines Local Network Access with Dual VPNs and Kill Switch Protection

A user detailed how they integrated an older MacBook Pro into an existing Windows workstation environment while preserving separate user accounts, file sharing, and independent VPN connections. The setup required careful routing configuration to keep the Kill Switch active on both Amnezia VLESS and AmneziaWG without breaking local SMB connectivity. After initial failures caused by the Windows Kill Switch blocking the 192.168.1.0/24 subnet, split tunneling was implemented to route local traffic directly. Separate macOS accounts were created for daily use and a dedicated “Serverok” account for remote scripting and compute tasks. SSH and SFTP ultimately replaced problematic SMB shares for the secondary account, enabling reliable file transfers at over 50 MB/s. The configuration allows simultaneous or sequential use of both machines while maintaining strong VPN protection on each.