Security fundamentals

The security basics every design rests on

Every secure network I design uses the same building blocks: identity, encryption, certificates, TLS (Transport Layer Security) and IPsec (Internet Protocol security) tunnels, and well guarded switch ports. This page shows how each one works, with diagrams you can step through.

  • Identity and access
  • Encryption
  • Certificates
  • TLS 1.3
  • IPsec
  • Layer 2 security
  • Logging
  • Incident response
An encrypted session that an eavesdropper cannot read A laptop and a server exchange data inside an encrypted TLS tunnel after the laptop has checked the server's certificate. An eavesdropper copies the traffic but sees only ciphertext. TLS 1.3 TUNNEL Laptopclient Servercertificate Eavesdroppersees ciphertext Certificatechain checked private, unchanged and available
Live view · the eavesdropper copies the traffic but cannot read it
Overview

Three goals, many controls

Every security control I design protects at least one of three things: confidentiality, integrity and availability, often called the CIA triad. Switch between them to see what each one guards against.

Confidentiality, integrity and availability A sender talks to a receiver. For confidentiality, an eavesdropper copies the link but sees only ciphertext. For integrity, an attacker changes a packet on the way and the receiver's keyed hash check rejects it. For availability, a botnet floods the service but a scrubbing service drops the flood while real traffic still arrives. Sender10.1.1.20 Receiverweb server 7f 3a c9 e2 9b 41 · ciphertext Eavesdroppercopies the link Confidentiality: only the receiver can read it Attackerchanges one byte Keyed hash fails: rejected Integrity: any change is detected and rejected Botnetflood traffic Scrubbing servicedrops the flood second link and second server Availability: the service stays up under attack

Swipe sideways to see the whole diagram.

Confidentiality. Only the people meant to read data can read it. Encryption in transit (TLS, IPsec, and MACsec, the IEEE (Institute of Electrical and Electronics Engineers) 802.1AE link encryption) and at rest, plus access control, keep it that way. Anyone who copies the link sees only ciphertext.

Integrity. Data arrives exactly as it was sent. A keyed hash (HMAC, a hash based message authentication code) or a digital signature travels with the data, so any change, accidental or deliberate, makes the check fail and the receiver rejects it.

Availability. The service is there when people need it. Redundant links and devices, spare capacity, DDoS (distributed denial of service) protection and tested backups keep it running when something fails or is attacked.

Animation

Least privilege

Every person, device and service gets only the access its job needs, for only as long as it needs it. Admin rights are separate accounts, used through a jump host and logged.

Defence in depth

No single control stops everything, so I layer them: the edge, segmentation, identity, hardened workloads and monitoring. Each layer catches what got past the one before.

Zero trust

Being on the network earns no trust. Every request is checked against identity, device health and policy. I show how I build it on the security page.

AAA

Who you are, what you may do, and what you did

AAA stands for authentication, authorisation and accounting. On every network device I build, logins go to a central server rather than local passwords, so access can be granted, limited, audited and removed in one place. Follow an engineer logging in to a switch over SSH (Secure Shell), checked by a TACACS+ (Terminal Access Controller Access Control System Plus) server on TCP (Transmission Control Protocol) port 49, here Cisco ISE (Identity Services Engine).

An engineer logging in to a switch through TACACS+ An engineer opens an SSH session to a switch. The switch asks a TACACS+ server, which checks the directory, to authenticate the engineer. Each command is then authorised by the server, and every command is recorded for accounting. If the servers cannot be reached, a local break glass account is used and an alarm is raised. EngineerSSH client SwitchAAA client TACACS+ serverTCP 49 · Cisco ISE DirectoryActive Directory SSH version 2 login with a named account Authentication: who are you? Authorisation: may you run this command? Accounting: every command is recorded Servers unreachable: local break glass account ssh jo@sw1 configure terminal password and group OK command allowed jo · 10:42 · conf t local login, alarm raised

Swipe sideways to see the whole diagram.

Step 1
  1. The engineer opens an SSH (Secure Shell) version 2 session to the switch with their own named account. Shared logins such as "admin" hide who made a change, so I never use them day to day.

  2. The switch passes the login to a TACACS+ (Terminal Access Controller Access Control System Plus) server, here Cisco ISE (Identity Services Engine), which checks the password and group in the directory. Multi factor authentication can sit here too.

  3. TACACS+ can check every command. Read only staff can look but not change. Network engineers can configure but not erase the switch. The policy lives in one place, not on every device.

  4. Every login and every command is recorded with the user and the time. When something changes without a change record, accounting shows who did it and when.

  5. If the servers cannot be reached, the switch falls back to a local break glass account. Its password is sealed and rotated, and using it raises an alarm. I test the fallback before I save any AAA change.

RADIUS and TACACS+ side by side

PointRADIUS (Remote Authentication Dial In User Service)TACACS+
Main useNetwork access: 802.1X on switches and Wi-Fi, VPN (virtual private network) loginsDevice administration: logins to switches, routers and firewalls
TransportUDP (User Datagram Protocol) 1812 for authentication, 1813 for accounting (older kit uses 1645 and 1646)TCP 49
EncryptionOnly the password field is hidden. RadSec (RADIUS over TLS) protects the rest. Since BlastRADIUS (CVE-2024-3596), every server and client should require the Message-Authenticator attribute.The whole body is obfuscated with a shared secret, which is weak; RFC (Request for Comments) 9887 adds TLS 1.3
AAA functionsAuthentication and authorisation travel together in one replyAuthentication, authorisation and accounting are separate, so each command can be checked
StandardOpen standard (RFC 2865 and RFC 2866)Cisco designed, published as RFC 8907
Encryption

Keys, hashes and signatures

Four building blocks sit under almost every secure protocol I deploy. Once these are clear, TLS, IPsec, SSH and 802.1X are just different ways of putting them together. The figure uses AES (Advanced Encryption Standard), RSA (Rivest, Shamir and Adleman), ECIES (Elliptic Curve Integrated Encryption Scheme) and SHA (Secure Hash Algorithm).

Symmetric encryption, asymmetric encryption, hashing and signatures Alice sends to Bob through two processing steps. With symmetric encryption both steps use the same shared key. With asymmetric encryption Alice encrypts with Bob's public key and only Bob's private key decrypts. With hashing both sides compute a digest and compare it. With a signature Alice signs with her private key and Bob verifies with her public key. Alicesender Bobreceiver EncryptAES-256RSA or ECIES HashSHA-256 Signhash, then sign DecryptAES-256RSA or ECIES Hash againcompare digests Verifycheck signature 9c 2e 71 0b ff 4a 9f86 d081 884c 7d65 message + signature shared key Kshared key K Symmetric: one key encrypts and decrypts Fast, so it carries the data, but the key must be shared safely Bob's public keyBob's private key Asymmetric: the public key encrypts, the private key decrypts Slow, so it is used to agree or protect keys, not to carry data digests match Hash: a fixed size fingerprint of the data One changed bit changes the whole digest, and it cannot be reversed Alice's private keyAlice's public key Signature: proves who sent it, and that it is unchanged Certificates, software images and code all rely on it

Swipe sideways to see the whole diagram.

Symmetric encryption. One secret key encrypts and decrypts. AES (Advanced Encryption Standard) with 128 or 256 bit keys, usually in GCM (Galois/Counter Mode), carries almost all data in TLS, IPsec and on disks. The hard part is getting the same key to both ends safely.

Asymmetric encryption. Each side has a key pair. What one key encrypts, only the other can decrypt, so a public key can be shared with anyone. It is far slower, so protocols use it to agree or protect a symmetric key, then switch to AES.

Hashing. A hash turns any data into a fixed length digest. SHA-256 is the usual choice; MD5 (Message Digest 5) and SHA-1 are broken and I remove them. Add a shared key and it becomes an HMAC (hash based message authentication code), which proves the data is unchanged and came from someone holding the key. Passwords need a slow, salted function such as PBKDF2 (password based key derivation function 2), scrypt or Argon2 instead, so guessing is expensive.

Digital signature. Alice hashes the message and signs the hash with her private key. Bob checks it with her public key. A match proves the message came from Alice and was not changed. I verify a software image's hash or signature before every upgrade.

Animation

How two sides agree a secret in public

Diffie-Hellman key exchange lets two devices agree a shared secret over a link anyone can watch, without ever sending the secret. TLS, IPsec and SSH all start this way. The numbers here are tiny so you can check them by hand.

Diffie-Hellman key exchange with small numbers Alice and Bob agree the public values p equals 23 and g equals 5. Alice picks the secret 4 and Bob picks the secret 3. Alice sends 5 to the power 4 mod 23, which is 4. Bob sends 5 to the power 3 mod 23, which is 10. Alice computes 10 to the power 4 mod 23 and Bob computes 4 to the power 3 mod 23. Both get 18, which never crossed the link. An eavesdropper sees 23, 5, 4 and 10 but not the secrets. Alicelaptop Bobserver Public valuesp = 23 · g = 5 secret a = 4 secret b = 3 A = 5⁴ mod 23 = 4 B = 5³ mod 23 = 10 s = 10⁴ mod 23 = 18 s = 4³ mod 23 = 18 Eavesdroppersees 23, 5, 4 and 10 Anyone may see p and g Secrets never leave the device Only the mixes cross the link Both hold 18, never sent Real keys: 2048 bits or elliptic curves 4 10

Swipe sideways to see the whole diagram.

Step 1
  1. Alice and Bob agree two public numbers: a prime p and a generator g. Anyone may see them. Here p is 23 and g is 5, small enough to check by hand. In the paint picture, this is a shared base colour.

  2. Each side picks a secret it never sends. Alice picks 4 and Bob picks 3. In the paint picture, each adds its own secret colour to the base.

  3. Each side sends g to the power of its secret, mod p. Alice sends 5⁴ mod 23, which is 4. Bob sends 5³ mod 23, which is 10. The eavesdropper sees 23, 5, 4 and 10, like seeing mixed paint without knowing the secret colours.

  4. Alice raises Bob's 10 to her secret: 10⁴ mod 23 is 18. Bob raises Alice's 4 to his: 4³ mod 23 is also 18. Both now hold 18, which never crossed the link. It seeds the session keys.

  5. Real exchanges use primes of 2048 bits or more, or elliptic curves such as P-256 (IKE group 19) and X25519. Finding the secret from 4 is the discrete logarithm problem, which is impractical at that size. Newer hybrid exchanges add ML-KEM (module lattice key encapsulation mechanism), a post quantum algorithm.

Try it: work out a shared secret

Pick a prime, one of its generators and two secrets. Each side's working is shown, and both arrive at the same number. Real systems use numbers hundreds of digits long.

Alice sends A = 5⁴ mod 23 = 4. Bob sends B = 5³ mod 23 = 10.

Alice works out 10⁴ mod 23 = 18. Bob works out 4³ mod 23 = 18. Both hold 18.

The building blocks at a glance

Building blockWhat it givesWhat I useWhere I meet it
Symmetric encryptionConfidentiality at high speedAES-128 or AES-256 in GCM, or ChaCha20 with Poly1305TLS and IPsec data, MACsec on links, disk encryption
Asymmetric encryptionKey agreement and encryption to a public keyElliptic curve Diffie-Hellman, RSA 2048 bits or moreTLS and IKE key exchange, certificates
HashA fingerprint that shows any changeSHA-256 or SHA-384. MD5 and SHA-1 are retired.Checking software images before an upgrade
HMACIntegrity plus proof of a shared keyHMAC with SHA-256IPsec, OSPF (Open Shortest Path First) and BGP (Border Gateway Protocol) authentication, API (application programming interface) signing
Digital signatureProof of who sent it, and that it is unchangedECDSA (Elliptic Curve Digital Signature Algorithm), EdDSA (Edwards curve Digital Signature Algorithm), RSACertificates, signed software, code signing
Link encryption

