1 Agenda Docker world Containers VS Virtual machine Security - - PowerPoint PPT Presentation

1 agenda
SMART_READER_LITE
LIVE PREVIEW

1 Agenda Docker world Containers VS Virtual machine Security - - PowerPoint PPT Presentation

12.03.2019 Docker security 1 Agenda Docker world Containers VS Virtual machine Security concerns Conclusion Whoami M.Sc Computer Security M.Sc Software Development Worked previously as an embedded software developer Actually


slide-1
SLIDE 1

1

Docker security 12.03.2019

slide-2
SLIDE 2

Docker world Containers VS Virtual machine Security concerns Conclusion

Agenda

slide-3
SLIDE 3

Whoami

➔ M.Sc Computer Security ➔ M.Sc Software Development ➔ Worked previously as an embedded software developer ➔ Actually working at ImmunIT ➔ Pentesting ➔ Secure coding training ➔ Security awareness training ➔ Social Engineering ➔ Project Management ➔ R&D developer

slide-4
SLIDE 4

4

Docker security

slide-5
SLIDE 5

What is docker?

Containerization Operating-system-level virtualization Execution environment virtualization

slide-6
SLIDE 6

What is docker?

slide-7
SLIDE 7

What is docker?

slide-8
SLIDE 8

What is docker?

slide-9
SLIDE 9

Why using docker?

➔ Isolate services ➔ Simplify micro-services enhancement and maintenance ➔ Avoid dependency issues ➔ Allow to execute untrusted code safely ➔ Reduce risks involved by a compromise ➔ etc

slide-10
SLIDE 10

How it works?

slide-11
SLIDE 11

Docker basics

slide-12
SLIDE 12

Dockerfile & docker-compose

Dockerfile

➔ Defines a docker image

slide-13
SLIDE 13

Dockerfile & docker-compose

Docker-compose

➔ Defines a containers stack ➔ Overwrite Dockerfile behaviors

slide-14
SLIDE 14

Orchestration

➔ Automates image buildings ➔ Automates deployment ➔ Resilient ➔ Macro management ➔ Live metrics

slide-15
SLIDE 15

Orchestration

Orchestrators

slide-16
SLIDE 16

Orchestration

Registry & rancher

slide-17
SLIDE 17

Orchestration

Rancher overview

slide-18
SLIDE 18

Orchestration

Rancher overview

slide-19
SLIDE 19

Orchestration

Rancher overview

slide-20
SLIDE 20

20

Docker security

Containers VS Virtual Machine The millennial war

slide-21
SLIDE 21

Containers VS Virtual Machine

Virtual Machine! Containers!

slide-22
SLIDE 22

Containers VS Virtual Machine

slide-23
SLIDE 23

Containers VS Virtual Machine

slide-24
SLIDE 24

24

Docker security

Security concerns

slide-25
SLIDE 25

Kernel namespace

➔ Containers process are running in their own kernel namespace ➔ Provides segregation ➔ Decreases risk exposure ➔ Containers get their own network stack

slide-26
SLIDE 26

User namespace

➔ Best way to prevent privilege escalation attack ➔ Configured on the host level ➔ Prevent root usage

slide-27
SLIDE 27

Tools

Docker notary

➔ Verify image signature ➔ Ensure integrity ➔ Avoid backdoors ➔ Cross platform

slide-28
SLIDE 28

Tools

Docker notary

slide-29
SLIDE 29

Tools

Docker bench security

slide-30
SLIDE 30

Tools

Traefik

slide-31
SLIDE 31

Tools

CoreOS

slide-32
SLIDE 32

Tools

Dockscan

slide-33
SLIDE 33

Container hardening & Access Control Management

slide-34
SLIDE 34

Container hardening & Access Control Management

Seccomp

slide-35
SLIDE 35

Container hardening & Access Control Management

SE Linux

slide-36
SLIDE 36

Container hardening & Access Control Management

App Armor

slide-37
SLIDE 37

Flags

Volume vs mount vs tmpfs

slide-38
SLIDE 38

Flags

Winner is volume

➔ Easier to back up ➔ Can be managed through the docker CLI ➔ Cross-platform ➔ Safe sharing ➔ Remote volume ➔ Data encryption (LVM, LUKS)

slide-39
SLIDE 39

Flags

Winner is volume

➔ Avoid mounting sensitive folder ➔ Use ro flag when needed

slide-40
SLIDE 40

Flags

Privileged container

  • -privileged is evil

➔ Privileged container run as a proper OS ➔ Can modify interfaces / iptables ➔ Access host devices

slide-41
SLIDE 41

Flags

Security opt

slide-42
SLIDE 42

Flags

Network namespace

slide-43
SLIDE 43

Flags

Network namespace

➔ Use dedicated networks ➔ Isolate containers on separated networks ➔ Create networks for exposed containers ➔ Segregate and segment networks as your own internal network

slide-44
SLIDE 44

Ports exposure

➔ Control services exposure ➔ Do not expose unnecessary ports

slide-45
SLIDE 45

Ports exposure

EXPOSE keyword is overwritten by –p flag at runtime

Docker run –rm –it –p 0.0.0.0:1337:80 alpine Docker run –rm –it –p 127.0.0.1:1337:80 alpine

slide-46
SLIDE 46

How to avoid Denial of Service attack

slide-47
SLIDE 47

How to avoid Denial of Service attacks

By default, a container has no resource constraints and can use as much of a given resource as the hosts’s kernel scheduler will allow

slide-48
SLIDE 48

How to avoid Denial of Service attacks

Memory usage

slide-49
SLIDE 49

How to avoid Denial of Service attacks

CPU usage

slide-50
SLIDE 50

50

Docker security

Conclusion

slide-51
SLIDE 51

Best practices

➔ Harden your containers ➔ Isolate your containers ➔ Keep up to date the underlying operating system ➔ Use security tool to monitor your containers

slide-52
SLIDE 52

Conclusion

Consider your containers as any physical machine and ensure their compliance towards your company security policies

slide-53
SLIDE 53

53

Docker security

slide-54
SLIDE 54

54

Docker security

QUESTIONS ?