Skip to main content
Cybersecurity

Defensive Security Tutorial with Examples.

Defensive security tutorial: detection as code on logs you generate, from auth logs, Sigma rules and Suricata to alert tuning, incident response, YARA and DKIM.

Beginner

Start here — no prior experience needed

1 lesson

Intermediate

For developers with core concepts down

6 lessons
defensive-security intermediate
5 min read

Write a Sigma rule for SSH password failures, watch a too-strict field match find nothing, fix it, add a brute-force correlation, map it to MITRE ATT&CK.

defensive-security intermediate
5 min read

Capture your own HTTP traffic, run Suricata 8 over the pcap with a local rule, and see why checksum offload and a port-80 rule both cause silent misses.

defensive-security intermediate
5 min read

One noisy Suricata rule, 41 alerts and 38 of them benign. Triage by grouping, then tune with suppress and threshold, and measure what each change hides.

defensive-security intermediate
5 min read

Collect a compromised container's processes, a deleted binary, file changes and an image, hash it all, isolate it, and see what stopping first loses.

defensive-security intermediate
5 min read

Merge SSH auth logs, a web access log and Suricata alerts into one UTC timeline in Python, and fix the timezone bug that puts an attack in the wrong order.

defensive-security intermediate
5 min read

Triage a suspicious file safely with sha256sum, file and strings, then write a YARA rule that matches the EICAR test file and not a note that mentions it.

Advanced

Production-grade patterns for experienced engineers

1 lesson

Also part of Defensive Security

Taught in other topics. Each link opens the lesson in its home topic.

6 lessons
monitoring intermediate
5 min read

Prometheus evaluates alert rules and Alertmanager delivers notifications — two separate systems. A misconfigured link between them lets an alert fire silently forever, with real Prometheus and Alertmanager API output proving it.

monitoring advanced
5 min read

Every alert notification Alertmanager sends already carries the raw material for MTTR: startsAt and endsAt. Log them for real, compute a real mean-time-to-resolve, and see why the number it produces is longer than the actual outage.

security-fundamentals intermediate
5 min read

Log failed logins as JSON events, catch the bug that writes the password into the log, redact it, stop log injection, and alert on 5 failures in 60s.

networking beginner
5 min read

Capture a real TCP connection with tcpdump in a Docker lab: SYN, SYN-ACK, ACK, the data, the FIN close, and the RST that makes Connection refused.

networking intermediate
5 min read

Firewall a container's own port with nftables: a drop rule makes clients time out, reject makes them refused, and a source allow-list lets one host in.

cloud-security intermediate
5 min read

Search CloudTrail JSON with Python for root console logins, new access keys, IAM policy changes and public buckets, then build a sorted attack timeline.