ECS & Docker: Secure Async Brennan Saeta

Similar documents
Permanent IT Salaries Q Working with you to create a great recruitment experience

Enhancing Workday with BetterWorks

We make it fly. Digital Transformation in the Airspace industry powered by Internet of Things

Melanie. Persona. Hotel Manager. I need to make sure the hotel is ran efficiently and provides the services to make our guests comfortable.

How to Integrate CA SiteMinder with the Barracuda Web Application Firewall

Bonita Workflow. Getting Started BONITA WORKFLOW

Distributed Object Storage System Ceph in Practice

Installation Guide. Unisphere Central. Installation. Release number REV 07. October, 2015

Moving Towards a Customer Centric Approach. Dr. Philippe Villard Head, Policy & Economics

GROUND HANDLING COURSES Amadeus Customer Service

Navitaire GoNow Day-of-departure services

DART. Duty & Recreation Travel STAFF TRAVEL SIMPLIFIED. Straightforward, easy to use staff travel management system for the airline industry

Amadeus Airport IT Conference 2018 April 3-5 Venetian Resort & Casino Las Vegas, Nevada Event Agenda

RSA SecurID Ready Implementation Guide

Video Media Center - VMC 1000 Getting Started Guide

ICFP programming contest 2017 Lambda punter (1.3)

# 1 in ease-of-use. Guest Service Interconnectivity. Made by hoteliers, for hoteliers.

Firewall Network and Proxy Datasheet

Special edition paper Development of a Crew Schedule Data Transfer System

Airspace Infringement

Vacuum Controls and Interlocks

Pan Pacific Hotels Group rolls out Milestone IP video technology to ensure guest safety

Emerging Technologies in BPM

Scalable Runtime Support for Data-Intensive Applications on the Single-Chip Cloud Computer

AI in a SMART AIrport

NDC - One Order Pilot

Online flight bookings

Disruptive technologies and societal trends are changing everyday lives and shaking up competition across all industries

Setup and Configure the Siteminder Policy Store with Dxmanager

CA SiteMinder. Agent for JBoss Guide SP1

ACI EUROPE POSITION PAPER

MyTraveler User s Manual

Punt Policing and Monitoring

Gogo Connected Aircraft Services

Applicability / Compatibility of STPA with FAA Regulations & Guidance. First STAMP/STPA Workshop. Federal Aviation Administration

Configuring a Secure Access etrust SiteMinder Server Instance (NSM Procedure)

Real-time route planning streamlines onboard operations, reduces fuel burn and delays, and improves on-time performance.

PRIVACY POLICY KEY DEFINITIONS. Aquapark Wrocław Wrocławski Park Wodny S.A. with the registered office in Wrocław, ul. Borowska 99, Wrocław.

Introduction to Off-Airport Baggage Processing Solutions IATA GAPS application July. Service by

etrust SiteMinder Agent r5.5 for BEA WebLogic 9.0 etrust SiteMinder Agent for BEA WebLogic Guide

Official Journal of the European Union L 186/27

Total Airport Management Solution DELIVERING THE NEXT GENERATION AIRPORT

The Skyward Platform Helps You Manage UAV Operations

FINAL REPORT OF THE USOAP CMA AUDIT OF THE CIVIL AVIATION SYSTEM OF THE KINGDOM OF NORWAY

Hotel Booking System For Magento

etrust SiteMinder Agent r6.0 for IBM WebSphere

AeroCRS Keynote. AeroCRS Corporate Update Mr. Meir Hadassi Turner AeroCRS CEO

Concur Travel FAQs. 5. How do I log in to Concur Travel? Visit or the link is available on the Travel page of the Compass.

Mobile FliteDeck VFR Release Notes

Multiple Wishlists extension for Magento2. User Guide

CA SITEMINDER OVERVIEW

Incorporates passenger management, fleet management and revenue/cost reporting

Provincial Land and Resource Management Initiative

Visitor Management Plan innovative and hospitable

Amadeus Altéa Airport Link

Management System for Flight Information

Transforming Passenger Processing

THE REAL-TIME AIRLINE TAKES FLIGHT

Performance monitoring report 2017/18

The Transforming Airport

Smart Marine Ecosystem Strategy

Crosswind-based wake avoidance system approved by the FAA for operational use. Clark Lunsford (MITRE) & Dr. Edward Johnson May 15-16, 2013

making air travel smarter 2016 Resilient Ops, Inc.

Table of Content. Table of Contents Mobile Experts LLC. All Rights Reserved. 1

A Survey of Time and Space Partitioning for Space Avionics

CMS FacilitiesOps and IN2P3

Implementing OpenID for Your Social Networking Web Site

Simplifying the business of flight. ARINCDirectSM FLIGHT SOLUTIONS

September 20, RAA Coin. United Currency for RAA Delivery Service and Decentralized Payment Network

FAA NextGENProgram & NEAR Laboratory. Massood Towhidnejad, PhD Director of NEAR lab

Enabling Civilian Low-Altitude Airspace and Unmanned Aerial System (UAS) Operations. Unmanned Aerial System Traffic Management (UTM)

STAIRWAY IDS ATC SIMULATION ENVIRONMENT - SWIM COMPATIBLE SYSTEM

CA SiteMinder Federation Standalone

Performance monitoring report for 2014/15

Performance monitoring report for first half of 2015

CA SiteMinder. Agent for JBoss Guide. r12.1 SP3. Third Edition

ATPCO. Intended positioning on the market

Quickstart Guide to HIPE and the HSA

9/16/ CHG 213 VOLUME 3 GENERAL TECHNICAL ADMINISTRATION CHAPTER 61 AIRCRAFT NETWORK SECURITY PROGRAM

The World s First Robotic Digitization Company

NATIONAL AIRSPACE POLICY OF NEW ZEALAND

Integrated Applications Programme (IAP) & Space for UAS UAS for Applications

Concur Travel: Post Ticket Change Using Sabre Automated Exchanges

Progressive Technology Facilitates Ground-To-Flight-Deck Connectivity

Federal GIS Conference February 10 11, 2014 Washington DC. ArcGIS for Aviation. David Wickliffe

Table of Contents 2015 Mobile Experts LLC. All Rights Reserved. 1

Update on the Thameslink programme

UM1868. The BlueNRG and BlueNRG-MS information register (IFR) User manual. Introduction

Six Must Have Capabilities to Improve the Passenger Experience

ICAO Regional FAL Seminar Paris, France October 2014 Annex 9: Compliance Issues

What s New in VAX VacationAccess? VAX VacationAccess December 8, 2011 Enhancements Reference Guide

Tivoli/Plus for ADSM 1.0

Wishlist Auto Registration Manual

Deutscher Wetterdienst

2017 Digital Grid Customer Summit Session Abstracts

The Fly In/Fly-Out Guide

E-RECORDS. Heading towards a Paperless operation SWARAN SIDHU - HEAD OF FLEET TECHNICAL MANAGEMENT

SIMAIR: A STOCHASTIC MODEL OF AIRLINE OPERATIONS

Air Traffic Management

Price-Setting Auctions for Airport Slot Allocation: a Multi-Airport Case Study

Transcription:

ECS & Docker: Secure Async Execution @ Brennan Saeta

The Beginnings 2012 1 million learners worldwide 4 partners 10 courses

Education at Scale 18 million learners worldwide 140 partners 1,800 courses

Outline Evolution of Coursera s nearline execution systems Next-generation execution framework: Iguazú Iguazú application deep dive: GrID evaluating programming assignments

Key Takeaways What is nearline execution, and why it is useful Best practices for running containers in production in the cloud Hardening techniques for securely operating container infrastructure at scale

A history of nearline execution

Coursera Architecture (2012) PHP Monolith

Early days - Requirements Video re-encoding for distribution Grade computation for 100,000+ learners Pedagogical data exports for courses

Coursera Architecture (2012) PHP Monolith

Cascade Architecture Cascade PHP Monolith PHP Monolith

Cascade Architecture PHP Monolith Queue Cascade PHP Monolith

Upgrading to Scala Re-architecting delayed execution for our 2 nd generation learning platform.

Upgrading to the JVM Leverage mature Scala & JVM ecosystems for code sharing JVM much more reliable (no memory leaks) New job model: scheduled recurring jobs. Named: Saturn

