Security Enhanced Linux David Quigley. History SELinux Timeline 1985:LOCK (early Type Enforcement) 1990: DTMach / DTOS 1995: Utah Fluke / Flask 1999:

Slides:



Advertisements
Similar presentations
Operating System Security
Advertisements

JENNIS SHRESTHA CSC 345 April 22, Contents Introduction History Flux Advanced Security Kernel Mandatory Access Control Policies MAC Vs DAC Features.
Access Control Patterns Fatemeh Imani Mehr Amirkabir university of technology, Department of Computer Engineering & Information Technology.
1 UCR Access Control/Capabilities Some slides/ideas adapted from Ninghui Li.
By: Arpit Pandey SELINUX (SECURITY-ENHANCED LINUX)
Chapter 9 Building a Secure Operating System for Linux.
SELinux (Security Enhanced Linux) By: Corey McClurg.
Security-Enhanced Linux Joseph A LaConte CS 522 December 8, 2004.
Shane Jahnke CS591 December 7,  What is SELinux?  Changing SELinux Policies  What is SLIDE?  Reference Policy  SLIDE  Installation and Configuration.
Multilevel Security CySecLab Graduate School of Information Security.
Lecture slides prepared for “Computer Security: Principles and Practice”, 2/e, by William Stallings and Lawrie Brown, Chapter 4 “Overview”.
SELinux. 2SELinux Wikipedia says: Security-Enhanced Linux (SELinux) is an implementation of mandatory access control using Linux Security Modules (LSM)
Linux Security.
ADVANCED LINUX SECURITY. Abstract : Using mandatory access control greatly increases the security of an operating system. SELinux, which is an implementation.
Implementing SELinux as a Linux Security Module By Stephen Smalley Chris Vance & Wayne Salamon Presentation by: KASHIF HASAN
Security-Enhanced Linux & Linux Security Module The George Washington University CS297 Programming Language & Security YU-HAO HU.
Security Enhanced Linux (SELinux)
Computer Security & OS Lab. DKU May 26 Younsik Jeong Ph.D. Student.
Secure Operating Systems
SELinux US/Fedora/13/html/Security-Enhanced_Linux/
Linux kernel security Professor: Mahmood Ranjbar Authors: mohammad Heydari Mahmood ZafarArjmand Zohre Alihoseyni Maryam Sabaghi.
Security-Enhanced Linux. References  Implementation of Security-Enhanced Linux by Yue Cui, Xiang Sha, Li Song  Security Enhanced Linux by David Quigley.
FOSS Security through SELinux (Security Enhanced Linux) M.B.G. Suranga De Silva Information Security Specialist TECHCERT c/o Department of Computer Science.
1 Implementation of Security-Enhanced Linux Yue Cui Xiang Sha Li Song CMSC 691X Project 2—Summer 02.
Providing Policy Control Over Object Operations in a Mach Based System By Abhilash Chouksey
Exploiting Data Parallelism in SELinux Using a Multicore Processor Bodhisatta Barman Roy National University of Singapore, Singapore Arun Kalyanasundaram,
CIS 290 Linux Security Program Authentication Module and Security Enhanced LINUX.
Security+ All-In-One Edition Chapter 19 – Privilege Management Brian E. Brzezicki.
Using the Flask Security Architecture to Facilitate Risk Adaptable Access Control March 31 Younsik Jeong Ph.D. Student.
SELinux - What the hell does that mean? disoray thelug : DC214
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
Chapter 7 Securing Commercial Operating Systems. Chapter Overview Retrofitting Security into a Commercial OS History of Retrofitting Commercial OS's Commercial.
ADV. NETWORK SECURITY CODY WATSON What’s in Your Dongle and Bank Account? Mandatory and Discretionary Protections of External Resources.
SELinux. The need for secure OS Increasing risk to valuable information Dependence on OS protection mechanisms Inadequacy of mainstream operating systems.
1 Linux Security Module: General Security Support for the Linux Kernel Presented by Chao-Sheng Lin 2005/11/1.
Mandatory Access Control and SE Linux CS 460 Cyber Security Lab Spring ‘10.
Trusted Operating Systems
The SELinux of First Look. Prologue After many discussions with a lot of Linux users, I’ve come to realize that most of them seem to disable SELinux rather.
Security-Enhanced Linux Eric Harney CPSC 481. What is SELinux? ● Developed by NSA – Released in 2000 ● Adds additional security capabilities to Linux.
Computer Security: Principles and Practice
5/7/2007CoreMcClug/SELinux 1 By: Corey McClurg. Outline A History of SELinux What is SELinux and how do I get it? Getting Started Mandatory Access Control.
4P13 Week 5 Talking Points 1. Security Provided by BSD a self-protecting Trusted Computing Base (TCB) spanning kernel and userspace; kernel isolation.
Security-Enhanced Linux Stephanie Stelling Center for Information Security Department of Computer Science University of Tulsa, Tulsa, OK
Access Controls Mandatory Access Control by Sean Dalton December 5 th 2008.
PREPARED BY: MS. ANGELA R.ICO & MS. AILEEN E. QUITNO (MSE-COE) COURSE TITLE: OPERATING SYSTEM PROF. GISELA MAY A. ALBANO PREPARED BY: MS. ANGELA R.ICO.
22 feb What is Access Control? Access control is the heart of security Definitions: * The ability to allow only authorized users, programs or.
How to live with SELinux
MLS/MCS on SE Linux Russell Coker. What is SE Linux? A system for Mandatory Access Control (MAC) based on the Linux Security Modules (LSM) framework Uses.
SELinux Overview ● Permissions historically – Why is unix or ACL permissions not good enough? ● DAC vs. MAC ● SELinux ID, objects, roles and types ● Policy.
Linux Kernel Security (SELinux vs AppArmor vs Grsecurity)
Overview of NSA Security Enhanced Linux Russell Coker.
SELinux Overview Dan Walsh SELinux for Dummies Dan Walsh
Red Hat Enterprise Linux 5 Security April Red Hat Development Model Collaboration with partners and open source contributors to develop technology.
Writing SELinux Policy Daniel Walsh Red Hat. Language M4 Macros Name ● module rwhod 1.0; ● policy_module(rwhod,1.0)
SELinux Overview DAC vs MAC Discretionary Access Control Mandatory
SE Linux Implementation Russell Coker. What is SE Linux? A system for Mandatory Access Control (MAC) based on the Linux Security Modules (LSM) framework.
Demystifying SELinux Part II: Who’s Policy Is It Anyway
Secure Operating System
Writing SELinux Policy | Permissive Domains | Real bugs
Secure Operating System Example: SELinux
Demystifying SELinux: WTF is it saying?
AppArmor LSM Update Introduce self John Johansen.
SELinux Daniel J Walsh SELinux Lead Engineer.
SE Linux Implementation
SELinux in 20 Minutes LCA Miniconf Jan. 28th, Canberra AU
SELinux RHEL5: A benchmark
SELinux (Security Enhanced Linux)
An Overview Rick Anderson Pat Demko
SELinux
Presentation transcript:

Security Enhanced Linux David Quigley

History

SELinux Timeline 1985:LOCK (early Type Enforcement) 1990: DTMach / DTOS 1995: Utah Fluke / Flask 1999: 2.2 Linux Kernel (patch) 2000: 2001: 2.4 Linux Kernel (patch) 2002:LSM 2003:2.6 Linux Kernel (mainline) 2006: Full network labeling Present

Concepts

Type Enforcement Object(s): items in a system that are acted upon (files, IPC, sockets, etc….) Subject(s): process that are requesting access to an object All Objects and Subjects contain a security context Security Context(s) are composed of four parts All Security Context components are checked against the policy to see if access is allowed. Type is the base component while role and user are used to further restrict type enforcement

Security Contexts system_u:object_r:passwd_exec_t:s0:c0.c2-s2:c0.c1 user:role:type:sensitivity[:category,…][-sensitivity[:category,…]]

TE Access Control Source type(s): The domain type of the process accessing the object Target type(s): The type of the object being accessed by the process Object class(es): The class of object to permit access to Permission(s): The kind of access permitted for the indicated object class allow user_t bin_t : file {read execute write getattr setattr}

Domain Transitions Analogous to SetUID programs Joe running as user_t (untrusted user) needs to change his password. How does Joe change his password? allow user_t passwd_exec_t : file {getattr execute} allow passwd_t passwd_exec_t : file entrypoint allow user_t passwd_t : process transition What does this solve? Restricts trusted domain passwd_t and allows user_t to transition to it. Implicit domain transitions provided via type_transition.

Users & Roles First and second component of a security context SELinux usernames and DAC usernames are not synonymous Semanage is used to maintain mappings of DAC to SELinux usernames. Roles are collections of types geared towards a purpose Roles can be used to further restrict actions on the system SELinux usernames are granted roles in the system

MLS MLS portion of Security Context is composed of 4 parts  Low/High  Sensitivity/Category Includes syntax to define dominance of security levels Subjects with range of levels considered trusted subjects Implements a variation of Bell-La Padula

Architecture

LSM Kernel framework for security modules Provides a set of hooks to implement further security checks Usually placed after existing DAC checks and before resource access Implications? SELinux check is not called if the DAC fails Makes auditing difficult at times.

SELinux LSM Module User Space Kernel Space Selinux Filesystem Access Vector Cache Security Server (Policy Rules and Access Decision Logic) LSM Hooks Various Kernel Object Managers Cache Miss Yes or No? SELinux LSM Module Policy Management Interface Figure taken from SELinux by Example

Userspace Object Managers Access Vector Cache libselinux User-Space Object Manager Figure taken from SELinux by Example User Space Kernel Space Selinux Filesystem Policy Management Interface Allow access? Yes or No? Access Vector Cache Security Server (Policy Rules and Access Decision Logic) Cache Miss Yes or No?

Policy Server Access Vector Cache libselinux User-Space Object Manager Figure taken from SELinux by Example User Space Kernel Space Selinux Filesystem Policy Management Interface Cache Miss? Yes or No? User-Space Security Server Policy Management Server Load User Policy Policy Server Access Vector Cache Security Server (Policy Rules and Access Decision Logic) Cache Miss Yes or No?

