+ All Categories
Home > Documents > Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in...

Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in...

Date post: 05-Jun-2018
Category:
Upload: doanh
View: 230 times
Download: 0 times
Share this document with a friend
31
visualizing security boundaries in docker swarm overlay networks Marcel Brouwers July 3, 2017 Master of System and Network Engineering University of Amsterdam Supervisor: Esan Wit
Transcript
Page 1: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

visualizing security boundaries in dockerswarm overlay networks

Marcel BrouwersJuly 3, 2017

Master of System and Network EngineeringUniversity of AmsterdamSupervisor: Esan Wit

Page 2: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Introduction

Docker Swarm

∙ Mode for managing a cluster of docker nodes∙ The Swarm keeps services running and distributes containers overthe nodes

∙ Has a feature for overlay networks between containers

1

Page 3: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Docker Swarm overlay network

∙ VxLAN 1 based overlay networks. (Layer 2 over Layer 3)∙ Containers can be connected to multiple Swarm overlay networks∙ Networks are created from the manager nodes∙ Serf used for mapping 2

1https://tools.ietf.org/html/rfc73482https://github.com/docker/libnetwork/blob/master/drivers/overlay/ov_serf.go

2

Page 4: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

VxLAN

∙ RFC 7348∙ Layer 2 over layer 3∙ 24 bits Virtual Network Identified (VNI)∙ UDP port 4789

3

Page 5: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Research question

∙ What gets exposed when using Docker Swarm overlay networksand is there a way to visualize what gets exposed?

∙ Which security measures are there for Docker Swarm overlay networksand what can be done on the overlay network if a container or hostgets compromised?

∙ Which strategies are there to find out what gets exposed by containersand hosts in (overlay) networks?

∙ Is it feasible to consolidate all the information about exposure andvisualize it in a comprehensible way?

4

Page 6: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Research question

∙ What gets exposed when using Docker Swarm overlay networksand is there a way to visualize what gets exposed?∙ Which security measures are there for Docker Swarm overlay networksand what can be done on the overlay network if a container or hostgets compromised?

∙ Which strategies are there to find out what gets exposed by containersand hosts in (overlay) networks?

∙ Is it feasible to consolidate all the information about exposure andvisualize it in a comprehensible way?

4

Page 7: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Research question

∙ What gets exposed when using Docker Swarm overlay networksand is there a way to visualize what gets exposed?∙ Which security measures are there for Docker Swarm overlay networksand what can be done on the overlay network if a container or hostgets compromised?

∙ Which strategies are there to find out what gets exposed by containersand hosts in (overlay) networks?

∙ Is it feasible to consolidate all the information about exposure andvisualize it in a comprehensible way?

4

Page 8: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Research question

∙ What gets exposed when using Docker Swarm overlay networksand is there a way to visualize what gets exposed?∙ Which security measures are there for Docker Swarm overlay networksand what can be done on the overlay network if a container or hostgets compromised?

∙ Which strategies are there to find out what gets exposed by containersand hosts in (overlay) networks?

∙ Is it feasible to consolidate all the information about exposure andvisualize it in a comprehensible way?

4

Page 9: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Related work

∙ Layer 2 attacks on a VxLAN overlay network, Author: G. Peneda,March 11, 2014

∙ Secure Virtual Network Configuration for Virtual Machine (VM)Protection Author: NIST, March 2016

∙ Docker swarm mode overlay network security model Author:Docker Project, 2017 3

3https://docs.docker.com/engine/userguide/networking/overlay-security-model/

5

Page 10: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Security measures for Swarm overlays

∙ Encryption possible: IPSEC tunnel∙ Encryption for overlay network not used by default

6

Page 11: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

What’s possible?

∙ Tested: ARP spoofing, MAC flooding∙ Tested using: Arpspoof tool (Dsniff), Ettercap, Macof (Dsniff)∙ Using non-privileged containers and privileged containers∙ Monitored ARP tables and sniffed network traffic

∙ Result: Not possible.

7

Page 12: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

What’s possible?

∙ Tested: ARP spoofing, MAC flooding∙ Tested using: Arpspoof tool (Dsniff), Ettercap, Macof (Dsniff)∙ Using non-privileged containers and privileged containers∙ Monitored ARP tables and sniffed network traffic∙ Result: Not possible.

7

Page 13: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Why was that not possible?

1 root@manager1 : ~ # ip netns exec 1−7x3gg l x lba ip −d l i n k show vx lan12 1 1 : vx lan1 : <BROADCAST , MULTICAST , UP , LOWER_UP> mtu 1450 qdisc noqueue master br0 s ta te UNKNOWN mode

DEFAULT group defau l t3 l i n k /ether 46 : e6 : 4 8 : 5 d : dd : 9 2 brd f f : f f : f f : f f : f f : f f l ink−netnsid 0 promiscui ty 14 vxlan id 4097 s rcpor t 0 0 dstport 4789 proxy l2miss l3miss ageing 300

Listing 1: Proxy ARP configured on VTEP

“In addition to a learning-based control plane, there are otherschemes possible for the distribution of the VTEP IP to VM MACmapping information”’ 4

FDB gets populated using a gossip protocol “Serf”.

4https://tools.ietf.org/html/rfc7348#page-218

Page 14: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

What’s possible?

∙ Tested: Replay of packets∙ Using Tcpreplay∙ ICMP from container A to container B on host A and B∙ Replayed ICMP request from node C

∙ Works, ICMP reply arrives at container A∙ Also works when source ip is changed∙ Replay also works for an encrypted Swarm overlay network

∙ VNIs predictable: start at 4096∙ UDP port 4789 (and tcp/udp 7946 for Serf)

9

Page 15: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

What’s possible?

∙ Tested: Replay of packets∙ Using Tcpreplay∙ ICMP from container A to container B on host A and B∙ Replayed ICMP request from node C∙ Works, ICMP reply arrives at container A

∙ Also works when source ip is changed∙ Replay also works for an encrypted Swarm overlay network

∙ VNIs predictable: start at 4096∙ UDP port 4789 (and tcp/udp 7946 for Serf)

9

Page 16: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

What’s possible?

∙ Tested: Replay of packets∙ Using Tcpreplay∙ ICMP from container A to container B on host A and B∙ Replayed ICMP request from node C∙ Works, ICMP reply arrives at container A∙ Also works when source ip is changed

∙ Replay also works for an encrypted Swarm overlay network

∙ VNIs predictable: start at 4096∙ UDP port 4789 (and tcp/udp 7946 for Serf)

9

Page 17: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

What’s possible?

∙ Tested: Replay of packets∙ Using Tcpreplay∙ ICMP from container A to container B on host A and B∙ Replayed ICMP request from node C∙ Works, ICMP reply arrives at container A∙ Also works when source ip is changed∙ Replay also works for an encrypted Swarm overlay network

∙ VNIs predictable: start at 4096∙ UDP port 4789 (and tcp/udp 7946 for Serf)

9

Page 18: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

What’s possible?

∙ Tested: Replay of packets∙ Using Tcpreplay∙ ICMP from container A to container B on host A and B∙ Replayed ICMP request from node C∙ Works, ICMP reply arrives at container A∙ Also works when source ip is changed∙ Replay also works for an encrypted Swarm overlay network

∙ VNIs predictable: start at 4096∙ UDP port 4789 (and tcp/udp 7946 for Serf)

9

Page 19: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Strategies for finding out what gets exposed

∙ Have each container report netstat output and firewall status∙ Pro: Can be fast and complete∙ Con: Overhead by running on each container∙ Con: Required adapting docker files and redeploying.

∙ Scan the network∙ Pro: One container that runs a scanner∙ Con: Should be connected to all overlay networks∙ Con: Scan can take a long time

∙ Have each host report netstat output and firewall status for thecontainers∙ Pro: Containers can not be overlooked∙ Pro: Can be relatively fast

10

Page 20: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Strategies for finding out what gets exposed

∙ Have each container report netstat output and firewall status∙ Pro: Can be fast and complete∙ Con: Overhead by running on each container∙ Con: Required adapting docker files and redeploying.

∙ Scan the network∙ Pro: One container that runs a scanner∙ Con: Should be connected to all overlay networks∙ Con: Scan can take a long time

∙ Have each host report netstat output and firewall status for thecontainers∙ Pro: Containers can not be overlooked∙ Pro: Can be relatively fast

10

Page 21: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Strategies for finding out what gets exposed

∙ Have each container report netstat output and firewall status∙ Pro: Can be fast and complete∙ Con: Overhead by running on each container∙ Con: Required adapting docker files and redeploying.

∙ Scan the network∙ Pro: One container that runs a scanner∙ Con: Should be connected to all overlay networks∙ Con: Scan can take a long time

∙ Have each host report netstat output and firewall status for thecontainers∙ Pro: Containers can not be overlooked∙ Pro: Can be relatively fast

10

Page 22: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Visualizing

∙ D3.js∙ Visualizations in the browser∙ Collected data using Swarm API and scripts on hosts

11

Page 23: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Visualizing

12

Page 24: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Visualizing

13

Page 25: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Visualizing

14

Page 26: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Visualizing

15

Page 27: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Visualizing

16

Page 28: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Visualizing

Demo

17

Page 29: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Conclusion

∙ Layer 2 attacks based on ARP injecting seems not possible on aSwarm overlay network

∙ It is possible to inject something in a Swarm overlay network whenstandard configuration is used

∙ Encrypted Swarm overlay traffic can be successfully replayed∙ Creating visualizations of the Swarm overlay networks takingsecurity boundaries into account is possible

18

Page 30: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Future work

∙ Research the mechanism that updates the mapping for the VTEPs∙ Work on visualizations for single nodes showing more detail forfirewall configuration

19

Page 31: Visualizing security boundaries in Docker Swarm overlay ... · visualizing security boundaries in docker swarm overlay networks MarcelBrouwers July3,2017 ... overlay/ov_serf.go 2.

Questions?

20


Recommended