Guide
Defense in Depth
Why defense cannot stop at the edge, the layers to build, and twenty things you can do this month.
Why the edge is not enough
Defense in depth means no single control is the only thing between an attacker and what matters. Each layer assumes the one in front of it has already failed.
That assumption used to be cautious. It is now just accurate. AI-assisted vulnerability research has sharply accelerated how fast flaws are found and turned into working exploits. Published estimates differ in method and in the exact numbers, but they agree on direction: the gap between a flaw becoming known and being used in attacks has fallen from months, to weeks, to less than a day. Microsoft's 2026 Digital Defense Report puts the median time from discovery in the wild to weaponization at well under 24 hours. Synack's 2026 vulnerability report describes the same gap as hours.
A strategy built on the edge assumes you can patch before the attacker arrives. When exploits appear within hours of disclosure, and sometimes before a fix exists, you will lose that race some of the time. What decides the outcome then is everything behind the edge: whether the attacker can move, whether they can escalate, whether anyone notices, and whether you can recover.
The layers
1. People and policy
Training, procedures, least-privilege decisions and the habits that decide whether controls get used.
2. Edge and perimeter
Firewalls, VPN gateways, email and web filtering, and anything reachable from the internet.
3. Network
Segmentation, internal firewalls and control of east-west traffic.
4. Identity and access
Authentication, MFA, privileged access and service accounts.
5. Endpoint and host
Patching, hardening, endpoint protection and configuration baselines on servers and workstations.
6. Application
Secure defaults, dependency management, input handling and secrets management.
7. Data
Encryption, access controls on the data itself, classification and retention.
8. Detect
Logging, monitoring and alerting across every layer.
9. Respond and recover
Incident response, backups and tested restores.
Top 20 low-hanging fruit
Ordered roughly by value for effort. None needs new budget beyond a password manager. Test changes on one system before rolling them out, and adapt commands to your environment.
Turn on MFA for every admin and remote-access account
The single highest-value control against stolen and guessed passwords.
Step by step
- List every account with admin rights and every way into the network from outside: VPN, remote desktop gateways, cloud consoles, email.
- Enforce MFA in the identity provider with a policy, not per-user opt-in. In Microsoft Entra this is a Conditional Access policy; in Google Workspace it is 2-Step Verification enforcement.
- Prefer passkeys, security keys or authenticator apps with number matching. Avoid SMS where you can.
- Find and fix the exceptions: service accounts, break-glass accounts and legacy protocols that bypass MFA.
Enable automatic security updates on servers
Removes the human delay for the bulk of patches.
Step by step
- Debian and Ubuntu.
sudo apt install -y unattended-upgrades sudo dpkg-reconfigure -plow unattended-upgrades - RHEL, Rocky, Alma and Fedora. Then set apply_updates = yes in /etc/dnf/automatic.conf.
sudo dnf install -y dnf-automatic sudo systemctl enable --now dnf-automatic.timer - Confirm the timer is scheduled.
systemctl list-timers | grep -Ei 'apt|dnf'
Patch what is being exploited first
You cannot patch everything in hours. You can patch the short list attackers are using now.
Step by step
- Pull recent additions from the CISA Known Exploited Vulnerabilities feed. Replace the date.
curl -s https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json \ | jq -r '.vulnerabilities[] | select(.dateAdded >= "<YYYY-MM-DD>") | [.cveID, .vendorProject, .product] | @tsv' - Compare the products against your inventory and put anything that matches at the top of the patch queue.
- Write the rule down: known-exploited flaws on internet-facing systems are fixed or mitigated within a set number of hours, and someone owns checking the feed.
Find out what you expose to the internet
You cannot defend or patch an exposure you do not know about.
Step by step
- From outside your network, scan only address ranges you own or are authorized to test.
nmap -Pn -sV --top-ports 1000 <your-public-ip-range> - For every open port, record the owner and the reason. Close anything without both.
- Move admin interfaces (RDP, SSH, device management pages) behind a VPN or an identity-aware proxy.
- Repeat monthly and compare against the last result.
Harden SSH: keys only, no root login
Ends password guessing against SSH outright.
Step by step
- Confirm you can log in with a key and use sudo before changing anything.
- Set these in /etc/ssh/sshd_config, or a file under /etc/ssh/sshd_config.d/.
PasswordAuthentication no KbdInteractiveAuthentication no PermitRootLogin no - Validate and reload. Keep your current session open and test a new login in a second window. The service is named ssh on Debian and Ubuntu.
sudo sshd -t && sudo systemctl reload sshd
Set host firewalls to deny inbound by default
Each host should accept only the connections it needs, even from inside.
Step by step
- Linux with ufw. Allow your admin network first so you do not lock yourself out.
sudo ufw default deny incoming sudo ufw default allow outgoing sudo ufw allow from <admin-network-cidr> to any port 22 proto tcp sudo ufw enable sudo ufw status verbose - Windows, in an elevated PowerShell session.
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled True -DefaultInboundAction Block Get-NetFirewallProfile | Select-Object Name, Enabled, DefaultInboundAction
Block workstation-to-workstation SMB and RDP
Workstations rarely need to talk to each other. Ransomware and intruders rely on it.
Step by step
- Confirm that file shares and remote support run through servers or a management network, not peer to peer.
- Deploy inbound block rules to workstations by Group Policy or Intune. To test on one machine first:
New-NetFirewallRule -DisplayName "Block inbound SMB" -Direction Inbound -Protocol TCP -LocalPort 445 -Action Block New-NetFirewallRule -DisplayName "Block inbound RDP" -Direction Inbound -Protocol TCP -LocalPort 3389 -Action Block - If the help desk needs RDP, add an allow rule scoped to the help desk subnet instead of skipping the block.
Disable SMBv1
An obsolete protocol with a history of wormable flaws.
Step by step
- Check the current state.
Get-SmbServerConfiguration | Select-Object EnableSMB1Protocol - Disable it. If a legacy device still needs it, isolate that device instead of leaving it on everywhere.
Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force
Remove local admin rights from daily-use accounts
Limits what malware and a phished user can do on the machine.
Step by step
- See who is a local administrator.
Get-LocalGroupMember -Group Administrators - Remove ordinary user accounts. Give people who need elevation a separate admin account.
- Use Windows LAPS so each machine has a unique, rotated local administrator password.
Review privileged groups and disable stale accounts
Old accounts and forgotten group memberships are free access for an intruder.
Step by step
- List who is in the most powerful groups.
Get-ADGroupMember "Domain Admins" -Recursive | Select-Object Name, SamAccountName - Find enabled user accounts with no logon in 90 days.
Search-ADAccount -AccountInactive -TimeSpan 90.00:00:00 -UsersOnly | Where-Object Enabled | Select-Object Name, LastLogonDate - Disable first, delete later. Put a recurring review on the calendar with a named owner.
Roll out a password manager and end password reuse
Reused passwords turn someone else's breach into yours.
Step by step
- Pick one manager for the organization and pay for it, so people do not improvise.
- Start with admins and anyone handling money. Move shared credentials out of spreadsheets and chat into shared vaults.
- Turn on the manager's breach and reuse reports and work the list down.
Use protective DNS
Blocks many connections to known-malicious domains before they start.
Step by step
- Point your DNS forwarders or DHCP scope at a filtering resolver.
Quad9: 9.9.9.9 and 149.112.112.112 Cloudflare (malware) 1.1.1.2 and 1.0.0.2 - Block outbound DNS (port 53) from clients to anything except your own resolvers, so the filter cannot be bypassed by accident.
- Keep resolver logs. They are one of the cheapest detection sources you have.
Publish SPF, DKIM and DMARC
Makes it much harder to spoof your domain in phishing.
Step by step
- Check what you publish today.
dig +short TXT <your-domain> dig +short TXT _dmarc.<your-domain> - Publish SPF listing only your real senders, and enable DKIM signing in your mail provider.
<your-domain>. TXT "v=spf1 include:<your-mail-provider> -all" - Start DMARC in monitoring mode, read the reports, then move to quarantine and reject.
_dmarc.<your-domain>. TXT "v=DMARC1; p=none; rua=mailto:<reports-address>" - Domains that send no mail should publish v=spf1 -all and a DMARC policy of reject.
Block Office macros from the internet
Closes a long-standing malware delivery route.
Step by step
- In Group Policy or Intune, enable "Block macros from running in Office files from the Internet" for Word, Excel and PowerPoint.
- For teams that need macros, use Trusted Locations or signed macros instead of a blanket exception.
Verify endpoint protection is on everywhere
Coverage gaps are where intrusions start. Most environments have some.
Step by step
- Check Microsoft Defender status on a machine.
Get-MpComputerStatus | Select-Object AMServiceEnabled, RealTimeProtectionEnabled, IsTamperProtected, AntivirusSignatureLastUpdated - Compare the device count in your endpoint console with your asset inventory and chase the difference.
- Turn on tamper protection so an intruder cannot simply switch it off.
Turn on full-disk encryption
A lost or stolen laptop becomes a hardware loss, not a breach.
Step by step
- Check status.
# Windows manage-bde -status # macOS fdesetup status # Linux (look for crypto_LUKS) lsblk -f - Enable BitLocker or FileVault through device management so recovery keys are escrowed centrally.
Keep one backup copy offline and test a restore
Intruders go after backups first. An untested backup is a hope.
Step by step
- Follow 3-2-1: three copies, two kinds of storage, one offline or immutable.
- Use separate credentials for the backup system, not domain accounts, and require MFA for deletion.
- Restore one real system to an isolated network each quarter, time it, and write the time down.
Send logs to a central place and keep them
Local logs die with the host, and intruders clear them.
Step by step
- Forward Linux logs with rsyslog. Create /etc/rsyslog.d/90-forward.conf with this line (@@ means TCP).
*.* @@<log-server>:514 - Restart the service.
sudo systemctl restart rsyslog - Prioritize authentication, DNS, firewall, VPN and endpoint logs. Keep at least 90 days.
Enable PowerShell script block logging
Records what scripts actually ran, including obfuscated ones.
Step by step
- Set by Group Policy (Administrative Templates > Windows Components > Windows PowerShell), or directly:
New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging' -Force Set-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging' -Name EnableScriptBlockLogging -Value 1 - Events appear as ID 4104 in the Microsoft-Windows-PowerShell/Operational log. Forward that log centrally.
Write a one-page incident plan and rehearse it
The first hour goes better when nobody is deciding who is in charge.
Step by step
- One page: who declares an incident, who leads, who can authorize taking systems offline, and how to reach them out of band if email is down.
- Add outside contacts: legal, cyber insurer, incident response firm, law enforcement.
- Print it. Then run a 60-minute tabletop on a realistic scenario, such as an edge device exploited overnight, and fix what it exposes.