SlideShare une entreprise Scribd logo
1  sur  23
Télécharger pour lire hors ligne
Secure Containers with EPT Isolation
Chunyan Liu
liuchunyan9@huawei.com
Jixing Gu
jixing.gu@intel.com
Presenters
• Jixing Gu:
Software Architect, from Intel CIG SW Team, working
on secure container solution architecture design and
KVM support.
• Chunyan Liu:
Software Engineer, from Huawei Central Software
Institution, working on secure container solution
design, guest OS support and Docker tooling
integration.
2
Agenda
• Background
• Secure Container Solution
• Architecture Design
• Work Flow
• Security Cases & Demo
• Benchmark
3
Containers Stack
Infrasturcture
Host OS
Docker Engine
Bin/Libs
App1
Bin/Libs
App2
• Ease of Development/Deployment
• High performance, low overhead
• Shared kernel
• Namespace isolation
• Attack surface is large
• Namespace isolation is
weak
• Bugs in Linux kernel can
allow escape to the host
and harm other containers
Security?
Container Stack & Security
 Capability: restrict capabilities of process in container
 Seccomp: filter access to syscall
 SElinux: customize privileges for processes, users and files.
 User namespace: map ‘root’ in container to non-root user on host
 Fuse: isolate “/proc”, useful for container monitoring system.
However, it’s not enough……
Security Features Supported by Docker
CANNOT: container privilege escalation by exploiting
kernel vulnerabilities …
CAN: restrict container capabilities and privileges, reduce
chances container attacking kernel
Security Problems We Address
Problem-1:
Privilege Escalation
Container
Kernel
Attacker App
By exploiting kernel vulnerability,
like CVE-2017-6074, attackers are
able to escalate to root privilege
with ret2user
Problem-2:
Memory Data Peek
Container
Kernel
Victim App
By exploiting kernel modules, like
/dev/mem device, attackers w/ root
privilege are able to peek containers
memory data
Attacker App
$$
Our Solution: Namespace-alike Memory
Isolation w/ EPT
Protection-1:
Defeat Privilege Escalation
Container
Kernel
Attacker App
Protection-2:
Defend Memory Data Peek
Container
Kernel
Victim App Attacker App
$$
KVM KVM
KVM creates a EPT memory region to isolate container user-space memory from kernel, and
captures illegitimate cross-EPT code execution or data access behaviors with EPT violation
8
Infrastructure
Host OS (Hypervisor)
Guest OS Guest OS
Docker Engine
Bin/Libs
App
Bin/Libs
App
Docker Engine
Bin/Libs
App
Bin/Libs
App
VM1 VM2
container container container container
memory
EPT Table EPT Table
Typical User Model of Containers
9
Infrastructure
Host OS (Hypervisor)
Guest OS Guest OS
Docker Engine
Bin/Libs
App
Bin/Libs
App
Docker Engine
Bin/Libs
App
Bin/Libs
App
VM1 VM2
container container container container
memory
EPT Table EPT Table
Our Ideas To Secure Containers
EPT Table
 Extract container memory to a new EPT table, separated from VM EPT Table
 Strong EPT isolation between container and VM kernel.
Legend: Existing ComponentsSC Components
• Secure Container KVM Patch
 Extend KVM existing interfaces for secure
container
 Create EPT for new container
 Add mem page into EPT view
 Delete mem page from EPT view
• Secure Container Guest Kernel Patch
 Handle secure container creation w/ extended
interfaces from the underlying KVM
 Handle data exchange w/ extended interfaces
from KVM
• Secure Container QEMU Patch
 Support VM management interfaces
• Tiny Changes To Docker Tools
 Differentiate Secure Container from Common
