Pcornel
Security · IPsec

Security Associations

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

Back to the Topic

Answer

A security association (SA) is a one-way agreement on keys, algorithms and lifetime between IPsec peers, identified by an SPI. Each tunnel has an IKE SA plus a pair of IPsec SAs.

Remember

  • An SA is one-way and identified by an SPI.
  • Each tunnel has an IKE SA and a pair of IPsec SAs.
  • Lifetimes trigger rekeying.

First checks

  • ip xfrm state — SAs (SPI, algorithms, lifetimes)
  • show crypto ipsec sa — SA details
  • swanctl --list-sas — SA state

Verify in this order

SPI → SA parameters → packet processing

Where it usually breaks

First mismatch in endpoint/identity → path/reachability → policy selection → enforcement/session → protected flow → telemetry/detection; preserve identity/policy/pre-state before mutation.

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

Confirmation

Confirm action

Continue?