Updated in 2026: this article was originally written in 2020 and focused mainly on Prospector and Bandit. The updated version keeps that original idea, but adds a more modern Python static analysis workflow using Ruff, Bandit, Mypy and Pylint. Python scripts are dangerous when they become invisible. Not dangerous in a movie-hacker way. Dangerous in the boring real-world way. A small script starts as a quick helper. Then it ends up running from cron. Then it touches backups, logs, Docker containers, firewall data, API keys, file permissions, or some random directory on a Linux server. Months later, nobody remembers exactly what it does, but everyone hopes it keeps working. That is where Python static code analysis is useful. Static analysis checks code before you run it. It can catch common bugs, insecure patterns, style problems, type mistakes, unused imports, dangerous function calls and other issues that are easy to miss when a script is small and “just works”. In the or...
Practical Linux homelab security notes from real old hardware, real Docker hosts, real firewall rules, real mistakes, and boring setups that keep working.