Container
Container 1 Container 2
Docker Tools
EPT1 EPT2
Guest OSGuest Kernel Patch
Hypervisor ( KVM/QEMU & Host OS )
KVM Patch
Secure Container Solution
QEMU Patch
Server HW System
Intel VT Hardware
Secure Container Solution Includes:
Secure Container SW Stack Up
VM
Typical Usage Scenarios
Private Cloud:
Isolate containers in a single shared guest OS
Infrastructure
Hypervisor(KVM & Host OS)
Guest OS
Container
EPT-1
Container
EPT-N
Public Cloud:
Isolate containers from same tenant &
leverage VM to isolate between tenants
Infrastructure
Hypervisor(KVM & Host OS)
Guest OS
Container
EPT-1
Container
EPT-N
Container
EPT-1
Container
EPT-N
Guest OS
VM-1 (for one tenant) VM-N (for one tenant)
Secure Container Arch and Data Flow
Secure Container Interfaces Calling Flow
Kernel to User Condition
- Violation happens under view 0
- VM’s CPL = 3
- RIP from user
- GVA from user space
- Page is present in specific user
view
User to Kernel Condition
- Violation happens under user
view
- VM’s CPL = 0
- RIP from kernel space
- GVA from kernel space
New page in current user
view Condition
- Requested page is not used by
other user views
- Requested page GVA is in user
space
EPT Violation Flow – Switch View & Add Page
• Delete Page is to delete
all access permission for a
specific page from an EPT
view.
• It entails a page free from
guest kernel.
• EPT violation handles a
delayed page deletion in
hypervisor.
• Hypervisor will erase all
the data before deleting a
page.
EPT Violation Flow – Delete Page
• Pages in file cache may
be shared across
containers.
• Hypervisor records
share page status.
• Shared pages shall be
granted to access by
different containers.
• Share pages should be
created per EPT view.
EPT Violation Flow – Share Page
struct task_struct {
……
bool sc_flag; // if true, indicate the task is in a secure container.
……
};
int data_exchange(struct data_ex_cfg *cfg, uint64_t size)
{
if (current->sc_flag == false) { return 1; }
……
//Transfer struct data_ex_cfg to hypervisor through hyper call.
HyperCall( KVM_HC_SC, HC_DATA_EXCHANGE, cfg,
sizeof(struct data_ex_cfg) );
……
}
Data Exchange between user/kernel space
Pseudo Code
Optimization: VMFUNC Switch EPT View
• Use VMFUNC in places that need to switch view (e.g. syscall)
Note:
1. Kernel trigger user space execution code;
2. CPL (current privilege level) is ring 0;
3. Privilege escalation succeeds;
Security Case: CVE-2017-6074 ret2user Attack
Note:
1. EPT violation happens while kernel trying to execute user space code because kernel space and user space are
isolated in different EPT views;
2. KVM checks CPL (current privilege level) is ring 0, and concludes it is not a reasonable system call return and
rejects the operation. (CPL should be ring 3 for normal syscall_return);
3. Even SMAP and SMEP were both disabled, secure container can prevent the privilege escalation;
Security Case: CVE-2017-6074 ret2user Attack
Demo Time
Benchmark
SC vs CC Overhead Notes
Boot time 555ms vs 481 ms (~15%)
Memory footprint ≈
Host memory has little overhead to
manage more EPT tables
CPU Performance ≈
Memory Performance ≈
Storage IO 18%~26%
Optimization focus (VMFUNC result
not updated)
Network IO 28%~30%
Optimization focus (VMFUNC result
not updated)
• Current data:
• Next Step:
1. Use VMFUNC to reduce switch view VMEXIT/VMENTRY overhead
2. Improve DataExchange performance by reducing VMCALL times
Thank you!
23

Contenu connexe

Tendances

Rebuild - Simplifying Embedded and IoT Development Using Linux Containers
Rebuild - Simplifying Embedded and IoT Development Using Linux ContainersRebuild - Simplifying Embedded and IoT Development Using Linux Containers
Rebuild - Simplifying Embedded and IoT Development Using Linux ContainersLinuxCon ContainerCon CloudOpen China
 
IP Virtual Server(IPVS) 101
IP Virtual Server(IPVS) 101IP Virtual Server(IPVS) 101
IP Virtual Server(IPVS) 101HungWei Chiu
 
Unikernels: the rise of the library hypervisor in MirageOS
Unikernels: the rise of the library hypervisor in MirageOSUnikernels: the rise of the library hypervisor in MirageOS
Unikernels: the rise of the library hypervisor in MirageOSDocker, Inc.
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance AnalysisBrendan Gregg
 
Live Container Migration: OpenStack Summit Barcelona 2016
Live Container Migration: OpenStack Summit Barcelona 2016Live Container Migration: OpenStack Summit Barcelona 2016
Live Container Migration: OpenStack Summit Barcelona 2016Phil Estes
 
