Network Security & PKI OSI Model - Big Picture The Open System Interconnection (OSI) model It is a 7-layer reference model for network communication Each layer encapsulates specific communication functions and hides implementation details behind a well-defined service for the layer above Each layer offers services to the layer above and uses the layer below Helps reason about where protocols live and where to apply security controls DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 2 OSI Layers L7 Application – user-facing protocols (HTTP, DNS, SMTP, etc.) L6 Presentation – data formats, encryption, compression (rarely separate in practice) L5 Session – manages sessions (e.g., logged-in web session, SSH session) L4 Transport – end-to-end data transfer between applications (e.g., TCP, UDP) L3 Network – addressing & routing (e.g., IP, ICMP, BGP control plane) L2 Data Link – frames on local network (Ethernet, Wi-Fi, MAC, partially ARP) L1 Physical – encodes bits as electrical, optical, or radio signals on wire, fiber, and wireless links DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 3 TCP/IP vs OSI Internet protocols are usually described with the TCP/IP model (4–5 layers) Rough mapping: Application ≈ L5–L7 (Session, Presentation, Application) Transport ≈ L4 (TCP, UDP) Internet ≈ L3 (IP) Link ≈ L1–L2 (Ethernet, Wi-Fi, etc.) OSI is mainly a reference model; the TCP/IP model more closely reflects the way Internet protocols are grouped in practice DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 4 ARP – Address Resolution Protocol ARP lives between L2 (Data Link) and L3 (Network) Role: map IPv4 addresses to MAC addresses on a local network Basic idea: host broadcasts “Who has IP X? Tell Y” (ARP request) owner of IP X replies with its MAC address (ARP reply) Hosts keep an ARP cache (IP–MAC mappings with timeouts) Only used inside a LAN (not across routers) DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 5 Why ARP Is Vulnerable ARP is stateless and has no authentication Hosts accept any ARP reply, even if they never asked New ARP entries can overwrite existing ones in the cache Result: easy to inject fake IP–MAC mappings on the LAN This is the basis for ARP spoofing / ARP poisoning attacks DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 6 ARP Spoofing / ARP Poisoning I Attacker sends forged ARP replies on the LAN Goal: associate attacker’s MAC with a victim IP, e.g. default gateway Now other hosts send traffic for the gateway to the attacker instead DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 7 ARP Spoofing / ARP Poisoning II Attacker can: silently forward packets (Man-in-the-Middle) modify them or drop them (DoS) Mitigations: static ARP entries, dynamic ARP protection (e.g., via IP-to-MAC in DHCP snooping) , network segmentation DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 8 TCP and IP – Core of the Internet IP (Internet Protocol) – L3, provides best-effort packets across networks TCP (Transmission Control Protocol) – L4, reliable byte stream: connection setup (3-way handshake) sequencing, retransmission, congestion control UDP – L4, connectionless, no reliability, used for DNS, VoIP, streaming, VPNs, … DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 9 Why “Transmission Control Protocol”? TCP = Transmission Control Protocol Transmission – moves a stream of bytes between two endpoints Control – adds reliability, ordering, loss detection and retransmission, flow control and congestion control Protocol – a defined set of message formats and rules (SYN, ACK, FIN, sequence numbers, etc.) A protocol that controls how data is transmitted so delivery is reliable, ordered and connection-oriented DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 10 TCP Flow Control Flow control – protects the receiver Receiver advertises a window (rwnd): “you may have at most N unacknowledged bytes” Sender limits data to be sent to this window so it does not overflow the receiver’s buffer DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 11 TCP Congestion Control Congestion control – protects the network Sender maintains a congestion window (cwnd) based on ACKs and losses Algorithms (e.g., slow start, BBR, etc.) grow cwnd when the path looks free and shrink it when congestion is detected Effective sending limit: min(receiver window, congestion window) DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 12 Why “User Datagram Protocol”? UDP = User Datagram Protocol User – offers a minimal service directly to applications, leaving reliability/ordering to them if needed Datagram – sends independent, connectionless packets with no guarantee of delivery, order or uniqueness Protocol – simple header (ports, length, checksum) and rules for sending/receiving datagrams Overall: a lightweight protocol that hands raw, best-effort datagrams to applications with very little built-in control DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 13 IPv4 – Features and Limits 32-bit addresses → ~4.3 billion possible addresses Address exhaustion → heavy use of Network Address Translation (NAT) and private address ranges Widely deployed; IPv4 still dominates in many networks Routing: IPv4 prefixes advertised in BGP; global table recently passed 1 million prefixes Security add-ons: IPsec (network-layer), but most real-world security happens above IP (TLS, application-level controls) DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 14 IPv6 – Design & Advantages 128-bit addresses, i.e., astronomically large space Simpler headers, built-in support for: stateless address autoconfiguration (SLAAC) mandatory support for IPsec Better suited to end-to-end connectivity (no NAT) Designed to coexist with IPv4 (dual stack, tunneling, translation) DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 15 Where Does Transport Layer Secure (TLS) Live in OSI? In practice, TLS sits between Application and Transport: Application (e.g. HTTP, gRPC) talks to TLS library TLS runs over TCP (L4) In OSI terms, TLS provides many functions of: Session layer (managing secure sessions) Presentation layer (encryption, integrity, compression) This is why we write HTTPS = HTTP + TLS + TCP + IP + … DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 16 VPNs in the Stack – Concept A VPN creates an encrypted tunnel over an untrusted network From the OSI point of view, a VPN can emulate: L3: virtual IP network (tunnel IP packets) Inside the tunnel, you can use IPv4, IPv6, or both The tunnel itself usually runs over UDP or TCP on top of IP DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 17 WireGuard – Modern L3 VPN WireGuard is a modern VPN protocol with a small codebase and strong cryptography Runs over UDP (typically port 51820) on top of IP Creates a virtual network interface (wg0) that carries IP packets OSI view: uses L3+L4 (IP/UDP) for transport provides a secure L3 tunnel for IPv4/IPv6 between peers Very common in modern infrastructure, containers, and cloud setups DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 18 OpenVPN – TLS-Based VPN OpenVPN uses TLS for key exchange & authentication Can run over UDP or TCP (e.g. port 1194 or 443) Also creates a virtual network interface (e.g.,tun for L3) OSI view: TLS layer ≈ session/presentation transported via TCP/UDP (L4) over IP (L3) provides L3 (IP tunnel) service to upper layers Good example of combining TLS, PKI, and VPN concepts DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 19 DNS – The Internet’s Phonebook DNS is an Application-layer protocol (L7) Maps names to IP addresses Typical transport in the past: UDP port 53 for most queries TCP port 53 for large responses, zone transfers Original DNS design: no authentication or integrity protection vulnerable to spoofing / cache poisoning DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 20 DNSSEC – What and Why I DNSSEC = DNS Security Extensions Adds digital signatures to DNS data: zones sign their records with a private key resolvers verify with the corresponding public key DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 21 DNSSEC – What and Why II Provides: origin authentication – data really from the claimed zone integrity – data not modified in transit authenticated denial of existence (secure “no such name”) Does not provide confidentiality; queries/responses are still visible unless combined with e.g. DNS-over-TLS / DNS-over-HTTPS DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 22 BGP – Routing Between Autonomous Systems The Internet is split into Autonomous Systems (AS): networks under a single administrative control BGP (Border Gateway Protocol) is the inter-domain routing protocol runs between routers at L3 control plane exchanges information about IP prefixes and paths (AS paths) Every globally reachable IPv4/IPv6 prefix is typically announced in BGP BGP decisions are based on policy as much as on pure technical metrics DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 23 BGP rerouting to China I Local US traffic from LA to Washington routed via China: DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 24 BGP rerouting to China II DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 25 TCP/IP Threat Model Assume a powerful network adversary who can: intercept and read packets modify packets in transit inject new packets Adversary fully controls their own machines Adversary can often participate in protocols as a “legitimate” node Goal: understand vulnerabilities that exist even if implementations are bug-free DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 26 Implementation vs Protocol-Level Bugs I Implementation bug: mistake in a particular codebase can be fixed with a patch / update Protocol-level problem: inherent in the design any correct implementation will have the same issue DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 27 Implementation vs Protocol-Level Bugs II Fixing protocol-level bugs: may require changing the protocol spec risks compatibility with deployed systems Many TCP/IP vulnerabilities we discuss are protocol-level DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 28 Packet Spoofing in IP IP lets sender construct packets with arbitrary source address Adversary can pretend to be any IP: forge packets as if from a trusted host Used to: exploit bugs in applications bypass IP-based access controls launch reflection / amplification attacks DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 29 TCP Sequence Numbers Standard TCP 3-way handshake: Client → Server: SYN with initial sequence number from client SNc Server → Client: SYN-ACK with initial sequence number from server SNs, ack SNc Client → Server: ACK with SNc, ack SNs Data flows with increasing sequence numbers Design idea: only endpoints that saw the handshake should know valid sequence numbers DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 30 TCP Sequence Number Attack Goal: adversary Alice forges a TCP connection from client C to server S. Alice sends SYN spoofed as C → S S replies with SYN-ACK → real C (Alice doesn’t see it) Alice guesses SNs and sends ACK + data spoofed as C Originally: TCP spec suggested predictable initial SNs (ISNs) (increment at ~constant rate) With predictable ISNs, Alice can guess SNs well enough to establish a fake connection DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 31 Exploiting IP-Based “Trust” Old Unix tools (rlogin, rsh, rcp) trusted connections: from certain IP addresses from “trusted” source ports If TCP connection appears from a “trusted” host: often no password required By spoofing a sequence number attacker can simulate a connection from that host Lesson: IP / port based host authentication is fundamentally unsafe DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 32 More Consequences of Seq Number Attacks I Connection reset (DoS): once attacker knows SNc, can send forged RST many TCP stacks accept any RST whose sequence number falls within the current receive window Connections can be dropped remotely: e.g., BGP sessions between routers routers assume link failure → reconvergence takes time DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 33 More Consequences of Seq Number Attacks II Connection hijacking: inject data into existing stream if you know current sequence numbers Shows that lack of authentication at TCP layer has serious consequences DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 34 Fixing TCP Sequence Numbers We can’t just choose ISNs arbitrarily (must obey TCP reuse rules) Idea: keep old monotonic behavior but add per-connection randomness: ISN = ISN_old_style + F(srcIP, srcPort, dstIP, dstPort, secret) F is a pseudo-random function (e.g., using a strong hash) No extra per-connection state needed; attacker cannot predict ISNs easily Modern OSes implement such secure TCP sequence numbers DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 35 DNS Spoofing – Similar Pattern I DNS over UDP has: transaction ID (16 bits) source port, typically 53 on server side If attacker can guess: which query is being made source port and transaction ID they can forge a DNS reply DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 36 DNS Spoofing – Similar Pattern II Used in classic DNS cache poisoning: inject fake IPs for domains into resolver caches Mitigations: randomize source ports and IDs as much as possible deploy DNSSEC (signed DNS data) to add authentication DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 37 SYN Flooding – DoS via Asymmetry I Server allocates state for half-open connections: after SYN, before final ACK Attacker sends large numbers of SYNs: often with spoofed source IPs DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 38 SYN Flooding – DoS via Asymmetry II Server stores state for each pending connection: memory and connection table fill up legitimate clients get refused / delayed Big asymmetry: attacker sends one small packet server keeps state for seconds or minutes DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 39 SYN Cookies – Stateless Defense I Goal: avoid storing state until client proves it saw the SYN-ACK Server encodes state in its sequence number: ISNs = MAC_k(src/dst addr+port, timestamp) || timestamp On ACK: server recomputes MAC to verify that the ACK is legit only then allocates state for the connection DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 40 SYN Cookies – Stateless Defense II Trade-offs: slightly more complex handling some TCP options hard to support fully with cookies Effective against large SYN flood attacks DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 41 Fragile Routing & Local Network Protocols I Many protocols trust participants too much: ARP: anyone can answer “who has IP X?” with a fake MAC enables LAN-level MitM (ARP spoofing) DHCP: unauthenticated replies to broadcasts attacker can be your “DHCP server”: choose router, DNS, etc. DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 42 Fragile Routing & Local Network Protocols II BGP: AS can announce any prefix it chooses enables route hijacking, spam from “borrowed” IP space Research / proposals: secure ARP, DHCP snooping, SBGP / RPKI for BGP, etc. (deployment is still partial) DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 43 Reconnaissance: Finding Targets I Adversaries need to know: which IPs exist which services / versions are running Tools & techniques: port scans on well-known ports banner grabbing (protocols often send identifying strings) OS fingerprinting (e.g. nmap) via subtle TCP/IP quirks DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 44 Reconnaissance: Finding Targets II Internet-wide scanning: IPv4: 2³² addresses → practical to scan entire space with fast tools Takeaway: if your service is on the Internet, assume it will be found DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 45 Why TCP/IP Is So Insecure I Historical context: early Internet was small, relatively “friendly” security was not a primary design goal End-to-end principle: many security properties must be enforced at application layer anyway so lower layers stayed simple and relatively unauthenticated DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 46 Why TCP/IP Is So Insecure II Retro-fitting security: hard to replace core protocols globally we add patches and extensions for worst problems Modern approach: keep using TCP/IP, but layer TLS, SSH, VPNs, etc. on top use firewalls and filtering as partial defenses secure routing & naming (SBGP, DNSSEC) where possible DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 47 Key Lessons for You Do not rely on: IP addresses, ports, or hostnames as authenticators Assume attackers can: spoof packets, reset connections, flood you, poison caches, hijack routes Use cryptographic authentication and encryption at higher layers DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 48 Threats in Networked Systems Eavesdropping (packet sniffing) – attacker reads traffic Tampering – attacker modifies messages in transit Replay attacks – attacker re-sends valid messages later Impersonation / spoofing – attacker pretends to be someone else Man-in-the-Middle (MitM) – attacker sits between client and server Denial-of-Service (DoS) – attacker disrupts availability DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 49 Cryptographic Tools (Recap) Symmetric encryption – fast, protects confidentiality Message authentication codes (MACs) – protect integrity + authenticity Public-key encryption – key distribution, small data Digital signatures – authentication, integrity, non-repudiation Hash functions – message digests, integrity checks DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 50 Hybrid Approach in Network Protocols Public-key crypto is slow, symmetric crypto is fast Protocols use public-key only to agree on a fresh symmetric key Then use symmetric encryption & MACs for bulk data Example: TLS handshake → establish session keys, then encrypt traffic DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 51 TLS: High-Level Goals Given a client and a server, TLS aims to provide: Confidentiality – encrypt all application data Integrity – detect modifications of messages Authentication – typically server authentication, sometimes mutual Forward secrecy (TLS 1.3) – compromise of long-term keys does not reveal past sessions DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 52 TLS: Very Simplified Handshake Client and server roughly agree on: Which protocol version and cipher suite to use A fresh key exchange (e.g. Elliptic Curve Diffie-Hellman Ephemeral (ECDHE)) to derive shared secrets The server proves its identity using a certificate Both derive session keys from the key exchange output After the handshake, all application data is encrypted + authenticated DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 53 The Key Distribution Problem Symmetric crypto needs a shared secret key How do we securely obtain the correct public key of a server? Simply trusting the first key we see (TOFU) is vulnerable to MitM We need a way to bind a public key ↔ identity that can be verified by clients DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 54 Certificates: Binding Keys to Identities A certificate is a data structure that contains: an identity (e.g. DNS name, organization) a public key It is digitally signed by an issuer The signature binds the public key to the identity Clients verify the signature using a trusted authority DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 55 What Is PKI? Public Key Infrastructure (PKI) = ecosystem that: issues, distributes and manages certificates defines trust relationships handles revocation and lifecycle PKI is more about governance, policies and processes than pure cryptography On the web, “Web PKI” secures HTTPS, email, code signing, etc. DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 56 X.509 Certificates I Most Internet PKI uses X.509 certificate format (currently v3) Standardized structure for: subject identity subject public key issuer identity validity period serial number signature algorithm & signature DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 57 X.509 Certificates II Plus many extensions (key usage, subject alt names, constraints, …) DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 58 # X.509 – Important Fields Subject – who the certificate is for (CN, organization) Subject Alternative Name (SAN) – DNS names, IPs, email Issuer – who signed the certificate (CA) Validity period – Not Before / Not After Public key – the key to be used by clients Key Usage / Extended Key Usage – allowed purposes (TLS server auth, code signing, …) Signature – by issuer’s private key over certificate contents DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 59 Types of Certificates I Root CA certificate self-signed, long-lived shipped in OS / browser trust stores Intermediate CA certificate signed by a root or another intermediate used to issue end-entity certs DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 60 Types of Certificates II End-entity (leaf) certificate for servers, clients, code signing, etc. used in TLS handshakes, VPNs, S/MIME, … DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 61 PKI Trust Hierarchy Browsers / OS trust a set of root CAs Root CAs sign intermediate CAs Intermediate CAs sign end-entity certs (e.g. for websites) Client builds a certificate chain from leaf → … → root If the chain is valid and ends in a trusted root → identity accepted DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 62 Chain of Trust – Example When you browse to https://example.com: Server sends its leaf certificate Server sends intermediate(s) needed for chain building Client checks that: leaf cert is valid for example.com each cert is correctly signed by the next CA top of chain is a trusted root Only then does the client trust the server’s public key DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 63 Certificate Path Validation (Simplified) Client verifies: All certificates in the chain are time-valid Each certificate’s signature is valid using the issuer’s public key Intended usage (key usage / EKU) matches (e.g., TLS server auth) Name in certificate (SAN) matches the hostname No certificate in the chain is revoked Top-level issuer is in the local trust store DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 64 Revocation: Why We Need It Sometimes a certificate must be invalidated before expiry: private key compromise change of ownership / name mis-issuance, CA errors PKI therefore needs mechanisms for: publishing “this cert is no longer trusted” letting clients check revocation status DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 65 Revocation Mechanisms I Certificate Revocation Lists (CRLs) CA publishes signed list of revoked serial numbers Can be large; clients need to download them Online Certificate Status Protocol (OCSP) Client queries CA’s OCSP responder: “is cert X valid?” Response is short and signed DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 66 Revocation Mechanisms II OCSP stapling Server fetches OCSP response and includes it in TLS handshake Better privacy and performance DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 67 Web PKI in Practice Public CAs (Let’s Encrypt, DigiCert, Sectigo, …) issue web certs Browsers maintain root programs deciding which CAs to trust Standards (e.g. CA/Browser Forum Baseline Requirements) define: validation procedures allowed algorithms maximum certificate lifetimes Automated issuance via Automatic Certificate Management Environment (ACME) protocol (e.g. Let’s Encrypt) DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 68 Enterprise / Private PKI Organizations often run internal CAs for: VPNs, Wi-Fi, internal web services mTLS between microservices device / user authentication Their root CA is not public, but deployed on internal devices Same concepts: roots, intermediates, leaf certs, revocation DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 69 TLS 1.3: Modern Features Removes many legacy, insecure algorithms Always uses (EC)DHE → forward secrecy Fewer round-trips: faster handshakes, 0-RTT option Encrypts more of the handshake itself Recommended default for modern systems DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 70 TLS and Data Pipelines APIs used for training data, model serving, feature stores should: use TLS 1.3 enforce strong cipher suites Client libraries (Python, Java, etc.) usually rely on system’s TLS stack You should still: verify certificate validation is enabled use hostname verification consider mTLS for internal services DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 71 mTLS (Mutual TLS) Standard TLS: only server presents a certificate Mutual TLS (mTLS): client also presents its own certificate Used for strong authentication between: microservices API clients and gateways VPN clients and gateways Requires managing certificates for clients (often automated) DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 72 Common PKI / TLS Pitfalls Using self-signed certs in production without proper trust config Disabling certificate or hostname verification “to make it work” Accepting all certificates in code (e.g. ignoring verification callbacks) Letting certificates expire unnoticed Using deprecated algorithms DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 73 Network Security & PKI – Conclusion Internet protocols sit in a layered stack (OSI / TCP-IP); many core layers were designed with functionality, not security, in mind Key network protocols (IP, TCP, ARP, DNS, BGP, DHCP) are often unauthenticated → enable spoofing, MitM, route hijacking, and DoS We add security by layering cryptography on top: TLS, VPNs, DNSSEC, secure routing, etc. PKI and X.509 certificates bind public keys to identities and make TLS and many VPNs actually trustworthy Never trust the network (IP/ports/paths); rely on cryptographic authentication, encryption, and proper PKI to secure your systems DEPARTMENT OF ADVANCED COMPUTING SCIENCES, MAASTRICHT UNIVERSITY COMPUTER SECURITY | 74
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )