Part VI — Automation Scripting

Chapter 16

Automating Security Tasks with Scripts

Domain 6

📖 Key Topics Covered

  • Automating Security Tasks
  • Practical Security Automation
  • Script 1: Failed Login Monitor
  • REPORT="/tmp/failed_logins_$(date +%Y%m%d).txt"
  • Script 2: System Security Audit
  • REPORT="/tmp/security_audit_$(date +%Y%m%d).txt"
  • Script 3: Network Port Scanner
  • Script 4: Log Rotation and Archival
  • Scheduling Scripts with Cron
  • Chapter Summary
  • Review Questions
  • Removes duplicate lines
  • Filters unique IP addresses
  • P A R T V I I
  • Protecting Data

🔑 Key Terms

FILES (excluding /proc /sys) LOGINS (Last 24 hours)

See the full definitions in the Glossary and test yourself with Flashcards.

Assessment Tips

💡 Assessment Tip

Be familiar with cron syntax: minute (0‐59), hour (0‐23), day of month (1‐31), month (1‐12), day of week (0‐7, where 0 and 7 are Sunday). An asterisk (*) means "every." Know how to schedule a script to run at specific intervals. Chapter Summary • Aut