runC: The little engine that could (run Docker containers) by Docker Captain ...
runC: The little engine that could (run Docker containers) by Docker Captain ...runC: The little engine that could (run Docker containers) by Docker Captain ...
runC: The little engine that could (run Docker containers) by Docker Captain ...Docker, Inc.
 
K8s storage-glusterfs-20180210
K8s storage-glusterfs-20180210K8s storage-glusterfs-20180210
K8s storage-glusterfs-20180210Che-Chia Chang
 
Docker Orchestration at Production Scale
Docker Orchestration at Production Scale Docker Orchestration at Production Scale
Docker Orchestration at Production Scale Docker, Inc.
 
Containers in production with Docker, CoreOS, Kubernetes and Apache Stratos
Containers in production with Docker, CoreOS, Kubernetes and Apache StratosContainers in production with Docker, CoreOS, Kubernetes and Apache Stratos
Containers in production with Docker, CoreOS, Kubernetes and Apache StratosLakmal Warusawithana
 
Kubernetes Introduction & Whats new in Kubernetes 1.6
Kubernetes Introduction & Whats new in Kubernetes 1.6Kubernetes Introduction & Whats new in Kubernetes 1.6
Kubernetes Introduction & Whats new in Kubernetes 1.6Opcito Technologies
 
Global Operations with Docker Enterprise
Global Operations with Docker EnterpriseGlobal Operations with Docker Enterprise
Global Operations with Docker EnterpriseNicola Kabar
 
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Etsuji Nakai
 

Tendances (20)

UEFI HTTP/HTTPS Boot
UEFI HTTP/HTTPS BootUEFI HTTP/HTTPS Boot
UEFI HTTP/HTTPS Boot
 
Get a Taste of 1 k+ Nodes by a Handful of Servers
Get a Taste of 1 k+ Nodes by a Handful of Servers Get a Taste of 1 k+ Nodes by a Handful of Servers
Get a Taste of 1 k+ Nodes by a Handful of Servers
 
Simplify Networking for Containers
Simplify Networking for ContainersSimplify Networking for Containers
Simplify Networking for Containers
 
Introduction to OCI Image Technologies Serving Container
Introduction to OCI Image Technologies Serving ContainerIntroduction to OCI Image Technologies Serving Container
Introduction to OCI Image Technologies Serving Container
 
Rebuild - Simplifying Embedded and IoT Development Using Linux Containers
Rebuild - Simplifying Embedded and IoT Development Using Linux ContainersRebuild - Simplifying Embedded and IoT Development Using Linux Containers
Rebuild - Simplifying Embedded and IoT Development Using Linux Containers
 
IP Virtual Server(IPVS) 101
IP Virtual Server(IPVS) 101IP Virtual Server(IPVS) 101
IP Virtual Server(IPVS) 101
 
Unikernels: the rise of the library hypervisor in MirageOS
Unikernels: the rise of the library hypervisor in MirageOSUnikernels: the rise of the library hypervisor in MirageOS
Unikernels: the rise of the library hypervisor in MirageOS
 
Rethinking the OS
Rethinking the OSRethinking the OS
Rethinking the OS
 
Container Performance Analysis
Container Performance AnalysisContainer Performance Analysis
Container Performance Analysis
 
Live Container Migration: OpenStack Summit Barcelona 2016
Live Container Migration: OpenStack Summit Barcelona 2016Live Container Migration: OpenStack Summit Barcelona 2016
Live Container Migration: OpenStack Summit Barcelona 2016
 
runC: The little engine that could (run Docker containers) by Docker Captain ...
runC: The little engine that could (run Docker containers) by Docker Captain ...runC: The little engine that could (run Docker containers) by Docker Captain ...
runC: The little engine that could (run Docker containers) by Docker Captain ...
 
IITCC15: Xen Project 4.6 Update
IITCC15: Xen Project 4.6 UpdateIITCC15: Xen Project 4.6 Update
IITCC15: Xen Project 4.6 Update
 
K8s storage-glusterfs-20180210
K8s storage-glusterfs-20180210K8s storage-glusterfs-20180210
K8s storage-glusterfs-20180210
 
