Lion Cipher Lab
Automate your daily security checks with a Python script
- Cyber / Security Engineer
- Intermediate
- ~60 min
- Free · no account required
Why it matters
The security checks that actually get skipped are the boring, daily ones — is anything new listening on the network, are patches outstanding, is the firewall still up, did a critical config file change overnight. A human does them inconsistently, at best. A script does them the exact same way every single day, at 8am, without being asked, and hands you a five-line summary you can read in ten seconds. That is the real payoff of automation: not cleverness, but CONSISTENCY — the tireless repetition of the checks you would otherwise forget. This lab teaches you to build one such automation end to…
What you'll learn
- building a small, reusable automation instead of a one-off script
- running read-only shell commands safely from Python with subprocess.run
- hashing files with hashlib (SHA-256) to detect change — file integrity monitoring
- designing readable status output (OK / WARN / FAIL / SKIP) and a meaningful exit code
- writing checks that fail safely and are idempotent (safe to re-run)
- scheduling a script with cron (Linux/macOS) and Task Scheduler (Windows)
- the judgment call: deciding what to automate and what to leave to a human
Steps in this lab
- Read this first: when to automate, and when NOT to
- What we're building
- Confirm Python is installed
- The safe runner, and check #1 — what's listening
- Checks #2 and #3 — updates and firewall
- Check #4 — catch changes with a SHA-256 baseline
- Assemble the whole script and run it
- Schedule it — cron (Linux/macOS) and Task Scheduler (Windows)
- When automation bites back — idempotency and silent failure
- What you proved — and where to point it next