The Cybersecurity Picture Book
people & policy perimeter · firewall network · segmentation host · patched, hardened app · auth data
PLATE 0 — No single wall. Layers, so one failure isn't a disaster.
A picture book for grown-ups · with commands

Cybersecurity: How Defenders Think

Nine spreads on the ideas that matter: what you're protecting, who's attacking, and the layers that keep the damage small.

Say it like a pro

"Assume breach. Reduce the attack surface, verify identity, encrypt, monitor, and rehearse the response."

This book is defensive. For hands-on testing see the Kali book, and only on systems you're authorized to test. Use the tabs or ← → keys.

C I A Confidentialityonly the right people see it · data leak Integritynot tampered with · altered record Availabilitythere when needed · ransomware every control protects at least one of the three
PLATE 1 — Three things you can lose. Name which one an incident hit.
Chapter 1 · Foundations

What you protect, and from whom

Security is risk management. You can't stop everything, so you decide what matters most and spend effort there.

ThreatWhat it looks likeMain defence
Phishingfake email asks for a loginMFA, training, mail filtering
Malware / ransomwarecode encrypts or steals filespatching, EDR, offline backups
Credential stuffingleaked passwords replayedunique passwords, MFA, rate limits
Insiderstaff misuse accessleast privilege, logging
DoSflood knocks service overCDN, rate limiting, capacity
Supply chainbad dependency or vendorpin, scan, vet vendors
vulnerability
a weakness
threat
someone or something that could exploit it
risk
likelihood × impact
Say it like a pro

"Which of confidentiality, integrity, or availability is at stake, and what's the business impact?"

Symmetric · one shared key (AES) plaintext key K ciphertext key K plaintext Asymmetric · key pair (RSA, ECC) anyone locks with your PUBLIC key only your PRIVATE key unlocks also signs: private signs, public verifies pub Hash · one-way fingerprint (SHA-256) any size in → fixed size out · tiny change → totally different integrity checks, passwords (with salt), signatures
PLATE 2 — Encrypt to hide, sign to prove, hash to fingerprint.
Chapter 2 · Cryptography

Locks, signatures, and fingerprints

HTTPS combines them: asymmetric crypto proves the server's identity and agrees a key, then fast symmetric crypto protects the traffic. Never invent your own crypto. Use vetted libraries.

Try it safely on your own files
$ sha256sum report.pdf              # fingerprint
$ openssl rand -base64 32             # strong random key
$ openssl enc -aes-256-cbc -pbkdf2 -in a.txt -out a.enc
$ openssl enc -d -aes-256-cbc -pbkdf2 -in a.enc
$ ssh-keygen -t ed25519               # key pair
$ openssl s_client -connect example.com:443 </dev/null | openssl x509 -noout -dates
at rest
encrypt disks and databases
in transit
TLS 1.2+ everywhere
key mgmt
the hard part: store keys in a vault or KMS, rotate them
Say it like a pro

"TLS in transit, AES at rest, keys in a KMS, and nobody rolls their own crypto."

Knowpassword, PIN Havephone, security key Arefingerprint, face two different kinds = MFA Least privilege: roles, not everything viewer: read editor: read+write admin: everything give the smallest role that gets the job done review access regularly · remove it when people move on admins use a separate account for admin work
PLATE 3 — Prove who you are, then only get what you need.
Chapter 3 · Identity & access

Most breaches start with a stolen login

Authentication proves identity. Authorization decides what that identity may do. Strong MFA blocks the large majority of account takeovers.

  1. MFA everywhere, with phishing-resistant keys (FIDO2/passkeys) for admins.
  2. Long passphrases plus a password manager. Don't force constant rotation.
  3. Single sign-on so access can be granted and revoked in one place.
  4. Audit who has admin, and remove stale accounts.
Linux hygiene
$ lastlog | head ; last -n 10     # recent logins
$ sudo awk -F: '$2==""{print $1}' /etc/shadow   # empty passwords?
$ grep -E '^(sudo|wheel)' /etc/group          # who's admin
zero trust
never trust by network location; verify every request
RBAC
role-based access control
Say it like a pro

"Phishing-resistant MFA, SSO, least-privilege roles, and a quarterly access review."

Internet FW DMZ: public-facing web Internal LAN: staff Data zone: only the app server may connect database default deny between zones · allow only what's needed
PLATE 4 — If one zone falls, the attacker still faces more doors.
Chapter 4 · Network defence

Segment, filter, and close what you don't use

Every open port is attack surface. Firewalls default to deny. Segmentation keeps a compromised laptop from reaching the database.

See your own exposure
$ sudo ss -tulpn                 # what's listening
$ sudo ufw default deny incoming
$ sudo ufw allow 22/tcp ; sudo ufw allow 443/tcp
$ sudo ufw enable ; sudo ufw status verbose
$ nmap -sV 192.168.1.0/24          # only on your own network
IDS/IPS
sensors that flag (or block) suspicious traffic
VPN
encrypted tunnel into the network
WAF
firewall for web traffic that filters common attacks
DNS filtering
blocks known-bad domains
Say it like a pro

"Default deny, segmented zones, and nothing on the internet that doesn't need to be."

✔ Patch quickly ✔ Remove unused ✔ Secure config ✔ Least privilege ✔ Disk encryption ✔ EDR / antivirus The 3-2-1 backup rule 3 copies · 2 different media · 1 offline or off-site an untested backup is a hope, not a backup offline copies are what beat ransomware
PLATE 5 — Most attacks use old, known holes. Close them first.
Chapter 5 · Hardening & endpoints

