Network Security In progress
Intermediate 17 min read Network Security
Network Hardening
A repeatable checklist approach to making every device on the wire harder to break into: base configs, service minimization, RBAC on admin, and change control.
hardeningbaselinesSNMPSSHconfig managementleast privilegeCIS
Introduction
What is this?
Network hardening is the systematic reduction of attack surface on routers, switches, firewalls, and baselines: patch, purge, restrict, and prove it.
Motivation
Why do you need it?
- A single unpatched management interface or default SNMP community undoes months of perimeter design.
- Hardening baselines are auditable evidence; auditors want copies of the exact config, not a promise.
- Repeatable baselines (via ansible/puppet/infrastructure-as-code) stop configuration rot compounding silently.
Think about it
Mental model
Imagine
Old house plumbing
Think of
A new-build with certified, maintenance-scheduled fixtures
You cannot just paint the boiler room; you must also replace the rusted valves on a schedule.
Mechanics
How it works
- Service minimization: disable telnet, HTTP/S on the mgmt plane, TFTP, and unneeded daemons before first boot.
- Access restriction: management reach limited to dedicated jump hosts/NACLs; SSH with keys, no password auth.
- Authentication + RBAC: per-user accounts with roles, MFA on admin plane, and centralized logs as the true state of the device.
- Change control and baselines: configs stored in VCS/Ansible, drift-checked nightly, patched within an agreed SLA.
Management plane hardening flow
Inventorydiscover every reachable IP
Minimizekill unused services/ports
Restrictmanagement via jump host + ACL
AccountRBAC roles, MFA, no default creds
Verifyre-scan to prove delta
Real world
In production
- A data center runs Ansible to push a CIS network baseline to all switches weekly, failing any drift in CI.
- An org gates admin access on their network gear through a secret-managed bastion and short-lived SSH certificates.
- A healthcare system maintains a golden image for all APs including default-deny ACLs and disabled management probes.
Guidelines
Best practices
- Start from 'deny now, document exceptions' rather than the vendor's 'all-open by default' config.
- Restrict management to point-to-point links/bastion with ACLs; never manage switches from the office Wi-Fi.
- Enforce SSH keys + MFA on admin planes; disable password-based SSH and default/blank SNMP communities.
- Version-control configs, enforce drift checks, and patch on a scheduled SLA with a rollback path.
Watch out
Common mistakes
- Hardening the perimeter firewall but leaving the old access switch and its default telnet fully open.
- Enabling SNMP 'for monitoring' with community public, which announces your entire network to an attacker.
- Using one shared admin account across all devices so revocation = reconfiguring the world.
- Hardening once, then letting a single 'temporary' change rot for two years — hardening that decays isn't hardening.
When things break
Debugging tips
- When an admin box suddenly loses connectivity, check ACL order — a log-any-any placed before your allow breaks everything.
- Use the config-diff from your Ansible run to spot drift before it becomes an outage.
- After service minimization, run a quick internal scan of your own mgmt plane to confirm the tightening stuck.
Security
Security considerations
- Only harden and scan infrastructure you own; red-team style testing of others' devices is off-limits without written scope.
- Keep an audit trail: every config change, justification, and approver recorded.
- Do not hide 'temporary' red rules; each must carry an owner and an expiry.
Interviews
Interview checkpoint
Practice
Hands-on lab
Harden a Lab VM by Policy then Prove It with a Re-Scan
40 min · intermediate
Objectives
- Write a small hardening policy for an SSH-only lab box.
- Disable password auth, enforce keys, and drop management interfaces to loopback.
- Re-scan the box to prove the before/after delta.
Harden a Lab VM by Policy then Prove It with a Re-Scan
40 min · intermediate
0/4 steps
0%
sandbox · Linux sandbox
$
Try these commands
Test yourself
Quick quiz
0/2
1
Which of these is the MOST dangerous default on networking gear?
2
The hardening cycle should end with...
Go deeper