Prevention and Hardening
Backups, segmentation and least privilege.
Prevention and Hardening is a free Cyber Security Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Cyber Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Defense in Depth
No single control stops ransomware. Prevention layers independent barriers so that bypassing one still leaves others standing. The goal is to make intrusion harder, spread slower, and recovery guaranteed.
This lesson covers the highest-impact controls: backups, segmentation, least privilege, MFA, patching, and attack-surface reduction.
The 3-2-1-1-0 Backup Rule
Backups are the ultimate insurance against encryption. A robust strategy follows 3-2-1-1-0:
- 3 copies of data
- 2 different media types
- 1 copy offsite
- 1 copy offline or immutable
- 0 errors verified by regular restore tests
The immutable and offline copy is what survives an attacker with domain admin who hunts your backups.
Immutable and Air-Gapped Backups
Immutable backups cannot be modified or deleted for a set retention period, even by an administrator. Air-gapped copies are physically or logically disconnected so malware cannot reach them.
# example: S3 Object Lock in compliance mode (cannot delete during retention)
aws s3api put-object-lock-configuration --bucket backups \
--object-lock-configuration 'ObjectLockEnabled=Enabled,Rule={DefaultRetention={Mode=COMPLIANCE,Days=30}}'
# verify restores actually work, not just that backups existNetwork Segmentation
A flat network lets ransomware spread from one infected host to everything. Segmentation divides the network into zones with controlled traffic between them, containing the blast radius.
- Separate user, server, backup, and management networks
- Block workstation-to-workstation traffic, a common lateral path
- Isolate backup infrastructure behind its own controls
Even better, apply microsegmentation so each workload only talks to what it must.
Least Privilege
Ransomware spreads with the privileges of whatever it compromises. Limiting those privileges limits the damage.
- Users should not be local admins on their machines
- Use separate, dedicated accounts for administrative tasks
- Avoid reusing the same local admin password across machines
- Grant access just in time and remove it when done
A compromised standard user account cannot encrypt the whole estate.
Multi-Factor Authentication
Stolen passwords drive a large share of intrusions. MFA blocks attackers who have a valid password but not the second factor.
- Enforce MFA on all remote access: VPN, RDP, webmail, admin portals
- Prefer phishing-resistant methods (FIDO2 hardware keys) over SMS
- Protect against MFA fatigue by requiring number matching
MFA on internet-facing access is one of the single most effective ransomware preventions.
Patch and Reduce Attack Surface
Unpatched internet-facing systems are repeatedly exploited for initial access. Prioritize and shrink exposure.
- Patch internet-facing and actively exploited vulnerabilities first
- Remove or restrict exposed RDP and SMB from the internet
- Decommission unused services and legacy protocols
- Track known-exploited vulnerability lists for prioritization
# never expose RDP directly; require VPN + MFA, or a bastion
# audit what is listening and reachable
ss -tlnp
nmap -sS your.external.ip # only against assets you own/are authorized to testEmail and Endpoint Defenses
Phishing is the top delivery method, so harden the inbox and the endpoint together.
- Email filtering, link rewriting, and attachment sandboxing
- SPF, DKIM, DMARC to reduce spoofing
- Block risky macro and script execution from email and the internet
- Deploy EDR to detect malicious behavior on endpoints
Combine technical controls with user awareness training on reporting suspicious messages.
Application Control and Hardening
Allowlisting what may execute stops most unknown payloads. Pair it with disabling abused features.
- Application allowlisting so only approved binaries run
- Disable Office macros from untrusted sources by default
- Restrict scripting hosts and built-in admin tools where feasible
- Enable OS exploit-mitigation and tamper protection on security tools
Tamper protection matters because operators try to disable EDR before encrypting.
Credential Protection
Lateral movement runs on harvested credentials. Make them harder to steal and reuse.
- Protect against credential dumping from memory
- Use unique local admin passwords per host (managed rotation)
- Limit where privileged accounts can log in (no domain admin on workstations)
- Monitor for unusual authentication patterns
Constraining credential reuse breaks the chain between one compromised host and the whole domain.
Prevention Program, Not a Checklist
Controls decay without upkeep. Treat prevention as an ongoing program:
- Regularly test restores, not just backup completion
- Run tabletop exercises so the team knows the plan
- Continuously inventory exposed services and privileged accounts
- Measure MFA coverage, patch latency, and segmentation gaps
A tested program turns a potential catastrophe into a manageable incident.
Quick Check: Surviving Encryption
Choose the control that guarantees recovery.
Recap: Prevention and Hardening
You built layered defenses against ransomware.
- 3-2-1-1-0 backups with at least one immutable or air-gapped copy and tested restores
- Segmentation to contain spread; least privilege to limit damage
- MFA on all remote access; patch internet-facing and exploited bugs first
- Email, EDR, application allowlisting, and credential protection
- Run it as a program with restore tests and tabletop exercises
Next: detecting an attack already in progress.
Frequently asked questions
Is the “Prevention and Hardening” lesson free?
Yes — the full text of “Prevention and Hardening” is free to read here on the web, and the Cyber Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Cyber Security Academy course, upgrade to CoddyKit PRO.
What will I learn in “Prevention and Hardening”?
Backups, segmentation and least privilege. You practise Cyber Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Cyber Security Academy?
No prior experience is required. Cyber Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Prevention and Hardening” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Cyber Security Academy lesson?
Yes. Every Cyber Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- How Ransomware Works
- Prevention and Hardening
- Detection and Early Indicators
- Incident Response and Recovery