MACsec

MACsec (IEEE 802.1AE) encrypts each Ethernet link hop by hop at line rate with AES in GCM mode. Keys come from MKA (MACsec Key Agreement, defined in the 2010 edition of IEEE 802.1X), using a pre shared CAK (connectivity association key) or keys from 802.1X. Each switch decrypts and encrypts again, so the traffic is clear inside the box.

Certificates and TLS

Proving who is on the other end

Encryption is useless if you are talking to the wrong server. A PKI (public key infrastructure) binds a name to a public key with a certificate that a trusted CA (certificate authority) has signed. Follow one certificate from its CSR (certificate signing request) to revocation through a CRL (certificate revocation list) or OCSP (Online Certificate Status Protocol). The root key lives in an HSM (hardware security module).

A certificate from request to revocation A web server sends a certificate signing request to an intermediate CA, which the offline root CA has signed. The intermediate issues a certificate. The server presents its certificate and the intermediate to a browser. The browser walks the chain up to a root in its trust store and checks the name and dates. Finally the browser checks revocation with a CRL or OCSP, and the server renews before the certificate expires. Root CAoffline, key in HSM Intermediate CAissues certificates Web serverwww.example.co.uk Browsertrust store of roots RevocationCRL or OCSP CSR up, certificate down root signs intermediate CSR: the public key and the name to prove The CA checks the request, then signs it The server sends its certificate and the intermediate Root found in the local trust store: no CA call Revoked early if the key leaks, renewed before expiry

Swipe sideways to see the whole diagram.

Step 1
  1. The server makes a key pair and sends a CSR (certificate signing request) holding its public key and the names it wants to prove. The private key never leaves the server.

  2. The intermediate CA checks the server really controls those names, then signs the certificate. The root CA signed the intermediate and is kept offline, its key in an HSM (hardware security module), so a breach of the intermediate can be recovered from.

  3. During the TLS handshake the server sends its certificate and the intermediate. Forgetting the intermediate is one of the most common reasons a site works in one browser and fails in another.

  4. The browser checks each signature up the chain to a root it already trusts, then the name and the valid from and to dates. Any failure stops the connection with a certificate warning.

  5. If a key leaks, the CA revokes the certificate and publishes it on a CRL (certificate revocation list) or answers OCSP (Online Certificate Status Protocol) queries. Public certificates now last 200 days at most, falling to 47 days by 2029, so I automate renewal.

The TLS handshake, version 1.2 and 1.3

TLS 1.2 and TLS 1.3 handshakes In TLS 1.2 the client sends ClientHello. The server replies with ServerHello, its certificate, its key exchange and ServerHelloDone. The client sends its key exchange, ChangeCipherSpec and Finished, and the server sends ChangeCipherSpec and Finished. Data flows after two round trips. In TLS 1.3 the client sends ClientHello with a key share. The server replies with ServerHello and its key share, then an encrypted certificate, CertificateVerify and Finished. The client sends Finished and data flows after one round trip. Client Server ClientHello: versions, cipher suites, random ServerHello, Certificate, ServerKeyExchange, Done ClientKeyExchange, ChangeCipherSpec, Finished ChangeCipherSpec, Finished Application data, encrypted trip 1trip 2 Two round trips before any data ClientHello + key share ServerHello + key share { EncryptedExtensions, Certificate, CertificateVerify, Finished } { Finished } Application data, encrypted trip 1 One round trip, and the certificate itself is encrypted

Swipe sideways to see the whole diagram.

TLS 1.2. Two round trips pass before any data flows. I only allow key exchange with ECDHE (elliptic curve Diffie-Hellman with temporary keys), so each session gets fresh keys and a stolen server key cannot decrypt old traffic. That property is called forward secrecy. Old RSA key exchange lacks it, so I turn it off.

TLS 1.3. The client sends its key share in the first message, so the handshake takes one round trip and everything after ServerHello is encrypted, even the certificate. Only forward secret key exchange and modern ciphers remain. Encrypted Client Hello can now hide the server name as well. I make it the default and keep TLS 1.2 only where something still needs it.

Animation

Running certificates well

StageWhat I do
InventoryEvery certificate, its owner, where it is installed and when it expires, found by scanning, not by memory. Expired certificates are one of the most common causes of outages.
IssuePublic sites use a public CA. Internal devices, 802.1X and VPNs use an internal CA, with the root offline and its key in an HSM.
RenewAutomated with ACME (Automatic Certificate Management Environment) where possible. Under CA/Browser Forum rules, public certificates last 200 days at most from March 2026, 100 days from March 2027 and 47 days from March 2029.
RevokeRevocation is published on CRLs and, by some CAs, through OCSP. Let's Encrypt switched OCSP off in August 2025 and now uses CRLs only, so I make sure clients can reach the CRL points. Where OCSP is used, the server can staple a fresh response into the handshake. Browsers usually soft fail, carrying on when they cannot get an answer.
Plan aheadPost quantum cryptography is coming. The NCSC (National Cyber Security Centre) asks organisations to finish discovery and planning by 2028, move the most important systems by 2031 and complete migration by 2035, starting with a list of where cryptography is used.
IPsec

How a VPN tunnel comes up