Saturn Architecture Online Serving Scala/micro-service architecture Service A Service B Service C C* C*

Saturn Architecture Online Serving Scala/micro-service architecture Service A Saturn Service B Service C C* C*

Saturn Architecture Service B Service A Service C Saturn ZK Ensemble C* C*

Saturn Architecture Service B Service A Service C Saturn Leader ZK Ensemble C* C*

Problems with Saturn Single master meant naïve implementation ran all jobs in same JVM Huge CPU contention @ top of the hour OOM Exceptions & GC issues

Enter: Docker Containers allow for resource isolation! CC-by-2.0 https://www.flickr.com/photos/photohome_uk/1494590209

Supported Features Platform Saturn Docker Amazon ECS Iguazú Run code Resource Isolation Clusters / HA Great developer workflow Scheduled Jobs

Supported Features Platform Saturn Docker Amazon ECS Iguazú Run code Resource Isolation Clusters / HA Great developer workflow Scheduled Jobs

Supported Features Platform Saturn Docker Amazon ECS Iguazú Run code Resource Isolation Clusters / HA Great developer workflow Scheduled Jobs

Supported Features Platform Saturn Docker Amazon ECS Iguazú Run code Resource Isolation Clusters / HA Great developer workflow Scheduled Jobs

Supported Features Platform Saturn Docker Amazon ECS??? Run code Resource Isolation Clusters / HA Great developer workflow Scheduled Jobs