Policy Language Make, Scripts, M4, and so on Type Enforcement Statements (Types, TE Rules, Roles, Users) Constraints Resource labeling Specifications Classes and Permissions Checkpolicy Binary Policy File Kernel Space Selinux Filesystem Access Vector Cache Security Server (Policy Rules and Access Decision Logic) Cache Miss Yes or No? SELinux LSM Module load_policy Policy Source Modules policy.conf Figure taken from SELinux by Example

SELinux Policy Language

Object Classes Represents resources of a certain kind Policy must include declarations for all object classes Classes  File related (blk_file,chr_file,dir,fd …)  Network related (socket, packet_socket, rawip_socket, …)  IPC related (ipc, msg, msgq, sem, shm)  Misc Classes (capability, process, security, system)

Permissions Specific to a particular Object Class Includes traditional Linux permissions Extends existing permissions to be finer grained Includes SELinux specific permissions for labeling

Type Enforcement Several major keywords  type  attribute  typeattribute  typealias  allow  dontaudit  auditallow  neverallow

Type Enforcement attribute file_type; attribute httpdcontent; #These two statements... type httpd_user_content_t; typeattribute httpd_user_content_t file_type, httpdcontent; #are equivalent to this one type httpd_user_content_t, file_type, httpdcontent; #These two statements... type mozilla_t, domain; typealias mozilla_t alias netscape_t; #are equivalent to this one type mozilla_t alias netscape_t, domain;

Type Enforcement rule_name src_type_set target_type_set : class_set perm_set; #valid allow user_t bin_t : file { read getattr } ; allow user_t bin_t : dir { read getattr search } ; #invalid since file does not have a search permission allow user_t bin_t { file dir } {read getattr search } ; #dontaudit when this access is denied dontaudit httpd_t etc_t : dir search ; #audit when this access is allowed #by default allowed access is not audited auditallow domain shadow_t : file write ; #This statement may never be allowed by any rule neverallow user_t shadow_t : file write allow user_t bin_t : { file dir } * ; allow user_t bin_t : file ~{ write setattr ioctl };

Type Enforcement Type Transitions type_transition type_change #These two statements... type_transition user_t passwd_exec_t : process passwd_t; type_transition sysadm_t passwd_exec_t : process passwd_t; #are equivalent to this one type_transition { user_t sysadm_t } : process passwd_t; #This domain transition rule… type_transition init_t apache_exec_t : process apache_t ; #would require atleast the follow 3 allow rules to succeed allow init_t apache_exec_t : file execute ; allow init_t apache_t : process transition; allow apache_t apache_exec_t : file entrypoint ;

RBAC Adds 2 components to security context  user  role Adds 3 policy language keywords  allow (different than AVC allow)  role_transition (similar to type_transition)  dominance

RBAC Example #valid security context joe:user_r:passwd_t #role user_r assigned to user joe user joe roles { user_r }; #equivalent to this one role user_r types { user_t passwd_t }; allow staff_r sysadm_r; role_transition sysadm_r http_exec_t system_r; #super_r inherits all types from sysadm_r and secadm_r dominance { role super_r { role sysadm_r; role secadm_r; }}

Multilevel Security Policy Declares Levels and categories applies constraints on objects and permissions with MLS dominance keywords  ==, !=, eq, dom, domby, incomp  mlsconstrain file {create relabelto } { l2 eq h2 } mlsvalidatetrans transitions between levels Still requires a lot of work

Conditional Policies Allows enabling/disabling portions of policy Booleans define in policy Logical operations allowed  &&  ||  ^  !  ==  != Does not support nested conditionals Booleans modified through special applications or SELinuxfs

Reference Policy Maintained by NSA and FC Mailing Lists Compiles into three versions  Strict, Targeted, MLS Stats  Version.18  Object Classes 55  Common Permissions 3, Permission 205  Types 1589  allow , auditallow 12, dontaudit  type_transition 2657, type_change 68  roles 6, RBAC allow 6, role_transition 97, users 3  bools 70

Userspace

Components checkpolicy libselinux libsemanage libsepol policycoreutils

libselinux Used by SELinux aware applications Houses user space AVC Contains functions to  calculate AVCs  get/set/create contexts  query policy engine

libsemanage Used to query and configure state of a running system Provides functions to query/modify  login names  users  network ports/interfaces  file contexts  level translations  roles  etc.

SELinuxfs Interface between userspace and kernel Used by libselinux and libsemanage to communicate requests with the kernel Provides a quick and easy interface for humans Usually not used directly from programs

policycoreutils SELinux Management and policy analysis tools  audit2allow  audit2why  load_policy  newrole  restorecon  semanage  semodule  sestatus  setbool  etc...

Distributions Fedora Core 3 and later Debian Gentoo SuSe SE-BSD SE-MACH

More Information SELinux Homepage: SELinux Mailing list: Redhat SELinux Mailing List: selinux-list selinux-list Fedora SELinux Wiki: