Making the LSM available to containers FOSDEM18

Slides:



Advertisements
Similar presentations
The Simplified Mandatory Access Control Kernel
Advertisements

Lightweight virtual system mechanism Gao feng
Performance Evaluation of Open Virtual Routers M.Siraj Rathore
Ethernet and switches selected topics 1. Agenda Scaling ethernet infrastructure VLANs 2.
Chapter 9 Building a Secure Operating System for Linux.
Q and A, Ch. 21 IS333, Spring 2015 Victor Norman.
ADVANCED LINUX SECURITY. Abstract : Using mandatory access control greatly increases the security of an operating system. SELinux, which is an implementation.
Security-Enhanced Linux & Linux Security Module The George Washington University CS297 Programming Language & Security YU-HAO HU.
Troubleshooting Guide for Network Hard Disk. Model - NH-200.
Secure Operating Systems
SELinux US/Fedora/13/html/Security-Enhanced_Linux/
Security Enhanced Linux David Quigley. History SELinux Timeline 1985:LOCK (early Type Enforcement) 1990: DTMach / DTOS 1995: Utah Fluke / Flask 1999:
1 Implementation of Security-Enhanced Linux Yue Cui Xiang Sha Li Song CMSC 691X Project 2—Summer 02.
Design and Implementation of a Multi-Channel Multi-Interface Network Chandrakanth Chereddi Pradeep Kyasanur Nitin H. Vaidya University of Illinois at Urbana-Champaign.
…using Git/Tortoise Git
ADV. NETWORK SECURITY CODY WATSON What’s in Your Dongle and Bank Account? Mandatory and Discretionary Protections of External Resources.
Android Security Model that Provide a Base Operating System Presented: Hayder Abdulhameed.
Example: object diagram for Scheduler, v What is wrong with this diagram? Seems like a lot of similarity between Task and UnplannedTask Can use.
® A Proposed UML Profile For EXPRESS David Price Seattle ISO STEP Meeting October 2004.
David Orchard W3C Lead BEA Systems Web service and XML Extensibility and Versioning.
Chapter 4 Version 1 Virtual LANs. Introduction By default, switches forward broadcasts, this means that all segments connected to a switch are in one.
Kevin Goodman CEO FSLogix Deep Dive 2014 Extend Your Existing Application Virtualization Solution with FSLogix Apps™
1 Linux Security Module: General Security Support for the Linux Kernel Presented by Chao-Sheng Lin 2005/11/1.
Security-Enhanced Linux Stephanie Stelling Center for Information Security Department of Computer Science University of Tulsa, Tulsa, OK
Q and A, Ch. 21 IS333, Spring 2016 Victor Norman.
Constructive Rants Plone Symposium 2013: Oshkosh Alan Runyan June 5, 2013.
File systems – Unix based Mostly…. Before We Start… What can you conclude from this (recent) lab output? run: Loop iteration number 0 Trying to lock lockA.
20/09/2013 HEPUNION FILE SYSTEM SAKET SINHA Mentors- Loic Brarda Pierre Schweitzer.
Linux Kernel Security (SELinux vs AppArmor vs Grsecurity)
SELinux Overview Dan Walsh SELinux for Dummies Dan Walsh
Solaris containers (Zones) Server virtualization What zones are and how they are used in ECE/CIS at the University of Delaware Ben Miller.
UNICORE and Argus integration Krzysztof Benedyczak ICM / UNICORE Security PT.
SE Linux Implementation Russell Coker. What is SE Linux? A system for Mandatory Access Control (MAC) based on the Linux Security Modules (LSM) framework.
April, 2010Oren Laadan, Columbia University 1 Network Migration in Linux Oren Laadan
OpenShift & SELinux Dan Walsh Twitter: #rhatdan
Disk Cache Main memory buffer contains most recently accessed disk sectors Cache is organized by blocks, block size = sector’s A hash table is used to.
GNU and Linux.
Secure Operating System
A Quick Tour of Ceedo Safe Browsing and Remote Access Protection.
Seamless Guest OS's and more!
Welcome! To the ETS – Create Client Account & Maintenance
Names and Attributes Names are a key programming language feature
Chapter 14: System Protection
Containers: The new network endpoint
The Architecture of oVirt Node
Linux Containers Overview & Roadmap
Secure Operating System Example: SELinux
Introduction to .NET Core
Some Real Problem What if a program needs more memory than the machine has? even if individual programs fit in memory, how can we run multiple programs?
Supporting the gLite release process
AppArmor LSM Update Introduce self John Johansen.
AppArmor Update 2014 Linux Security Summit
AppArmor Update 2015 Linux Security Summit
SE Linux Implementation
Magento Technical Guidelines Eugene Shakhsuvarov, Software Magento
Vulnerability Scanning With 'lynis'
Introduction to Computers
SELinux RHEL5: A benchmark
Introduction to the Kernel and Device Drivers
IS3440 Linux Security Unit 6 Using Layered Security for Access Control
August 17, 2015 J. Boles, J.Burnias and M.Garcia Office 2013
The Dirty Business of Auditing
Database Implementation Issues
CTI Specification Organization
CSE 451: Operating Systems Winter 2011 Processes
Object Oriented Programming
Windows Virtual PC / Hyper-V
Module 3 Using Linux.
FILS Frame Content Date: Authors: February 2008
Database Implementation Issues
Presentation transcript:

Making the LSM available to containers FOSDEM18 Presentation by John Johansen john.johansen@canonical.com www.canonical.com February 2018

Linux Security Modules (LSM) Provide Security - Often MAC but not necessarily Kernel provides security Hooks Security field in various objects selinux, smack, apparmor, tomoyo, IMA/EVM, loadpin, yama proposed: LSMs: LandLock, CaitSith, Checmate, HardChroot, PTAGS, SimpleFlow, SafeName, WhiteEgret, shebang, S.A.R.A. - what is the LSM - an infrastructure to provide security in linux - lots of none MAC LSMs

The LSM is not namespaced And doesn’t want to be Problem The LSM is not namespaced And doesn’t want to be Container gets system LSM System Container - can’t change LSM - can’t change policy/rules - effectively boot no LSM App Container - can’t carry an LSM policy - eg. snappy fedora/RHEL – selinux ubuntu/suse - apparmor

The LSM is not namespaced and doesn’t want to be Problem The LSM is not namespaced and doesn’t want to be - at least not in the traditional sense - its keeping the system safe by restricting what the container can do to the system - not every LSM has the same reqs system vs. app confinement… - container system must work with it - any “namespacing” must apply system rules

Have multiple LSMs enforcing at the same time LSM Stacking Have multiple LSMs enforcing at the same time So how do we fix - Seems simple enough

Have multiple LSMs enforcing at the same time LSM Stacking Have multiple LSMs enforcing at the same time Minor LSM stacking merge in 4.2 And the kernel already supports stacking! - limitations only 1 major LSM - major = store state in security blob Can have - selinux + yama Or - smack + yama - apparmor + yama But not Selinux and Smack ...

Have multiple LSMs enforcing at the same time LSM Stacking Have multiple LSMs enforcing at the same time Minor LSM stacking merge in 4.2 Major LSM stacking Move security blob management into the infrastructure Casey Schaufler has been working on improving stacking - move security blobs into the infrastructure - get rid of the major/minor distinction

Problem Its not that simple Container gets system LSM System Container - can’t change LSM - can’t change policy/rules - effectively boot no LSM App Container - can’t carry an LSM policy - eg. snappy fedora/RHEL – selinux ubuntu/suse - apparmor

Kernel infrastructure not designed for sharing More Problems Kernel infrastructure not designed for sharing LSM infrastructure isn’t the only problem

