scalable and lightweight ctf infrastructures using application … · scalable and lightweight ctf...

38
Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri Prabhu and Krishnashree Achuthan Amrita Center for Cybersecurity Systems and Networks Amrita Vishwa Vidyapeetham, Kerala, India 2016 USENIX Advances in Security Education Workshop Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 1/38

Upload: others

Post on 20-May-2020

25 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Scalable and Lightweight CTFInfrastructures Using Application

ContainersArvind S Raj, Bithin Alangot, Seshagiri Prabhu and

Krishnashree Achuthan

Amrita Center for Cybersecurity Systems and NetworksAmrita Vishwa Vidyapeetham, Kerala, India

2016 USENIX Advances in Security Education

WorkshopArvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 1/38

Page 2: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Introduction

CTFs - an effective means to teach secure codingand computer security.

Two popular formats: Jeopardy and Attack-defence.

Jeopardy: Self-paced, offence only, non-interactiveand more popular.

Attack-defence: Real-time, offence and defence,interactive but less popular.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 2/38

Page 3: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

CTF event counts

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 3/38

Page 4: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Participation trends

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 4/38

Page 5: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Format challenges

Both organizers and participants face challenges.

Organizers: Complex infrastructure engineering andhigh resource requirements.

Participants: Complex gameplay, infrastructuresetup and IT policies.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 5/38

Page 6: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Problem

Can we build lessresource intensive andeasily scalable contest

infrastructures?Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 6/38

Page 7: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Solution

Replace virtual machineswith application containers.

Significant reduction in resource usage andengineering required.

Eliminates several difficult to setup components.

Improves gameplay experience for participants.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 7/38

Page 8: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Outline of presentation

1 Challenges in existing attack-defence CTF gameformat and infrastructures

2 Overview of Docker and associated technologies

3 Container-based attack-defence CTF gameinfrastructure

4 Performance evaluation

5 Future work

6 Conclusion

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 8/38

Page 9: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Outline

1 Challenges in existing attack-defence CTF gameformat and infrastructures

2 Overview of Docker and associated technologies

3 Container-based attack-defence CTF gameinfrastructure

4 Performance evaluation

5 Future work

6 Conclusion

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 9/38

Page 10: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Challenges

2 sources: gameplay and game infrastructure.

Gameplay affects participants: requires doing toomany tasks.

Distracts them from primary objective.

Infrastructure affects organizers and participants.

2 infrastructure types: distributed and centralized.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 10/38

Page 11: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Distributed infrastructure

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 11/38

Page 12: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Challenges

Organizers

Infrastructure needs lot of resources, engineering andmonitoring.

eg: rwthCTF 2012’s VPN server: 16GB RAM, 8 core i7processor and 8 OpenVPN daemon processes.

Participants

Difficult to obtain hardware such as computers andnetwork switches/routers.

University IT policies prevent connecting to UDP basedVPNs.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 12/38

Page 13: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Centralized infrastructure

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 13/38

Page 14: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Challenges

Organizers

Exponential increase in computing resources required.

Setting up exploit sandboxes, installing libraries andexecuting exploits.

Participants

Network latency when accessing services.

Recreating services locally for analysis and testing is notstraightforward.

Locked in to a standard exploit environment.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 14/38

Page 15: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Outline

1 Challenges in existing attack-defence CTF gameformat and infrastructures

2 Overview of Docker and associated technologies

3 Container-based attack-defence CTF gameinfrastructure

4 Performance evaluation

5 Future work

6 Conclusion

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 15/38

Page 16: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Docker vs Virtual machines

Figure : Virtual Machines

Figure : Docker containers

Images courtesy www.docker.com

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 16/38

Page 17: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Why Docker?

Built-in container image reuse and extendcapabilities.

Remote API and programming language bindingsaid in automation.

Easy to share and distribute container images.

Third party tools for container and imagemanagement.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 17/38

Page 18: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Distribution and PORTUS

Docker Inc’s Distribution: Tool to manage containerimages - similar to a Git server.

SUSE’s PORTUS: Role-based access control ofDistribution’s images.

Allows creating namespaces for teams and assigningdifferent access levels to them.

Alternatives: GitLab, Dockerhub, Amazon EC2container service, Google Container Registry andmore.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 18/38

Page 19: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Outline

1 Challenges in existing attack-defence CTF gameformat and infrastructures

2 Overview of Docker and associated technologies

3 Container-based attack-defence CTF gameinfrastructure

4 Performance evaluation

5 Future work

6 Conclusion

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 19/38

Page 20: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Components

Container registry: Git server like service forcontainer images.

Container hosts: Servers which run all thecontainers.

Service related containers: Docker containerswhich either run a service or an exploit for a service.

Flag volume: Docker volumes for persistentstorage of flags.

Modified versions of components of the iCTFcentralized framework.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 20/38

Page 21: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

System design

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 21/38

Page 22: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Gameplay

Organizers

Configure a CTF contest as desired.

Build the service container images.

Configure the container registry and upload servicecontainer images to it.

Setup the game database and configure all gamescripts.

Optionally distribute encrypted copies of servicecontainer images to all teams.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 22/38

Page 23: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Gameplay (cont.)

Participants

Import the service container images from registry ororganizer distributed copies.

Analyze services for vulnerabilities, fix them andcommit and upload changes to container registry.

Create exploit containers for discoveredvulnerabilities in accordance with the requirements,test them locally and upload them.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 23/38

Page 24: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Game round overview

A game consists of several rounds with following phases

Synchronize: All updated container images aresynchronized with their live containers or images.

Store flags: Flags are stored in all services of allteams and services’ status is updated.

Run exploits: All exploit containers are run againstall services of all teams except exploit author.

Retrieve flags: Flags stored earlier are retrieved,service status is updated and points are deducted ifnot retrieved successfully.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 24/38

Page 25: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Benefits for organizers

Lightweight game infrastructure.

No need for engineering and monitoring VPNnetwork.

No need for configuring exploit environments.

Tools like Docker swarm and Docker cloud furtherease managing infrastructure.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 25/38

Page 26: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Benefits for participants

No additional hardware, dealing with IT policies orsetting up VPN.

No dealing with network latency: setup serviceslocally.

Infrastructure maintains service backups, simplifyinggameplay.

Fully customizable exploit environments.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 26/38

Page 27: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Outline

1 Challenges in existing attack-defence CTF gameformat and infrastructures

2 Overview of Docker and associated technologies

3 Container-based attack-defence CTF gameinfrastructure

4 Performance evaluation

5 Future work

6 Conclusion

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 27/38

Page 28: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Experiments performed

Two kinds of experiments3 services, 5 to 40 teams.30 teams, 1 to 8 services.

Measure CPU utilization and memory usage for a 10minute game round.

Worst case: All teams write exploits for all services.

Compare with estimated usage in VM basedinfrastructure.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 28/38

Page 29: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Estimating VM resource usage

Simulating requires high amounts of resources.

Estimate based on requirements for InCTF’sattack-defence round.

1GB RAM for 3 services found sufficient in past 5editions.

200MB RAM per service and rest for the OS.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 29/38

Page 30: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Observations

Container server: 16GB RAM and 8 core Intel Corei5 2600 processor.

Highest memory usage: 3.4GB and 4.4GB. Exploitsincluded.

Estimated usage for VMs: 40GB and 60GB.Exploits not included.

Highest CPU usage observed 13% and 20%.

Can easily handle loads comparable to mostattack-defence CTFs today.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 30/38

Page 31: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Outline

1 Challenges in existing attack-defence CTF gameformat and infrastructures

2 Overview of Docker and associated technologies

3 Container-based attack-defence CTF gameinfrastructure

4 Performance evaluation

5 Future work

6 Conclusion

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 31/38

Page 32: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Future work

Develop techniques and identify tuning parametersto prevent overloading of Docker daemon withseveral simultaneous requests.

Provide teams access to network traffic captures forreverse engineering exploits.

Identify parameters to determine utility of CTFgame infrastructures.

Perform usability study of container-basedinfrastructure.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 32/38

Page 33: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Outline

1 Challenges in existing attack-defence CTF gameformat and infrastructures

2 Overview of Docker and associated technologies

3 Container-based attack-defence CTF gameinfrastructure

4 Performance evaluation

5 Future work

6 Conclusion

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 33/38

Page 34: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Conclusion

Existing attack-defence CTF game infrastructuresare complex to setup and require several computingresources.

Using application containers instead of virtualmachines reduces resource requirement andengineering effort needed.

Additional tools can improve gameplay experiencefor participants and further simplify infrastructuremanagement.

https://github.com/inctf/inctf-framework.

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 34/38

Page 35: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Observations

Figure : Average memory usage: 3 services, multiple teams

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 35/38

Page 36: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Observations(cont.)

Figure : Average memory usage: 30 teams, multiple services

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 36/38

Page 37: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Observations

Figure : Average CPU usage: 3 services, multiple teams

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 37/38

Page 38: Scalable and Lightweight CTF Infrastructures Using Application … · Scalable and Lightweight CTF Infrastructures Using Application Containers Arvind S Raj, Bithin Alangot, Seshagiri

Existing game infrastructures Docker Container-based game infrastructure Evaluation Future work Conclusion

Observations(cont.)

Figure : Average CPU usage: 30 teams, multiple services

Arvind, Bithin, Seshagiri, Krishnashree — Scalable and Lightweight CTF Infrastructures Using Application Containers 38/38