Pcornel
Networking · Security

Device Hardening

Cheat sheet · https://pcornel.dk/topic.php?topic=744

Back to the Topic

Answer

Device hardening reduces a network device's attack surface: secure management protocols only, restricted management access, strong local credentials, disabled unused services and ports, logging and time sync.

Remember

Core list: SSH v2 only (transport input ssh), VTY ACL, service password-encryption plus enable secret, no ip http server (or HTTPS with ACL), no cdp enable on edge ports, unused ports shut and in an unused VLAN, NTP, syslog, login banners, login block-for.

First checks

  • show running-config | section line vty — transport input and access-class.
  • show ip ssh — SSH version and enabled.
  • show ip http server status — HTTP/HTTPS server state.
  • show control-plane host open-ports — services listening on the device.
  • show interfaces status | include disabled|notconnect — unused ports.
  • show ntp associations and show logging — time and logs.

Commands

enable secret <secret>
Set the privileged EXEC password using a hashed secret.
username <user> privilege <level> secret <secret>
Create a local user with a privilege level and a hashed secret.
service password-encryption
Obfuscate plain-text passwords in the configuration (weak type 7, not real encryption).
security passwords min-length <length>
Require a minimum password length for new passwords.
login block-for <seconds> attempts <count> within <seconds>
Block logins for a period after repeated failed attempts.
banner motd <delimiter>
Set the message-of-the-day banner shown before login.
exec-timeout <minutes> <seconds>
Disconnect idle line sessions after the given time.
show ip ssh
Local state

Verify in this order

unneeded services off → management only over SSH/HTTPS → management restricted by ACL → strong credentials and AAA → unused ports shut → logging and NTP in place

Where it usually breaks

physical/link dependency → local object state → peer/control state → policy → forwarding/adjacency → end-to-end result

Device Hardening · technical reference

LayerReference intent
ServicesDisable or constrain what is not required
IdentityStrong AAA + recovery
Management pathEncrypted and source-restricted
EvidenceRuntime exposure + logs, not config text alone

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=744

Confirmation

Confirm action

Continue?