Virtualize – per task default LSM More Problems Kernel infrastructure not designed for sharing Problem Userspace Interfaces /proc/pid/attr/* SO_PEERSEC Fix Virtualize – per task default LSM - each task gets marked with a default LSM, to virtualize legacy interfaces - inherited from parent

Kernel infrastructure not designed for sharing More Problems Kernel infrastructure not designed for sharing Problem Userspace Interfaces /proc/pid/attr/* SO_PEERSEC Fix Virtualize – per task default LSM Interface to set default LSM - add interface to control default LSM - also

Kernel infrastructure not designed for sharing More Problems Kernel infrastructure not designed for sharing Problem Userspace Interfaces /proc/pid/attr/* SO_PEERSEC Fix Virtualize – per task default LSM Interface to set default LSM New versions of interfaces /proc/pid/attr/apparmor/* /proc/pid/attr/smack/* … - new versions of interfaces - tools and libs need to be updated to use them -libapparmor -libselinux - ps -Z

Kernel infrastructure not designed for sharing More Problems Kernel infrastructure not designed for sharing Problem Userspace Interfaces /proc/pid/attr/* SO_PEERSEC Networking secids Fix Virtualize – per task default LSM Interface to set default LSM New versions of interfaces /proc/pid/attr/apparmor/* /proc/pid/attr/smack/* … Dynamically compose & remap - Networking area of active development/refinement - 32 bit number to carry security info – network subsystem – audit subsystem. – global – part of some LSMs policy (# exposed to userspace) – can’t get a pointer LSM infrastructure dynamically - remap and compose - system number → per LSM module number LIFE TIME issue

Kernel infrastructure not designed for sharing More Problems Kernel infrastructure not designed for sharing Problem Userspace Interfaces /proc/pid/attr/* SO_PEERSEC Networking secids secmark Fix Virtualize – per task default LSM Interface to set default LSM New versions of interfaces /proc/pid/attr/apparmor/* /proc/pid/attr/smack/* … Dynamically compose & remap Extend to support multiple LSMs - secmarks visible to iptables - secmark can only carry 1 LSM type - need to support stack of types - need to define what rules should be

Kernel infrastructure not designed for sharing More Problems Kernel infrastructure not designed for sharing Problem Userspace Interfaces /proc/pid/attr/* SO_PEERSEC Networking secids secmark Netlabel cipso/calypso/xfrm Fix Virtualize – per task default LSM Interface to set default LSM New versions of interfaces /proc/pid/attr/apparmor/* /proc/pid/attr/smack/* … Dynamically compose & remap Extend to support multiple LSMs ? - not designed for this - may have to be limited to one LSM - or only if all LSMs request the same label

LSM stacking is not namespacing But... LSM stacking is not namespacing - LSM stacking designed to support multiple LSMs on host system - not how containers want to use it

Current Situation with Stacking apparmor container selinux smack - all LSMs in use need to be set at boot - containers still don’t get to set their LSM - eg. fedora or policy in the container

Even Worse - LSMs aren’t namespaced yet IMA Discussing namespacing Patch to ns IMA audit Smack patches to label namespaces Per process rules SeLinux Discussing/Designing namespacing Patches to refactor/remove global state Audit wip to support namespaces Layering issues AppArmor Policy namespaces Virtualized interfaces Internal stacking - LSMs aren’t namespaced yet - the exception is apparmor within limits - namespacing issues - LXD can do apparmor system within apparmor system without LSM stacking patches

More Infastructure Problems LSM needs to be update Security blob for namespaces New hooks around interfaces Attributes (ie. xattrs) need to be namespaced Interface to setup an LSM namespace No consensus on what it means to be a container LSM infrastructure isn’t the only problem

Leveraging LSM stacking Remember the Default LSM?

Leveraging LSM stacking Remember the Default LSM? LSM stacking can call a Module multiple times extend to per task LSM namespace is a visible subset of stack module that needs to be setup from boot, can be hidden revealed only when added to stack Needs an interface Container Needs to setup the LSM namespace Additional LSM specific setup labeling mounts that are mapped in - namespacing the LSM can be done as a thin veneer

Casey Schaufler – LSM Stacking Special thanks Casey Schaufler – LSM Stacking AppArmor team IMA team Smack team Selinux team LXD team - this isn’t just the work of one individual - Casey for persistences

Questions please Thank you https://github.com/cschaufler/lsm- stacking https://github.com/jrjohansen/lsm- stacking John Johansen john.johansen@canonical.com www.canonical.com