Docker Orchestration at Production Scale
Docker Orchestration at Production Scale Docker Orchestration at Production Scale
Docker Orchestration at Production Scale
 
Containers in production with Docker, CoreOS, Kubernetes and Apache Stratos
Containers in production with Docker, CoreOS, Kubernetes and Apache StratosContainers in production with Docker, CoreOS, Kubernetes and Apache Stratos
Containers in production with Docker, CoreOS, Kubernetes and Apache Stratos
 
Kubernetes networks
Kubernetes networksKubernetes networks
Kubernetes networks
 
The Open vSwitch and OVN Projects
The Open vSwitch and OVN ProjectsThe Open vSwitch and OVN Projects
The Open vSwitch and OVN Projects
 
Kubernetes Introduction & Whats new in Kubernetes 1.6
Kubernetes Introduction & Whats new in Kubernetes 1.6Kubernetes Introduction & Whats new in Kubernetes 1.6
Kubernetes Introduction & Whats new in Kubernetes 1.6
 
Global Operations with Docker Enterprise
Global Operations with Docker EnterpriseGlobal Operations with Docker Enterprise
Global Operations with Docker Enterprise
 
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
 

En vedette

点融网区块链即服务实践 - The Practice of Blockchain as a Service in Dianrong
点融网区块链即服务实践 - The Practice of Blockchain as a Service in Dianrong点融网区块链即服务实践 - The Practice of Blockchain as a Service in Dianrong
点融网区块链即服务实践 - The Practice of Blockchain as a Service in DianrongLinuxCon ContainerCon CloudOpen China
 
High Performance Linux Virtual Machine on Microsoft Azure: SR-IOV Networking ...
High Performance Linux Virtual Machine on Microsoft Azure: SR-IOV Networking ...High Performance Linux Virtual Machine on Microsoft Azure: SR-IOV Networking ...
High Performance Linux Virtual Machine on Microsoft Azure: SR-IOV Networking ...LinuxCon ContainerCon CloudOpen China
 
See what happened with real time kvm when building real time cloud pezhang@re...
See what happened with real time kvm when building real time cloud pezhang@re...See what happened with real time kvm when building real time cloud pezhang@re...
See what happened with real time kvm when building real time cloud pezhang@re...LinuxCon ContainerCon CloudOpen China
 

En vedette (19)

Building a Better Thermostat
Building a Better ThermostatBuilding a Better Thermostat
Building a Better Thermostat
 
Obstacles & Solutions for Livepatch Support on ARM64 Architecture
Obstacles & Solutions for Livepatch Support on ARM64 ArchitectureObstacles & Solutions for Livepatch Support on ARM64 Architecture
Obstacles & Solutions for Livepatch Support on ARM64 Architecture
 
LiteOS
LiteOS LiteOS
LiteOS
 
Hyperledger Technical Community in China.
Hyperledger Technical Community in China. Hyperledger Technical Community in China.
Hyperledger Technical Community in China.
 
OpenStack on AArch64
OpenStack on AArch64OpenStack on AArch64
OpenStack on AArch64
 
Linuxcon secureefficientcontainerimagemanagementharbor
Linuxcon secureefficientcontainerimagemanagementharborLinuxcon secureefficientcontainerimagemanagementharbor
Linuxcon secureefficientcontainerimagemanagementharbor
 
OpenDaylight OpenStack Integration
OpenDaylight OpenStack IntegrationOpenDaylight OpenStack Integration
OpenDaylight OpenStack Integration
 
点融网区块链即服务实践 - The Practice of Blockchain as a Service in Dianrong
点融网区块链即服务实践 - The Practice of Blockchain as a Service in Dianrong点融网区块链即服务实践 - The Practice of Blockchain as a Service in Dianrong
点融网区块链即服务实践 - The Practice of Blockchain as a Service in Dianrong
 
Practical CNI
Practical CNIPractical CNI
Practical CNI
 
kdump: usage and_internals
kdump: usage and_internalskdump: usage and_internals
kdump: usage and_internals
 
Releasing a Distribution in the Age of DevOps.
Releasing a Distribution in the Age of DevOps. Releasing a Distribution in the Age of DevOps.
Releasing a Distribution in the Age of DevOps.
 
