Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

Security & hardeningShellSec series

Bash script vs security tool

Every security team argues: write the check in bash, or buy the tool. The honest answer is that they answer different questions.

Quick reference

BASHTOOL
InstallAlready on the boxAgent, licence, rollout
ScopeThe check you wroteThe catalogue it ships
NoiseYours to tuneRules, not your context
Evidencestdout and exit codeDashboard and tickets
SpeedSeconds, no daemonMinutes, a pipeline
Best forOne host, one questionFleet, audit, coverage

BASH (The check you wrote): Runs on the host you are on, in the minute you think of the check.

find / -perm -4000 -type f

TOOL (The catalogue you buy): Ships hundreds of rules, a fleet view and an audit trail.

trivy image api:1.4
  • Bash → the host you are on, now.
  • Tool → the fleet, the audit, the rules.

Explained

The script

Bash is already on the box. It reads the files and logs the host exposes, applies the rule you wrote, prints a line and exits non-zero. It has no agent, no database and no licence, and it runs in the same minute you think of the check. The cost is that you own the rule, the false positives and the maintenance.

The tool

A security tool ships a catalogue: hundreds of rules, a parser per format, a fleet view and an audit trail. It knows the checks you did not think of, and it keeps the evidence in one place. The cost is the agent, the licence, the rollout and the tuning, and the rule you need may still be missing.

Where they meet

The rows line up the trade. Bash is best at one host and one question, the thing you need at 03:00. A tool is best at fleet coverage and audit, the thing you need at quarter end. Neither replaces the other: the script catches the host-specific regression the tool has no rule for, and the tool catches the class of problem the script was never written to see.

The honest caveat: a script with no owner rots faster than a tool with no licence.

The lesson: use the tool for coverage, and write the script for the question only your host can ask.

Cover the fleet. Script the edge.

More notes: Security & hardening

Open in the notes app: search, filters, copy This note on GitHub