Make every machine a harder target

Linux server basics
$ sudo apt update && sudo apt upgrade -y
$ sudo apt install unattended-upgrades fail2ban
$ sudo systemctl disable --now cups      # stop unused services
$ sudoedit /etc/ssh/sshd_config
   PermitRootLogin no
   PasswordAuthentication no            # keys only
$ sudo systemctl reload ssh
$ lsblk -f                             # is the disk encrypted (crypto_LUKS)?
CIS benchmarks
published hardening checklists per OS
EDR
endpoint detection and response: watches behaviour, not just files
patch SLA
e.g. critical fixes within days, not months
Say it like a pro

"Patched, minimal, key-only SSH, encrypted disk, EDR, and a restore we've actually tested."

user inputuntrusted validatetype · length · allowlist query ✘ "SELECT * FROM users WHERE id=" + input ✔ query("SELECT * FROM users WHERE id=$1", [input]) OWASP Top 10, in plain words access control · crypto failures · injection · insecure design misconfiguration · outdated parts · auth failures integrity failures · no logging · SSRF the root cause is nearly always "trusted the input"
PLATE 6 — Treat everything from outside as hostile until checked.
Chapter 6 · Application security

Build it so the common attacks fail

  1. Validate input on the server, with allowlists.
  2. Parameterize queries so input stays data, never code.
  3. Encode output so user text can't run as script (XSS).
  4. Check authorization on every request, not just in the UI.
  5. Keep secrets out of code: env vars or a vault.
  6. Patch dependencies and scan them.
Cheap checks for your own project
$ npm audit                     # known-vulnerable dependencies
$ pip-audit ; trivy fs .          # Python deps / files / images
$ gitleaks detect                # secrets committed to git?
$ curl -sI https://yoursite.com | grep -i -E 'strict|content-security|x-frame'
SAST / DAST
scan source code / probe the running app
shift left
catch it in design and CI, where it's cheap
Say it like a pro

"Input validated, queries parameterized, output encoded, and dependency scans gate the build."

servers firewall apps identity SIEMcollect · correlate Alertanalyst e.g. 40 failed logins → then one success → from a new country each line is boring alone; together they're an account takeover
PLATE 7 — You can't defend what you can't see.
Chapter 7 · Detection & monitoring

Logs tell the story, if you collect them

Prevention fails sometimes. Detection shortens the time an attacker stays unnoticed (dwell time). Centralize logs, keep them tamper-resistant, and write alerts for things that really matter.

Reading logs on Linux
$ sudo grep "Failed password" /var/log/auth.log | tail
$ sudo grep "Failed password" /var/log/auth.log \
    | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn | head
$ journalctl -u ssh --since "1 hour ago"
$ sudo fail2ban-client status sshd
IOC
indicator of compromise: a bad IP, hash, or domain
MITRE ATT&CK
shared catalogue of attacker tactics to map detections to
false positive
noisy alerts get ignored. Tune them.
Say it like a pro

"Central logging, correlation rules mapped to ATT&CK, and tuned alerts someone actually reads."

1 Prepare 2 Detect 3 Contain 4 Eradicate 5 Recover 6 Learn First hour isolate the machine (don't power off: you'd lose memory evidence) preserve logs · reset exposed credentials · note times tell the incident lead, then legal and comms per the plan the plan is written before the bad day, not during
PLATE 8 — Calm is a plan someone practiced.
Chapter 8 · Incident response

When it happens, follow the playbook

  1. Prepare: contacts, roles, tested backups, tooling, tabletop exercises.
  2. Detect and triage: is it real, how bad, what's affected?
  3. Contain: isolate hosts, disable compromised accounts, block IOCs.
  4. Eradicate: remove the cause and persistence, patch the hole.
  5. Recover: restore from known-good, watch closely.
  6. Learn: blameless review; fix the process and the detection gap.
Preserve evidence
$ sudo journalctl --since "yesterday" > /evidence/journal.txt
$ sha256sum /evidence/* > /evidence/SHA256SUMS   # prove it wasn't altered
$ sudo ip link set eth0 down                  # isolate, if it's safe to
Say it like a pro

"Contain first, preserve evidence, communicate on schedule, and run a blameless post-mortem."

impact ↑ likelihood → fix now accept plan phishing Responses reducetransferavoidaccept People are the other half short, regular training · an easy "report phish" button · no blame
PLATE 9 — Spend your effort where likelihood and impact are both high.
Chapter 9 · Risk, compliance & people

Decide what matters, and make secure the easy path

Rate each risk by likelihood and impact, then choose: reduce it with controls, transfer it (insurance), avoid it, or knowingly accept it.

NIST CSF
Identify · Protect · Detect · Respond · Recover
ISO 27001
an information-security management standard
SOC 2 / PCI DSS
audit frameworks customers may require
GDPR
privacy law: minimize data, report breaches fast
CIS Controls
practical prioritized to-do list
  1. Know your assets and where sensitive data lives.
  2. Turn on MFA, patch, and back up (offline copy).
  3. Log centrally and write an incident plan.
  4. Train people, and make reporting mistakes safe.

Paths in: CompTIA Security+, then Blue Team Level 1, CySA+, or SC-200. Practice defence on free labs like Blue Team Labs Online and CyberDefenders.

Say it like a pro

"We rank by risk, cover the CIS basics first, and treat training and reporting as controls too."