IPsec protects traffic between two sites' LANs (local area networks), or a user and a site, at Layer 3, even through NAT (network address translation). IKE (Internet Key Exchange) agrees the keys and ESP (Encapsulating Security Payload) carries the data in SAs (security associations). Step through an IKEv2 tunnel build. The deeper VPN designs and fault finding are on the wide area network and VPN page.

An IKEv2 site to site tunnel coming up A host in LAN A sends traffic for LAN B. Router A starts IKE with Router B over the internet. IKE_SA_INIT agrees the proposal and swaps Diffie-Hellman key shares. IKE_AUTH proves identities and builds the first child security association. Data then flows in ESP with two one way security associations. When a NAT device sits in the path, ESP is wrapped in UDP 4500. Before the lifetime expires, CREATE_CHILD_SA rekeys. INTERNET NAT devicerewrites ports LAN A10.1.0.0/16 Router A198.51.100.1 Router B203.0.113.1 LAN B10.2.0.0/16 A to B · SPI 0x3cB to A · SPI 0x7e Traffic for LAN B triggers IKE on UDP 500 IKE_SA_INIT: proposal, key shares, nonces IKE_AUTH: identities, first child SA ESP data in two one way SAs NAT found in IKE_SA_INIT: IKE_AUTH and ESP use UDP 4500 CREATE_CHILD_SA rekeys before expiry

Swipe sideways to see the whole diagram.

Step 1
  1. A host in LAN A sends to LAN B. Router A matches the traffic to the tunnel, through a crypto policy on a policy based VPN or a route into a tunnel interface on a route based VPN, and starts IKE on UDP 500.

  2. Two messages agree the IKE proposal (encryption, integrity and Diffie-Hellman group), swap key shares and nonces, and detect any NAT on the path. The routers now share keys that protect the rest of IKE.

  3. Two encrypted messages prove each side's identity with a certificate or a pre shared key, and build the first child SA (security association) for data, with its traffic selectors. That is four messages in all, against nine in IKEv1 main and quick mode.

  4. Data travels in ESP (Encapsulating Security Payload, Internet Protocol number 50). There are two one way SAs, each with its own SPI (security parameter index). One side's encrypt counter should rise with the other side's decrypt counter.

  5. ESP has no ports, so a NAT device cannot track it. When IKE_SA_INIT detects NAT, both sides switch to UDP 4500 from IKE_AUTH onwards and wrap ESP in UDP. A tunnel that works without NAT but fails through it usually means UDP 4500 is blocked.

  6. Before a lifetime runs out, CREATE_CHILD_SA builds fresh SAs. With PFS (perfect forward secrecy) it runs a new Diffie-Hellman exchange, so one stolen key cannot decrypt earlier traffic. Dead peer detection clears SAs for a peer that has gone.

What ESP does to a packet

IPsec packet layouts Transport mode keeps the original IP header and encrypts the TCP header and data. Tunnel mode adds a new IP header and encrypts the whole original packet. With NAT traversal a UDP header on port 4500 sits between the new IP header and ESP. AH authenticates the whole packet including the IP header but encrypts nothing, so it breaks when NAT changes the header. authenticated: ESP header to trailer encrypted IP ESP TCP Data ESP trailer ICV authenticated: ESP header to trailer encrypted: the whole original packet New IP ESP Original IP TCP Data ESP trailer ICV UDP 4500, so NAT can track it encrypted New IP UDP 4500 ESP Original IP TCP Data Trailer ICV authenticated: the whole packet, IP header included nothing encrypted, and NAT breaks the check IP AH TCP Data

Swipe sideways to see the whole diagram.

Transport mode. The original IP header stays, and only the payload is encrypted. The ICV (integrity check value) at the end proves nothing changed. It suits host to host traffic, and GRE (Generic Routing Encapsulation) over IPsec, where GRE already adds the outer header.

Tunnel mode. The whole original packet is encrypted and a new IP header carries it between the gateways. This is the normal mode for site to site VPNs. The extra headers cost bytes, so I check the MTU (maximum transmission unit) and clamp the TCP MSS (maximum segment size).

NAT traversal. A UDP header on port 4500 gives a NAT device something to track. Firewalls between the peers must allow UDP 500, UDP 4500 and, without NAT, ESP itself.

AH (Authentication Header, IP protocol 51). AH checks the whole packet, including the IP header apart from fields that change in transit, such as the TTL (time to live), but encrypts nothing. Any NAT changes the header and breaks the check, so I use ESP, which gives encryption and integrity together.

Animation
PointIKEv1IKEv2
Messages to the first tunnelMain mode 6, plus quick mode 3. Aggressive mode uses 3 but exposes the identity.4: IKE_SA_INIT and IKE_AUTH
NAT traversal and dead peer detectionAdd on extensionsBuilt in, plus MOBIKE (IKEv2 mobility and multihoming) so a remote user keeps the tunnel when their address changes
AuthenticationThe same method both sidesEach side can differ, and EAP (Extensible Authentication Protocol) suits remote users
RekeyingNew quick mode exchangesCREATE_CHILD_SA, cleaner and with fewer drops
ErrorsVagueClear notifications such as NO_PROPOSAL_CHOSEN and TS_UNACCEPTABLE
Algorithms to removeDES (Data Encryption Standard), 3DES, MD5, SHA-1 and Diffie-Hellman groups 1, 2 and 5, still offered by many old peersThe same list. Government networks follow the customer's crypto policy and NCSC (National Cyber Security Centre) guidance
My choiceOnly for an old peer that cannot do betterThe default, with AES-256 GCM, SHA-256 or stronger as the IKE PRF (pseudo random function), and Diffie-Hellman group 19 or 20
Attacks

Know the attack, place the defence

Most attacks I design against are old and well understood. The skill is putting the right control at the right layer. Here is a classic one, ARP (Address Resolution Protocol) spoofing, and the switch feature that stops it. A fake reply on the same VLAN (virtual local area network) ties the gateway's address to the attacker's MAC (media access control) address.