High Performance Linux Virtual Machine on Microsoft Azure: SR-IOV Networking ...
High Performance Linux Virtual Machine on Microsoft Azure: SR-IOV Networking ...High Performance Linux Virtual Machine on Microsoft Azure: SR-IOV Networking ...
High Performance Linux Virtual Machine on Microsoft Azure: SR-IOV Networking ...
 
GPU Acceleration for Containers on Intel Processor Graphics
GPU Acceleration for Containers on Intel Processor GraphicsGPU Acceleration for Containers on Intel Processor Graphics
GPU Acceleration for Containers on Intel Processor Graphics
 
Libvirt API Certification
Libvirt API CertificationLibvirt API Certification
Libvirt API Certification
 
Zephyr: Creating a Best-of-Breed, Secure RTOS for IoT
Zephyr: Creating a Best-of-Breed, Secure RTOS for IoTZephyr: Creating a Best-of-Breed, Secure RTOS for IoT
Zephyr: Creating a Best-of-Breed, Secure RTOS for IoT
 
See what happened with real time kvm when building real time cloud pezhang@re...
See what happened with real time kvm when building real time cloud pezhang@re...See what happened with real time kvm when building real time cloud pezhang@re...
See what happened with real time kvm when building real time cloud pezhang@re...
 
Make Accelerator Pluggable for Container Engine
Make Accelerator Pluggable for Container EngineMake Accelerator Pluggable for Container Engine
Make Accelerator Pluggable for Container Engine
 
From Resilient to Antifragile Chaos Engineering Primer
From Resilient to Antifragile Chaos Engineering PrimerFrom Resilient to Antifragile Chaos Engineering Primer
From Resilient to Antifragile Chaos Engineering Primer
 
Open Source Software Business Models Redux
Open Source Software Business Models ReduxOpen Source Software Business Models Redux
Open Source Software Business Models Redux
 

Similaire à Secure Containers with EPT Isolation

XPDS14 - Zero-Footprint Guest Memory Introspection from Xen - Mihai Dontu, Bi...
XPDS14 - Zero-Footprint Guest Memory Introspection from Xen - Mihai Dontu, Bi...XPDS14 - Zero-Footprint Guest Memory Introspection from Xen - Mihai Dontu, Bi...
XPDS14 - Zero-Footprint Guest Memory Introspection from Xen - Mihai Dontu, Bi...The Linux Foundation
 
Bridging the Semantic Gap in Virtualized Environment
Bridging the Semantic Gap in Virtualized EnvironmentBridging the Semantic Gap in Virtualized Environment
Bridging the Semantic Gap in Virtualized EnvironmentAndy Lee
 
Container & kubernetes
Container & kubernetesContainer & kubernetes
Container & kubernetesTed Jung
 
Containers and workload security an overview
Containers and workload security an overview Containers and workload security an overview
Containers and workload security an overview Krishna-Kumar
 
Review of Hardware based solutions for trusted cloud computing.pptx
Review of Hardware based solutions for trusted cloud computing.pptxReview of Hardware based solutions for trusted cloud computing.pptx
Review of Hardware based solutions for trusted cloud computing.pptxssusere142fe
 
Fosdem 18: Securing embedded Systems using Virtualization
Fosdem 18: Securing embedded Systems using VirtualizationFosdem 18: Securing embedded Systems using Virtualization
Fosdem 18: Securing embedded Systems using VirtualizationThe Linux Foundation
 
Revolutionizing the cloud with container virtualization
Revolutionizing the cloud with container virtualizationRevolutionizing the cloud with container virtualization
Revolutionizing the cloud with container virtualizationWSO2
 
Linux container & docker
Linux container & dockerLinux container & docker
Linux container & dockerejlp12
 
DockerCon SF 2015: Docker Security
DockerCon SF 2015: Docker SecurityDockerCon SF 2015: Docker Security
DockerCon SF 2015: Docker SecurityDocker, Inc.
 
Lightweight Virtualization in Linux
Lightweight Virtualization in LinuxLightweight Virtualization in Linux
Lightweight Virtualization in LinuxSadegh Dorri N.
 
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...Odinot Stanislas
 