Solution: Iguazú Marissa Strniste (https://www.flickr.com/photos/mstrniste/5999464924) CC-BY-2.0

Solution: Iguazú Framework & service for asynchronous execution Optimized Scala developer experience for Coursera Unified scheduler supports: Immediate execution (nearline) Scheduled recurring execution (cron-like) Deferred execution (run once @ time X) Marissa Strniste (https://www.flickr.com/photos/mstrniste/5999464924) CC-BY-2.0

Iguazú Architecture ECS API Devs Iguazú Admin Iguazú Scheduler SQS Iguazú Backend Iguazú Frontend Iguazú Workers Services Services Cassandra Users

Iguazú Architecture ECS API Devs Iguazú Admin Iguazú Scheduler SQS Queue Iguazú Backend Iguazú Frontend Iguazú Workers Services Services Cassandra Users

Iguazú Architecture ECS API Devs Iguazú Admin Iguazú Scheduler SQS Queue Iguazú Backend Iguazú Frontend Iguazú Workers Services Services Cassandra Users

Iguazú Architecture ZK Ensemble ECS API Devs Iguazú Admin Iguazú Scheduler SQS Queue Iguazú Backend Iguazú Frontend Iguazú Workers Services Services Cassandra Users

Iguazú Architecture ZK Ensemble ECS API Devs Iguazú Admin Iguazú Scheduler SQS Queue Iguazú Backend Iguazú Frontend Iguazú Workers Services Services Cassandra Users

Autoscale, autoscale, autoscale!

Autoscaling Iguazú ECS Shutdown Lifecycle Notification Poll Worker Job Status Autoscaling Proceed Iguazu All finished ECS API Terminate EC2 Worker EC2 Worker EC2 Worker

Failure in Nearline Systems Most jobs are non-idempotent Iguazú: At most once execution Time-bounded delay Future: At least once execution With caveats

Iguazú adoption by the numbers ~100 jobs in production >100 different job schedules >1000 runs per day

Iguazú Applications Nearline Jobs Pedagogical Instructor Data Exports System Integrations Course Migrations Scheduled Recurring Jobs Course Reminders System Integrations Payment reconciliation Course translations Housekeeping Build artifact archival A/B Experiments

While containers may help you on your journey, they are not themselves a destination. CC-by-2.0 https://www.flickr.com/photos/usoceangov/5369581593

Writing an Iguazu Job class AbReminderJob @Inject() (abclient: AbClient, email: EmailAPI) extends AbstractJob { override val reservedcpu = 1024 // 1 CPU core override val reservedmemory = 1024 // 1 GB RAM } def run(parameters: JsValue) = { val experiments = abclient.findforgotten() logger.info(s"found ${experiments.size} forgotten experiments.") experiments.foreach { experiment => sendreminder(experiment.owners, experiment.description) } }

Writing an Iguazu Job class AbReminderJob @Inject() (abclient: AbClient, email: EmailAPI) extends AbstractJob { override val reservedcpu = 1024 // 1 CPU core override val reservedmemory = 1024 // 1 GB RAM } def run(parameters: JsValue) = { val experiments = abclient.findforgotten() logger.info(s"found ${experiments.size} forgotten experiments.") experiments.foreach { experiment => sendreminder(experiment.owners, experiment.description) } }

Writing an Iguazu Job class AbReminderJob @Inject() (abclient: AbClient, email: EmailAPI) extends AbstractJob { override val reservedcpu = 1024 // 1 CPU core override val reservedmemory = 1024 // 1 GB RAM } def run(parameters: JsValue) = { val experiments = abclient.findforgotten() logger.info(s"found ${experiments.size} forgotten experiments.") experiments.foreach { experiment => sendreminder(experiment.owners, experiment.description) } }

Writing an Iguazu Job class AbReminderJob @Inject() (abclient: AbClient, email: EmailAPI) extends AbstractJob { override val reservedcpu = 1024 // 1 CPU core override val reservedmemory = 1024 // 1 GB RAM } def run(parameters: JsValue) = { val experiments = abclient.findforgotten() logger.info(s"found ${experiments.size} forgotten experiments.") experiments.foreach { experiment => sendreminder(experiment.owners, experiment.description) } }

Writing an Iguazu Job class AbReminderJob @Inject() (abclient: AbClient, email: EmailAPI) extends AbstractJob { override val reservedcpu = 1024 // 1 CPU core override val reservedmemory = 1024 // 1 GB RAM } def run(parameters: JsValue) = { val experiments = abclient.findforgotten() logger.info(s"found ${experiments.size} forgotten experiments.") experiments.foreach { experiment => sendreminder(experiment.owners, experiment.description) } }

Testing an Iguazu job

The Hollywood Principle applies to distributed systems. CC-by-2.0 https://www.flickr.com/photos/raindog808/354080327

Deploying a new Iguazu Job Developer merge into master done Jenkins Build Steps Compile & package job JAR Prepare Docker image Pushes image into registry Register updated job with Amazon ECS API

Invoking an Iguazú Job // invoking a job with one function call // from another service via REST framework RPC val invocationid = iguazujobinvocationclient.create(iguazujobinvocationrequest( jobname = "exportquizgrades", parameters = quizparams))

A clean environment increases reliability. CC-by-2.0 https://www.flickr.com/photos/raindog808/354080327

Evaluating Programming Assignments An application of Iguazú

Design Goals Elastic Infrastructure No Maintenance Near Real-time Secure Infrastructure

Design Goals Elastic Infrastructure No Maintenance Near Real-time Secure Infrastructure

Design Goals Elastic Infrastructure No Maintenance Near Real-time Secure Infrastructure

Solution: GrID Service + framework for grading programming assignments Builds on Iguazú Named for Tron s digital frontier Backronym: Grading Inside Docker Patrick Hoesly (https://www.flickr.com/photos/zooboing/5665221326/) CC-BY-2.0

High-level GrID Architecture GrID S3 Bucket Learners VPC Firewalls Grading Machines Iguazú ECS APIs Coursera Production Account Coursera GrID Grading Account

High-level GrID Architecture GrID S3 Bucket Learners VPC Firewalls Grading Machines Iguazú ECS APIs Coursera Production Account Coursera GrID Grading Account

High-level GrID Architecture GrID S3 Bucket Learners VPC Firewalls Grading Machines Iguazú ECS API Production Acct GrID Grading Account

High-level GrID Architecture GrID S3 Bucket Learners VPC Firewalls Grading Machines Iguazú ECS API Production Acct GrID Grading Account

Design Goals Elastic Infrastructure No Maintenance Near Real-time Secure Infrastructure

Programming Assignments

The Security Challenge Compiling and running untrusted, arbitrary code on our cluster in near real time. Would you like to compile and run C code from random people on the Internet on your servers?

FROM redis FROM ubuntu:latest FROM jane s-image

Security Assumptions Run arbitrary binaries Instructor grading scripts may have vulnerabilities Grading code is untrusted Unknown vulnerabilities in Docker and Linux name-spacing and/or container implementation

Security Goals Prevent submitted code from: impacting the evaluation of other submissions. disrupting the grading environment (e.g., DoS) affecting the rest of the Coursera learning platform

Grading assignment submissions CC-by-2.0 https://www.flickr.com/photos/dherholz/4367511580/

Alice s Submission Alice s Container Grader Bob s Submission Bob s Container Grader Mallory s Submission Mallory s Container Grader Kernel RAM CPU CPU CPU CPU Disk

Alice s Submission Alice s Container Grader Bob s Submission Bob s Container Grader Mallory s Submission Mallory s Container Grader Kernel RAM CPU CPU CPU CPU Disk

Alice s Submission Alice s Container Grader Bob s Submission Bob s Container Grader Mallory s Submission Mallory s Container Grader Kernel RAM cgroups CPU cgroups CPU cgroups Disk

Alice s Submission Alice s Container Grader Bob s Submission Bob s Container Grader Mallory s Submission Mallory s Container Grader Kernel RAM cgroups CPU cgroups CPU cgroups Disk

Alice s Submission Alice s Container Grader Bob s Submission Bob s Container Grader Mallory s Submission Mallory s Container Grader Kernel RAM cgroups CPU cgroups CPU cgroups Disk blkio limits & btrfs quotas

Alice s Submission Alice s Container Grader Bob s Submission Bob s Container Grader Mallory s Submission Mallory s Container Grader Kernel RAM cgroups CPU cgroups CPU cgroups Disk blkio limits & btrfs quotas

Attacks: Kernel Resource Exhaustion Open file limits per container (nofile) nproc Process limits Limit kernel memory per cgroup Limit execution time

Alice s Submission Alice s Container Grader Bob s Submission Bob s Container Grader Mallory s Submission Mallory s Container Grader Kernel cgroups, ulimits RAM cgroups CPU cgroups CPU cgroups Disk blkio limits & btrfs quotas Network

Attacks: Network attacks Attacks: Bitcoin mining DoS attacks on other systems Access Amazon S3 and other AWS APIs Defense: Deny network access

Docker Network Modes NetworkDisabled too restrictive Some graders require local loopback Feature also deprecated --net=none + deny net_admin + audit network Isolation via Docker creating an independent network stack for each container github.com/coursera/amazon-ecs-agent

CC-by-2.0 https://www.flickr.com/photos/valentinap/253659858

CC-by-2.0 https://www.flickr.com/photos/jessicafm/2834658255/

CC-by-2.0 https://www.flickr.com/photos/donnieray/11501178306/in/photostream/

Defense in Depth Mandatory Access Control (App Armor) Allows auditing or denying access to a variety of subsystems Drop capabilities from bounding set No need for NET_BIND_SERVICE, CAP_FOWNER, MKNOD Deny root within container

Deny Root Escalations We modify instructor grader images before allowing them to be run Clears setuid Inserts C wrapper to drop privileges from root and redirect stdin/stdout/stderr Run cleaning job on another Iguazú cluster Run Docker in Docker! Docker 1.10 adds User Namespaces

If all else fails Utilizes VPC security measures to further restrict network access No public internet access Security group to restrict inbound/outbound access Network flow logs for auditing Separate AWS account Run in an Auto Scaling group Regularly terminate all grading EC2 instances

Other Security Measures Utilize AWS CloudTrail for audit logs Third-party security monitoring (Threat Stack) No one should log in, so any TTY is an alert Penetration testing by third-party red team (Synack)

Lessons Learned - GrID Building a platform for code execution is hard! Carefully monitor disk usage Run the latest kernels Latest security patches btrfs wedging on older kernels Default Ubuntu 14.04 kernel not new enough!

Reliable deploy tooling pays for itself.

Thank you! Brennan Saeta github/saeta @bsaeta saeta@coursera.org GrID lead Frank Chen github/frankchn @frankchn frankchn@coursera.org Iguazú Lead

Questions? Brennan Saeta github/saeta @bsaeta saeta@coursera.org GrID lead Frank Chen github/frankchn @frankchn frankchn@coursera.org Iguazú Lead