ARP spoofing and dynamic ARP inspection Normally a laptop sends traffic through the access switch to its gateway. In the attack, a device on the same VLAN sends fake ARP replies claiming the gateway's address, so the laptop's traffic flows through the attacker first. With dynamic ARP inspection the switch checks ARP against the DHCP snooping table and drops the fake replies, so traffic goes straight to the gateway again. Laptop10.1.1.20 Gateway10.1.1.1 Attackersame VLAN 10.1.1.1 is the gateway's MAC 10.1.1.1 is the attacker's MAC Normal: ARP maps the gateway to its real MAC Spoofed ARP: traffic now flows through the attacker Dynamic ARP inspection drops ARP that fails the check Access switchVLAN 20

Swipe sideways to see the whole diagram.

Normal. The laptop uses ARP (Address Resolution Protocol) to learn the gateway's MAC address, then sends every off subnet packet there. ARP has no authentication, so it believes any reply.

ARP spoofing. A device on the same VLAN sends unrequested ARP replies saying it owns 10.1.1.1. The laptop updates its table and sends traffic through the attacker, who can read it or change it and pass it on. That is a man in the middle attack.

Dynamic ARP inspection. The switch checks each ARP against the DHCP (Dynamic Host Configuration Protocol) snooping binding table on untrusted ports and drops any that do not match. TLS with proper certificate checks still protects the data if something gets through.

Animation

Common attacks and how I stop them

AttackHow it worksWhat stops it
DDoSA flood fills a link, a server or a firewall's session tableUpstream scrubbing, rate limits, spare capacity and anycast for public services
Man in the middleAn attacker relays traffic between two parties and reads or changes itTLS with certificate checks, dynamic ARP inspection, 802.1X and MACsec
ARP spoofingFake ARP replies point the gateway's address at the attackerDynamic ARP inspection backed by DHCP snooping
DHCP starvation and rogue DHCPThe real pool is exhausted, then a fake server hands out a bad gateway or DNS (Domain Name System) serverDHCP snooping, port security and DHCP rate limits
MAC floodingThousands of fake MACs fill the switch's table, so it floods every frame to every portPort security with a MAC limit per port
VLAN hoppingThe attacker talks a port into trunking, or double tags a frame to reach another VLANFixed access ports, trunk negotiation off, an unused native VLAN
PhishingA message tricks someone into handing over a password or running malwarePhishing resistant MFA (multi factor authentication) such as FIDO2 (Fast Identity Online) keys, mail filtering, training
RansomwareData is stolen and encrypted, then a payment is demandedSegmentation, patching, endpoint detection, immutable backups and tested recovery
SQL (Structured Query Language) injectionCrafted input runs commands in the databaseParameterised queries, input validation and a WAF (web application firewall)
XSS (cross site scripting)Injected script runs in another user's browserOutput encoding, a Content Security Policy and a WAF
Password sprayingA few common passwords are tried against many accountsMFA, banned password lists, smart lockout and alerts on failures spread across many accounts
Layer 2 security

Guarding the access port

Most attacks start from a device plugged into a wall port. A few switch features, built on each other, stop the classic Layer 2 tricks. Step through them on one access switch: DHCP snooping, DAI (dynamic ARP inspection), IPSG (IP source guard) and port security.

DHCP snooping, dynamic ARP inspection, IP source guard and port security A laptop gets an address from the real DHCP server behind the trusted uplink, and DHCP snooping records the lease in a binding table. A rogue DHCP server on an access port is blocked. An attacker's fake ARP reply fails dynamic ARP inspection. A packet with a spoofed source address is dropped by IP source guard. A flood of fake MAC addresses breaks the port security limit and the port shuts down. trusted uplink Laptopport 1 Rogue DHCPport 2 Attackerport 3 Access switchsnooping, DAI, IPSG DHCP serverreal, trusted Binding table 10.1.1.20 · aa:bb:cc:00:00:01 VLAN 20 · port 1 · 8 hour lease ARP: 10.1.1.1 is at me source 10.1.1.20, forged err disabled DHCP snooping learns who holds which address DHCP server replies on an access port are dropped DAI: each ARP must match the binding table IP source guard: only the leased address may send Port security: past the MAC limit, the port shuts

Swipe sideways to see the whole diagram.

Step 1
  1. With DHCP snooping on, the uplink to the real server is trusted and access ports are not. As the laptop gets its lease, the switch records the IP address, MAC address, VLAN and port in a binding table. The next three features all use that table.

  2. A rogue DHCP server, often a home router plugged in by mistake, answers on an untrusted port. The switch drops server replies there, so nobody gets a bad gateway or DNS server.

  3. Dynamic ARP inspection (DAI) checks every ARP on untrusted ports against the binding table. The attacker's claim to own the gateway's address does not match, so it is dropped and logged.

  4. IP source guard (IPSG) builds a filter per port from the table. Port 3 never got 10.1.1.20, so packets it sends with that source address are dropped.

  5. Port security limits each port to a set number of MAC addresses, usually two or three for a phone and a computer. A flood of fake MACs breaks the limit and the port is shut into err disabled state, with an alert.

The access port baseline I build