Networking in Docker EE 2.0 with Kubernetes and Swarm
Networking in Docker EE 2.0 with Kubernetes and SwarmNetworking in Docker EE 2.0 with Kubernetes and Swarm
Networking in Docker EE 2.0 with Kubernetes and SwarmAbhinandan P.b
 
Networking in docker ee with kubernetes and swarm
Networking in docker ee with kubernetes and swarmNetworking in docker ee with kubernetes and swarm
Networking in docker ee with kubernetes and swarmDocker, Inc.
 
Unikernels: Rise of the Library Hypervisor
Unikernels: Rise of the Library HypervisorUnikernels: Rise of the Library Hypervisor
Unikernels: Rise of the Library HypervisorAnil Madhavapeddy
 
The State of Kubernetes Security
The State of Kubernetes Security The State of Kubernetes Security
The State of Kubernetes Security Jimmy Mesta
 
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)Amazon Web Services
 
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)Amazon Web Services
 

Similaire à Secure Containers with EPT Isolation (20)

Dockers zero to hero
Dockers zero to heroDockers zero to hero
Dockers zero to hero
 
XPDS14 - Zero-Footprint Guest Memory Introspection from Xen - Mihai Dontu, Bi...
XPDS14 - Zero-Footprint Guest Memory Introspection from Xen - Mihai Dontu, Bi...XPDS14 - Zero-Footprint Guest Memory Introspection from Xen - Mihai Dontu, Bi...
XPDS14 - Zero-Footprint Guest Memory Introspection from Xen - Mihai Dontu, Bi...
 
Bridging the Semantic Gap in Virtualized Environment
Bridging the Semantic Gap in Virtualized EnvironmentBridging the Semantic Gap in Virtualized Environment
Bridging the Semantic Gap in Virtualized Environment
 
Container & kubernetes
Container & kubernetesContainer & kubernetes
Container & kubernetes
 
Containers and workload security an overview
Containers and workload security an overview Containers and workload security an overview
Containers and workload security an overview
 
Review of Hardware based solutions for trusted cloud computing.pptx
Review of Hardware based solutions for trusted cloud computing.pptxReview of Hardware based solutions for trusted cloud computing.pptx
Review of Hardware based solutions for trusted cloud computing.pptx
 
Fosdem 18: Securing embedded Systems using Virtualization
Fosdem 18: Securing embedded Systems using VirtualizationFosdem 18: Securing embedded Systems using Virtualization
Fosdem 18: Securing embedded Systems using Virtualization
 
Revolutionizing the cloud with container virtualization
Revolutionizing the cloud with container virtualizationRevolutionizing the cloud with container virtualization
Revolutionizing the cloud with container virtualization
 
Linux container & docker
Linux container & dockerLinux container & docker
Linux container & docker
 
Os file
Os fileOs file
Os file
 
DockerCon SF 2015: Docker Security
DockerCon SF 2015: Docker SecurityDockerCon SF 2015: Docker Security
DockerCon SF 2015: Docker Security
 
Lightweight Virtualization in Linux
Lightweight Virtualization in LinuxLightweight Virtualization in Linux
Lightweight Virtualization in Linux
 
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
Bare-metal, Docker Containers, and Virtualization: The Growing Choices for Cl...
 
The State of Linux Containers
The State of Linux ContainersThe State of Linux Containers
The State of Linux Containers
 
Networking in Docker EE 2.0 with Kubernetes and Swarm
Networking in Docker EE 2.0 with Kubernetes and SwarmNetworking in Docker EE 2.0 with Kubernetes and Swarm
Networking in Docker EE 2.0 with Kubernetes and Swarm
 
Networking in docker ee with kubernetes and swarm
Networking in docker ee with kubernetes and swarmNetworking in docker ee with kubernetes and swarm
Networking in docker ee with kubernetes and swarm
 
Unikernels: Rise of the Library Hypervisor
Unikernels: Rise of the Library HypervisorUnikernels: Rise of the Library Hypervisor
Unikernels: Rise of the Library Hypervisor
 
The State of Kubernetes Security
The State of Kubernetes Security The State of Kubernetes Security
The State of Kubernetes Security
 
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
 
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
 

Plus de LinuxCon ContainerCon CloudOpen China (7)

