Addressing Shortcomings of Existing DDoS Protection

0 downloads 0 Views 2MB Size Report
Nov 13, 2018 - TCP is a reliable transport protocol: ... SYN Flood Explanation ... 14 byte (Ethernet header) + 20 byte (IP header) + 20 byte (TCP header) = 54 ...
Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking SSP 2018, Hildesheim Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

13.11.2018 http://se.informatik.uni-wuerzburg.de/

Motivation 

No definite defense possible, only mitigation



Long time security threat



More dangerous than ever: • Increasing number of IoT devices • Generally lower security level



Marginal performance increase of defense systems hardware

Need for more effective mitigation approaches

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

2

SYN Flood

EXPLANATION

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

3

TCP 

TCP is a reliable transport protocol: • Retransmission of lost packets • Sorting of out-of-order packets



Sequence number on every packet is necessary



Initial sequence numbers are established in a three-way handshake

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

4

TCP Handshake Client

Server

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

5

SYN Flood Client

Server

Backlog:

TCB sIP1 TCB sIP1

TCB sIP2

TCB sIP1

TCB sIP2

TCB sIP3

TCB sIP1

TCB sIP2

TCB sIP3

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

TCB sIP4

6

SYN Flood Explanation



Attacker can spoof any source IP address



Server has to create TCB and keep it for a while



SYN packets are small: • 14 byte (Ethernet header) + 20 byte (IP header) + 20 byte (TCP header) = 54 byte • 1 Mbit/s can transport 2314 pps • 1 Mpps requires 432 Mbit/s

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

7

SYN Flood

EXISTING DEFENSE MECHANISMS

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

8

SYN Cookies Client

Server time mod 32

5

source IP/Port

MSS option

3

dest. IP/Port

crypt. HASH

24

calculate expected cookie, compare with ackn-1 Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

9

SYN Cookies



Amount of half-open connections not limited by backlog



CPU is burdened with hash calculations



TCP options are restricted



Only active when backlog is full

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

10

SYN PROXY – Connection Establishment Client

SYN PROXY

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

Server

11

SYN PROXY – Data Transfer Client

SYN PROXY

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

Server

12

SYN PROXY



Implemented as an IPtables module



Does not have to run on target machine



Only complete handshakes reach target



Proxy cannot predetermine server’s ISN



seqn/ackn translation always necessary

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

13

Limitations SYN Cookies

SYN PROXY



Has to run on service host



Stateful



No independent scaling



Network bottle neck



Independent scaling complex

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

14

In a Nutshell 

Problem: • Existing solutions can not easily be scaled indepentently from the service host



Idea: • Complete handshake in proxy • Route subsequent packets directly



Benefit: • Server handles only established connections • Proxy can specialize on handshake handling



Action: • Develop proxy network function, utilize SDN, modify server kernel

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

15

SYN Flood

SDN/NFV APPROACH

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

16

SDN and NFV

Software Defined Networking

Network Function Virtualization



SDN switches’ behavior is determined by a set of flows



SDN controller modify and monitor flow sets of connected switches



Firewall



Switch

A flow consists of:



IDS





Match



Action



Stats





Network functions modify packets not addressed to them

Virtualized NF is running on COTS hardware (instead of being an ASIC)

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

17

SDN/NFV Approach

Attacker Server

Gateway Client

Traditional network Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

18

SDN/NFV Approach

Controller

VNF

Attacker Gateway

OF-switch

Server

Client

SDN enabled network Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

19

SDN/NFV Approach

Controller

VNF

Attacker

Client

Server

OF-switch

Gateway Prio

Match

Action

0

SERV

VNF

0 0 1

GW

VNF VNF, daddr=s_ip

VNF GW

SERV

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

20

SDN/NFV Approach

Attacker sends SYN packets with spoofed addresses Attacker SYN

Client

Controller

VNF SYN ACK

Server

OF-switch

Gateway Prio

Match

Action

0

SERV

VNF

0 0 1

GW

VNF VNF, daddr=s_ip

VNF GW

SERV

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

21

SDN/NFV Approach

Client opens connection REST

Controller OF

VNF SYNACK SYN+ ACK

Attacker

SYN data Client ACK

SYN data ACK Server

OF-switch

Gateway Prio

Match

Action

0

SERV

VNF

0 0 1

10 10

GW

VNF VNF, daddr=s_ip

GW, from client SERV, to client

VNF GW

SERV

SERV GW

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

22

IMPLEMENTATION

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

23

Implementation: Kernel Modification



Simple concept



Only 8 lines of code



Kernel recompilation necessary



Complete handshake required

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

24

Implementation: VNF VNF is split in DPDK application and Python application

DPDK: 

Handshaking

Python: 

REST requests



(HTTP flood defense)

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

25

INITIAL EVALUATION

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

26

Virtual Testbed

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

27

Testing Methodology



Attacker floods SYN packets with delay between each packet



Client sends 50 SYN packets in 0.5s intervals



Score is the amount of answered client SYN packets

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

28

First Results No Protection AVG Successfull 0 Connections out of 50 

Promising results for first implementation



Feasability of idea verified

SYN Cookies

Our Approach

35

30.2

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

29

Limitations 

Client starts sending packets right after SYN/ACK



At that moment still outstanding • Connection establishment with server • Adaptation of SDN-Configuration



First packets are lost and have to be retransmitted.

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

30

CONCLUSION & FUTURE WORK

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

31

Conclusion 

Approach to use SDN to mitigate SYN-Flood attacks • Only complete handshakes reach service • VNF only responsible for establishing new connection



Performant because of DPDK



Scalable, since there are no dependencies and stateless

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

32

Future Work 

Evaluation with hardware NICs



Comparison between different archetectures for multi core



Move Kernel modification in standalone module



Analyze how to circumvent packet-loss problem



On demand enabling



Click & Use deployment (Docker/VM/Ansible)

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

33

Thank you for your attention! Phone: Mail: Web:

+49 (931) 31 89947 [email protected] https://go.uniwue.de/ifflaender Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

34

Bibliography

... Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

35

BACKUP

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

36

Implementation: Kernel Modification

from net/ipv4/tcp_ipv4.c: static u32 tcp_v4_init_seq(const struct sk_buff *skb) { return secure_tcp_seq(ip_hdr(skb)->daddr, ip_hdr(skb)->saddr, tcp_hdr(skb)->dest, tcp_hdr(skb)->source); }

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

37

Implementation: Kernel Modification static u32 tcp_v4_init_seq(const struct sk_buff *skb) { struct tcphdr *tcph; unsigned char *payload_start, *payload_end; tcph = tcp_hdr(skb); payload_start = (unsigned char *)((unsigned char *)tcph+(tcph->doff * 4)); payload_end = skb_tail_pointer(skb); if (payload_end - payload_start == 4) return cpu_to_be32(*((u32 *)payload_start));

}

return secure_tcp_seq(ip_hdr(skb)->daddr, ip_hdr(skb)->saddr, tcp_hdr(skb)->dest, tcp_hdr(skb)->source);

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

38

DPDK Features



Poll-mode, userspace NIC drivers



Lockless ringbuffer



Cryptographic library



Packet processing library (e.g. Fragmentation)



Kernel Network Interfaces



Hugepage support (and requirement) for less TLB misses



Thread-to-core pinning



NUMA support

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

39

DPDK Application

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

40

Python application

SYN Flood Defense



Translates address and port from pipe into flow modification REST request

HTTP Flood Defense



Monitor flow statistics



Aggregate per IP address



Requeue suspicious addresses

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

41

NICs and Drivers

NIC

RAM descriptor ring base addr length head tail

pool addr 0 pool addr 1

HT

mempool

pool addr 2 pool addr 3

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

42

Kernel Modification Validation

echo -n -e '\x01\x23\x45\x67' > payload hping3 --count 1 --syn --dest-port 80 --data 4 --file payload 192.168.0.10

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

43

Kernel Modification Validation

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

44

Kernel Modification Validation

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

45

THREADS Validation

Addressing Shortcomings of Existing DDoS Protection Software Using Software-Defined Networking Lukas Iffländer, Stefan Geissler, Jürgen Walter, Lukas Beierlieb, Samuel Kounev

46