FeatureWhat it stopsKey setting on Cisco IOS XEHow I roll it out
DHCP snoopingRogue DHCP servers and starvationip dhcp snooping vlan 20 and ip dhcp snooping trust on uplinksFirst, VLAN by VLAN, and wait a full lease period so the table fills. Option 82 is inserted by default; if the server or an upstream switch drops it, use no ip dhcp snooping information option
Dynamic ARP inspectionARP spoofing and man in the middleip arp inspection vlan 20After snooping. Static hosts need an ARP ACL (access control list) or a static binding
IP source guardSpoofed source addressesip verify source on the access portLast, once bindings are stable and saved to flash
Port securityMAC flooding and unknown devicesswitchport port-security maximum 3Violation modes: protect drops silently, restrict drops and logs, shutdown err disables the port. I start with restrict, then shutdown. Sticky MACs stay tied to the old port after a desk move, so I clear them. 802.1X is the stronger control
Storm controlBroadcast storms spreadingstorm-control broadcast level 1.00Baseline real traffic first; trap before shutdown
BPDU (bridge protocol data unit) guardA rogue switch joining spanning treespanning-tree bpduguard enable with PortFastOn every edge port, with err disable recovery decided by policy
Trunk hygieneVLAN hoppingswitchport mode access and switchport nonegotiateUnused native VLAN, never VLAN 1 for users, allowed VLANs pruned
802.1X with MAB (MAC authentication bypass)Anything unknown getting on the networkIdentity based access with MAC authentication bypass (MAB) for devices without a supplicantMonitor mode, then low impact, then closed. Details on the security page
VLAN hopping

Switch spoofing

A port left in a dynamic mode can be talked into trunking with DTP (Dynamic Trunking Protocol), giving the attacker every VLAN. I set every port to access or trunk on purpose and turn negotiation off.

VLAN hopping

Double tagging

A frame with two 802.1Q tags arrives on the native VLAN. The first switch strips the outer tag and the next one reads the inner tag. It only works one way and only from the native VLAN, so an unused, tagged native VLAN stops it.

Isolation

Private VLANs

Hosts in an isolated private VLAN can only reach the promiscuous port, usually the gateway. Hosts in a community can also reach each other. I use them for DMZ (demilitarised zone), backup and management networks where neighbours should never talk.

Management plane

Protecting the device that protects the network

A router or firewall has three planes: data (traffic passing through), control (routing protocols) and management (logins and monitoring). An attacker who owns the management plane owns the device. CoPP (control plane policing) keeps the processor alive under attack, whether the traffic is routing, SNMP (Simple Network Management Protocol), ping over ICMP (Internet Control Message Protocol) or a flood.

Control plane policing Four kinds of traffic aimed at a router's processor reach a control plane policing filter. Routing protocol traffic gets a high rate that floods cannot use up, management traffic from jump hosts is allowed, ping is rate limited, and a flood of attack traffic is dropped, so the processor stays responsive. ROUTER Routing peersOSPF and BGP ManagementSSH and SNMPv3 PingICMP Floodattack traffic Processorstays responsive Routing: a high rate that floods cannot use up Management: only from jump hosts Ping: rate limited · the rest: a tight cap Control planepolicing

Swipe sideways to see the whole diagram.

Control plane policing. Traffic to the device itself is classified and given a rate. Routing protocols always get through, management is allowed only from known sources, ping is limited, and everything else is held to a small cap, so a flood cannot starve the processor and drop routing neighbours.

Animation

My hardening baseline for network devices

ControlWhat I setWhy
LoginsSSH version 2 only, Telnet off: ip ssh version 2, transport input ssh, and an access class allowing jump hosts onlyCredentials never cross the network in clear text
AAATACACS+ for staff, a sealed local break glass account, command accountingNamed people, least privilege and an audit trail
SNMPSNMPv3 at the authPriv level (authentication and encryption) only; versions 1 and 2c offCommunity strings travel in clear text
TimeAt least three NTP (Network Time Protocol) sources with authenticationLogs, certificates and Kerberos all depend on the right time
LoggingSyslog to a central collector with timestamps, plus a local bufferEvidence survives a reload or a compromised device
Routing protocolsOSPF authentication with HMAC SHA key chains, BGP with TCP-AO (TCP Authentication Option) or MD5, GTSM (Generalized TTL Security Mechanism, which checks the IP time to live) and maximum prefix limitsNobody can inject or hijack routes
Source checksuRPF (unicast reverse path forwarding) in strict mode on single homed edges, loose mode where routing is asymmetricSpoofed source addresses are dropped at the edge
Unused servicesHTTP (web) server off, CDP (Cisco Discovery Protocol) and LLDP (Link Layer Discovery Protocol) off on untrusted ports, unused ports shut in a parking VLANLess to attack and less to leak
SoftwareImages checked against the vendor's hash, current supported releases, advisories trackedEdge devices are a favourite target, and old code is the easiest way in

I base each baseline on the vendor's hardening guide and the CIS (Center for Internet Security) Benchmarks, record every exception with a risk owner and a review date, and check devices against it automatically.

Firewall basics

From packet filters to next generation firewalls

A router ACL, a stateful firewall and a next generation firewall all permit and deny traffic, but they see very different amounts. Compare what each one knows about the same conversation. Vendor by vendor detail is on the firewall platforms page.

ACL, stateful firewall and next generation firewall A client opens a connection to a server on the internet. A router ACL checks each packet on its own, so a forged reply that looks like part of a session can pass. A stateful firewall keeps a session table, so real replies match and the forged one is dropped. A next generation firewall also identifies the application and the user and blocks an exploit hidden inside allowed traffic. Client10.1.1.20 Serverinternet Router ACLeach packet alone Stateful firewallsession table Next generationapp, user, threat 10 permit tcp 10.1.1.0 0.0.0.255 any eq 44320 permit tcp any 10.1.1.0 0.0.0.255 established Checks each packet on its own, with no memory 10.1.1.20:50112 to 203.0.113.10:443TCP · established · idle timer 3600 s Remembers each session, so replies need no rule App: web browsing over TLS · User: jo (Finance)Threat: exploit signature matched, session reset Knows the app and the user, and inspects the content

Swipe sideways to see the whole diagram.

Stateless ACL (access control list). Rules are read top down and the first match wins, with an implicit deny at the end. It is fast and done in hardware, so I use ACLs to protect the control and management planes. But each packet is judged alone, and the return rule has to be wide open.

Stateful firewall. The first packet is checked against the policy, then a session is written. Replies match the session, and a packet that does not fit the TCP conversation is dropped. Return traffic through a different firewall has no session, so I keep paths symmetric.

Next generation firewall (NGFW). On top of state it identifies the application whatever the port, maps addresses to users, and runs IPS (intrusion prevention), URL (web address) filtering and malware checks. Throughput drops as features are enabled, especially TLS decryption, so I size for the features I will use.

Animation

Zones group interfaces by trust, and policy is written for each pair of zones. A Cisco router can do the same with the IOS zone based firewall, where traffic between zones is dropped unless a zone pair policy inspects it. Traffic to the router itself sits in the self zone, which stays open until I write a policy for it, so I plan every interface and the self zone first or management access breaks.

NAT types

TypeWhat it doesTypical use
Static NATOne inside address always maps to one outside addressA published server
Dynamic NATInside addresses borrow from a pool, one to onePartner links with address rules
PAT (overload)Many inside addresses share one outside address, told apart by portUsers browsing the internet
Destination NATChanges the destination, often one port onlyPort forwarding to a server
Twice or policy NATTranslates source and destination together, based on bothOverlapping addresses after a merger
Identity NATMatches traffic and leaves it untranslatedKeeping VPN traffic out of the internet PAT rule

VPN types

TypeHow it worksWhere I use it
Site to site IPsecTwo gateways build a tunnel, policy based or route basedBranches, partners, cloud backup paths
Remote access IPsecIKEv2 client on the laptop to a VPN gatewayStaff working away from the office
SSL (Secure Sockets Layer) or TLS VPNTunnel or web portal over HTTPS (secure web)Still common, but some vendors are retiring it. Fortinet removed SSL VPN tunnel mode in FortiOS 7.6.3
ZTNAZero trust network access: a broker connects a checked user to one applicationReplacing full network VPNs for most users
GRE and DMVPN (Dynamic Multipoint VPN)Routable tunnels, protected with IPsec, built on demand between spokesHub and spoke wide area networks, and the home lab backup path
Logging and SIEM

Seeing it happen, in one place

Controls slow an attacker down. Logs let a team see it and respond. Every device I build sends its logs to a central SIEM (security information and event management) platform with the right time, so events from different devices line up. The figure adds EDR (endpoint detection and response) on servers and a SOC (security operations centre) analyst.

Logs flowing into a SIEM Firewalls, switches and routers, servers, identity systems and cloud services send logs to a collector. The collector feeds the SIEM, which correlates events from different sources and raises an alert to the security operations centre. Every source takes its time from NTP. Firewalls Switches and routers Servers and EDR Identity and ISE Cloud services Collectorsyslog and agents SIEMcorrelate, alert SOCanalyst every clock on NTP 5 failed VPN logins, then a success

Swipe sideways to see the whole diagram.

Correlation. One failed login means little. Five failed VPN logins for one account from abroad, then a success, then a new admin session on a firewall, is an incident. The SIEM only sees that pattern if every source sends logs with the right time.

Animation
ToolWhat it doesWhere it sits
IDS (intrusion detection system)Watches a copy of traffic and alertsA SPAN (switched port analyser) port or tap, out of the path
IPS (intrusion prevention system)Inspects traffic in the path and blocks matchesInside a next generation firewall or inline
EDR (endpoint detection and response)Watches processes on laptops and servers, and can isolate a hostAn agent on each endpoint
NDR (network detection and response)Spots unusual behaviour in flows and packetsFed from taps, mirror ports and flow records
SIEMCollects, stores and correlates logs from every sourceCentrally, with retention set by policy and regulation
SOAR (security orchestration, automation and response)Runs playbooks, such as blocking an address or disabling an accountNext to the SIEM
Frameworks

The frameworks I design against

Frameworks give security a shared structure, so a design can be checked and audited. These are the ones I meet most. The UK government frameworks, such as the Cyber Assessment Framework, are on the government and defence page.

Management system

ISO/IEC 27001

A standard for running an ISMS (information security management system). The 2022 edition's Annex A lists 93 controls in four themes: organisational, people, physical and technological. I map my designs to the controls an organisation has chosen.

Outcomes

NIST Cybersecurity Framework 2.0

Published in February 2024 by the US National Institute of Standards and Technology. Six functions: Govern, Identify, Protect, Detect, Respond and Recover. Useful for showing a board where the gaps are.

UK baseline

Cyber Essentials

Five technical controls from the NCSC: firewalls, secure configuration, user access control, malware protection and security update management. Cyber Essentials Plus adds independent testing.

Priorities

CIS Controls version 8.1

Eighteen prioritised controls from the Center for Internet Security, grouped into three implementation groups so smaller teams know where to start.

Attacker behaviour

MITRE ATT&CK

A public knowledge base of real attacker tactics and techniques. I use it to check that each likely technique has a control or a detection, and to test the SIEM.

Incidents and faults

When something goes wrong

Security incidents and security faults both need a calm, ordered response. The first hour decides how much damage is done and how much evidence survives. This is the order I work in.