SecurityPI - Hardening your IoT endpoints in Home.
SecurityPI - Hardening your IoT endpoints in Home. SecurityPI - Hardening your IoT endpoints in Home.
SecurityPI - Hardening your IoT endpoints in Home.
 
Flowchain: A case study on building a Blockchain for the IoT
Flowchain: A case study on building a Blockchain for the IoTFlowchain: A case study on building a Blockchain for the IoT
Flowchain: A case study on building a Blockchain for the IoT
 
OCI Support in Mesos
OCI Support in MesosOCI Support in Mesos
OCI Support in Mesos
 
How Open Source Communities do Standardization
How Open Source Communities do StandardizationHow Open Source Communities do Standardization
How Open Source Communities do Standardization
 
Fully automated kubernetes deployment and management
Fully automated kubernetes deployment and managementFully automated kubernetes deployment and management
Fully automated kubernetes deployment and management
 
Container Security
Container SecurityContainer Security
Container Security
 
Quickly Debug VM Failures in OpenStack
Quickly Debug VM Failures in OpenStackQuickly Debug VM Failures in OpenStack
Quickly Debug VM Failures in OpenStack
 

Dernier

%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Hararemasabamasaba
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile EnvironmentVictorSzoltysek
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 

Dernier (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT  - Elevating Productivity in Today's Agile EnvironmentHarnessing ChatGPT  - Elevating Productivity in Today's Agile Environment
Harnessing ChatGPT - Elevating Productivity in Today's Agile Environment
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 

Secure Containers with EPT Isolation

  • 1. Secure Containers with EPT Isolation Chunyan Liu liuchunyan9@huawei.com Jixing Gu jixing.gu@intel.com
  • 2. Presenters • Jixing Gu: Software Architect, from Intel CIG SW Team, working on secure container solution architecture design and KVM support. • Chunyan Liu: Software Engineer, from Huawei Central Software Institution, working on secure container solution design, guest OS support and Docker tooling integration. 2
  • 3. Agenda • Background • Secure Container Solution • Architecture Design • Work Flow • Security Cases & Demo • Benchmark 3
  • 4. Containers Stack Infrasturcture Host OS Docker Engine Bin/Libs App1 Bin/Libs App2 • Ease of Development/Deployment • High performance, low overhead • Shared kernel • Namespace isolation • Attack surface is large • Namespace isolation is weak • Bugs in Linux kernel can allow escape to the host and harm other containers Security? Container Stack & Security
  • 5.  Capability: restrict capabilities of process in container  Seccomp: filter access to syscall  SElinux: customize privileges for processes, users and files.  User namespace: map ‘root’ in container to non-root user on host  Fuse: isolate “/proc”, useful for container monitoring system. However, it’s not enough…… Security Features Supported by Docker CANNOT: container privilege escalation by exploiting kernel vulnerabilities … CAN: restrict container capabilities and privileges, reduce chances container attacking kernel
  • 6. Security Problems We Address Problem-1: Privilege Escalation Container Kernel Attacker App By exploiting kernel vulnerability, like CVE-2017-6074, attackers are able to escalate to root privilege with ret2user Problem-2: Memory Data Peek Container Kernel Victim App By exploiting kernel modules, like /dev/mem device, attackers w/ root privilege are able to peek containers memory data Attacker App $$
  • 7. Our Solution: Namespace-alike Memory Isolation w/ EPT Protection-1: Defeat Privilege Escalation Container Kernel Attacker App Protection-2: Defend Memory Data Peek Container Kernel Victim App Attacker App $$ KVM KVM KVM creates a EPT memory region to isolate container user-space memory from kernel, and captures illegitimate cross-EPT code execution or data access behaviors with EPT violation
  • 8. 8 Infrastructure Host OS (Hypervisor) Guest OS Guest OS Docker Engine Bin/Libs App Bin/Libs App Docker Engine Bin/Libs App Bin/Libs App VM1 VM2 container container container container memory EPT Table EPT Table Typical User Model of Containers
  • 9. 9 Infrastructure Host OS (Hypervisor) Guest OS Guest OS Docker Engine Bin/Libs App Bin/Libs App Docker Engine Bin/Libs App Bin/Libs App VM1 VM2 container container container container memory EPT Table EPT Table Our Ideas To Secure Containers EPT Table  Extract container memory to a new EPT table, separated from VM EPT Table  Strong EPT isolation between container and VM kernel.
  • 10. Legend: Existing ComponentsSC Components • Secure Container KVM Patch  Extend KVM existing interfaces for secure container  Create EPT for new container  Add mem page into EPT view  Delete mem page from EPT view • Secure Container Guest Kernel Patch  Handle secure container creation w/ extended interfaces from the underlying KVM  Handle data exchange w/ extended interfaces from KVM • Secure Container QEMU Patch  Support VM management interfaces • Tiny Changes To Docker Tools  Differentiate Secure Container from Common Container Container 1 Container 2 Docker Tools EPT1 EPT2 Guest OSGuest Kernel Patch Hypervisor ( KVM/QEMU & Host OS ) KVM Patch Secure Container Solution QEMU Patch Server HW System Intel VT Hardware Secure Container Solution Includes: Secure Container SW Stack Up VM
  • 11. Typical Usage Scenarios Private Cloud: Isolate containers in a single shared guest OS Infrastructure Hypervisor(KVM & Host OS) Guest OS Container EPT-1 Container EPT-N Public Cloud: Isolate containers from same tenant & leverage VM to isolate between tenants Infrastructure Hypervisor(KVM & Host OS) Guest OS Container EPT-1 Container EPT-N Container EPT-1 Container EPT-N Guest OS VM-1 (for one tenant) VM-N (for one tenant)
  • 12. Secure Container Arch and Data Flow
  • 14. Kernel to User Condition - Violation happens under view 0 - VM’s CPL = 3 - RIP from user - GVA from user space - Page is present in specific user view User to Kernel Condition - Violation happens under user view - VM’s CPL = 0 - RIP from kernel space - GVA from kernel space New page in current user view Condition - Requested page is not used by other user views - Requested page GVA is in user space EPT Violation Flow – Switch View & Add Page
  • 15. • Delete Page is to delete all access permission for a specific page from an EPT view. • It entails a page free from guest kernel. • EPT violation handles a delayed page deletion in hypervisor. • Hypervisor will erase all the data before deleting a page. EPT Violation Flow – Delete Page
  • 16. • Pages in file cache may be shared across containers. • Hypervisor records share page status. • Shared pages shall be granted to access by different containers. • Share pages should be created per EPT view. EPT Violation Flow – Share Page
  • 17. struct task_struct { …… bool sc_flag; // if true, indicate the task is in a secure container. …… }; int data_exchange(struct data_ex_cfg *cfg, uint64_t size) { if (current->sc_flag == false) { return 1; } …… //Transfer struct data_ex_cfg to hypervisor through hyper call. HyperCall( KVM_HC_SC, HC_DATA_EXCHANGE, cfg, sizeof(struct data_ex_cfg) ); …… } Data Exchange between user/kernel space Pseudo Code
  • 18. Optimization: VMFUNC Switch EPT View • Use VMFUNC in places that need to switch view (e.g. syscall)
  • 19. Note: 1. Kernel trigger user space execution code; 2. CPL (current privilege level) is ring 0; 3. Privilege escalation succeeds; Security Case: CVE-2017-6074 ret2user Attack
  • 20. Note: 1. EPT violation happens while kernel trying to execute user space code because kernel space and user space are isolated in different EPT views; 2. KVM checks CPL (current privilege level) is ring 0, and concludes it is not a reasonable system call return and rejects the operation. (CPL should be ring 3 for normal syscall_return); 3. Even SMAP and SMEP were both disabled, secure container can prevent the privilege escalation; Security Case: CVE-2017-6074 ret2user Attack
  • 22. Benchmark SC vs CC Overhead Notes Boot time 555ms vs 481 ms (~15%) Memory footprint ≈ Host memory has little overhead to manage more EPT tables CPU Performance ≈ Memory Performance ≈ Storage IO 18%~26% Optimization focus (VMFUNC result not updated) Network IO 28%~30% Optimization focus (VMFUNC result not updated) • Current data: • Next Step: 1. Use VMFUNC to reduce switch view VMEXIT/VMENTRY overhead 2. Improve DataExchange performance by reducing VMCALL times