The stages of incident response Six stages from left to right: detect, triage, contain, investigate, recover and learn. For each stage a panel lists the main actions, from confirming an alert and scoping the impact to isolating hosts, preserving evidence, restoring from clean backups and reviewing lessons. Detectalert Triagescope Containstop spread Investigateevidence Recoverclean restore Learnreview Step 1 · Detect An alert from the SIEM, endpoint protection or a user report Confirm it is real, not a false positive Open the incident record and start the clock Step 2 · Triage Scope it: which systems, data and people are affected Set the severity and call in the right team Follow the playbook, and keep a timeline of every action Step 3 · Contain Isolate hosts: quarantine VLAN, port shut or endpoint isolation Block the attacker's addresses and domains at the firewall and DNS Disable or reset the accounts involved Step 4 · Investigate Preserve evidence before changing anything: memory, disks, logs Pull logs, flow records and packet captures for the whole window Find the way in and how far it spread Step 5 · Recover Remove the cause: patch, rebuild and rotate keys and passwords Restore from clean, tested backups Watch closely for the attacker coming back Step 6 · Learn A review that looks for causes, not blame Fix the root causes and update playbooks and detections Report where the law requires it, such as UK GDPR (General Data Protection Regulation) breaches within 72 hours

Swipe sideways to see the whole diagram.

Step 1
  1. Most incidents start as an alert or a report from someone who noticed something odd. I confirm it is real, open an incident record and note the time, because regulators and contracts often set clocks from the moment of detection.

  2. I work out what is affected and how badly, set the severity and bring in the right people: security, network, service owners and, where needed, legal and communications.

  3. Stopping the spread comes before finding the cause. A quarantine VLAN, a shut port, an endpoint isolation or a firewall block buys time. Short term containment should not destroy evidence.

  4. I preserve evidence first, then build the timeline from logs, flow records and captures. This is where good logging and correct time on every device pay off.

  5. The cause is removed, systems are rebuilt or restored from clean backups, and keys and passwords are rotated. Monitoring stays tight in case the attacker returns.

  6. A blameless review turns the incident into fixes: root causes, better detections and updated playbooks. Personal data breaches go to the ICO (Information Commissioner's Office) within 72 hours where UK GDPR requires it.

Security faults I see, and how I find them

A user lost the network after DAI was turned on

Check: show ip arp inspection statistics vlan 20 and the log for denied ARP from that host; show ip dhcp snooping binding to see whether the host has a binding; show interfaces status err-disabled in case the ARP rate limit shut the port.

Usual cause: a host with a static address has no DHCP binding, so its ARP fails the check.

Fix and prevent: add an ARP ACL or a static binding through change, and recover the port. Roll out snooping first, then DAI, then IP source guard, and save bindings to flash.

Engineers cannot log in to a device

Check: the ISE live logs to see whether the request arrived and which policy it hit; show tacacs for server state; test aaa group tacacs+ USER PASSWORD legacy from the device; the source interface the device uses to reach the servers.

Usual cause: the device sits in the wrong network device group, a shared secret mismatch, or the servers cannot be reached from the management source address.

Fix and prevent: correct the group or secret; use the break glass account if the servers are down. Test AAA changes from a second session before saving.

Users see a certificate warning

Check: the expiry date, whether the name is in the certificate's subject alternative names, and whether the intermediate is sent: openssl s_client -connect www.example.co.uk:443 -showcerts. Also check the client's clock, and any TLS inspection device that swaps the server's certificate for its own.

Usual cause: an expired certificate, a missing intermediate, or a TLS inspection CA the client does not trust.

Fix and prevent: renew and install the full chain. Keep an inventory with expiry alerts and automate renewal.

A VPN works directly but fails through NAT

Check: show crypto ikev2 sa on both peers; captures for UDP 500 and UDP 4500; the firewall and NAT device rules between the peers.

Usual cause: UDP 4500 is blocked, or NAT traversal is off on one peer.

Fix and prevent: allow UDP 500 and 4500 and enable NAT traversal. Record the required ports in the design.

A device stays unauthorised on an 802.1X port

Check: show access-session interface Gi1/0/5 details on the switch, then the reason in the ISE live logs: no supplicant, a rejected certificate, or a failed MAC authentication bypass.

Usual cause: a printer or sensor with no 802.1X support and no MAB profile, or an expired client certificate.

Fix and prevent: profile the device and give it a limited MAB policy, or renew the certificate. Run new policies in monitor mode before closed mode.

Logins and certificates fail after a clock problem

Check: show clock and show ntp associations; certificates that are "not yet valid"; log timestamps that do not line up.

Usual cause: a device lost its NTP source. Kerberos allows only five minutes of clock difference by default, and certificates check dates.

Fix and prevent: restore NTP with authentication, use at least three sources, and alert on clock drift.

My full method for any fault, with the OSI (Open Systems Interconnection) model and the commands for each layer, is on the troubleshooting page. How incidents and problems run inside a service is on the support and service management page.

Projects

Where I put these basics to work

These fundamentals sit under every security design I have delivered, and I practise them on real kit in my home lab.

Home lab

Firewalls, AAA and access control

My home lab runs Cisco ASA (Adaptive Security Appliance), Palo Alto and Check Point firewalls, Cisco ISE for network access control, and TACACS on Windows Server for device logins, with DMVPN tunnels between the sites.

AVEVA · 2020 to 2021

Network and security transformation

Led network and security transformation as lead architect through AVEVA's reverse merger, modernising every site worldwide, and shaped network security for AVEVA Historian and, during the OSIsoft acquisition, the PI System.

BNY Mellon · 2018 to 2019

Regulated banking estate

Delivered the EMEA (Europe, Middle East and Africa) network refresh and kept the estate compliant with MiFID II (the Markets in Financial Instruments Directive) throughout, with no service outages.

Penguin Random House · 2013 to 2015

Segmentation after a merger

Integrated a multi site estate after the merger, with warehouse automation segmented from the corporate network, on Cisco, Palo Alto and VMware.

I work across Palo Alto, Check Point, Cisco Firepower, Cisco ISE, F5, IPsec VPN, zero trust and SASE (secure access service edge). I have passed the CCIE (Cisco Certified Internetwork Expert) Security written exam and hold the Cisco Certified Specialist Security Core certification.