FOSS Security through SELinux (Security Enhanced Linux) M.B.G. Suranga De Silva Information Security Specialist TECHCERT c/o Department of Computer Science.

Slides:



Advertisements
Similar presentations
Operating System Security
Advertisements

1 cs691 chow C. Edward Chow Confidentiality Policy CS691 – Chapter 5 of Matt Bishop.
JENNIS SHRESTHA CSC 345 April 22, Contents Introduction History Flux Advanced Security Kernel Mandatory Access Control Policies MAC Vs DAC Features.
Access Control Chapter 3 Part 3 Pages 209 to 227.
Access Control Patterns Fatemeh Imani Mehr Amirkabir university of technology, Department of Computer Engineering & Information Technology.
By: Arpit Pandey SELINUX (SECURITY-ENHANCED LINUX)
1 Flexible Mandatory Access Control (MAC) in Modern Operating Systems Jeffrey H. Jewell CS 591 December 7, 2009 Jeffrey H. Jewell CS 591 December 7, 2009.
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.
Operating System Security Chapter 9. Operating System Security Terms and Concepts An operating system manages and controls access to hardware components.
Lecture 7 Access Control
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)
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.
Principles of Computer Security: CompTIA Security + ® and Beyond, Second Edition © 2010 Baselines Chapter 14.
Security Enhanced Linux (SELinux)
Secure Operating Systems
Database Security and Auditing: Protecting Data Integrity and Accessibility Chapter 3 Administration of Users.
SELinux US/Fedora/13/html/Security-Enhanced_Linux/
Presented by Amlan B Dey.  Access control is the traditional center of gravity of computer security.  It is where security engineering meets computer.
Linux kernel security Professor: Mahmood Ranjbar Authors: mohammad Heydari Mahmood ZafarArjmand Zohre Alihoseyni Maryam Sabaghi.
Security Enhanced Linux David Quigley. History SELinux Timeline 1985:LOCK (early Type Enforcement) 1990: DTMach / DTOS 1995: Utah Fluke / Flask 1999:
Information Assurance Research Group 1 NSA Security-Enhanced Linux (SELinux) Grant M. Wagner Information Assurance.
1 Implementation of Security-Enhanced Linux Yue Cui Xiang Sha Li Song CMSC 691X Project 2—Summer 02.
Operating System Security. OS manages and controls access to hardware components Older OSs focused on ensuring data confidentiality Modern operating systems.
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.
CSCE 201 Introduction to Information Security Fall 2010 Access Control.
Access Control. What is Access Control? The ability to allow only authorized users, programs or processes system or resource access The ability to disallow.
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.
Academic Year 2014 Spring Academic Year 2014 Spring.
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.
Privilege Management Chapter 22.
Security-Enhanced Linux Eric Harney CPSC 481. What is SELinux? ● Developed by NSA – Released in 2000 ● Adds additional security capabilities to Linux.
XACML Showcase RSA Conference What is XACML? n XML language for access control n Coarse or fine-grained n Extremely powerful evaluation logic n.
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.
Chapter 15: Access Control Mechanisms Dr. Wayne Summers Department of Computer Science Columbus State University
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.
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.
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.
SQL Database Management
Access Control Model SAM-5.
Writing SELinux Policy | Permissive Domains | Real bugs
Demystifying SELinux: WTF is it saying?
SELinux Daniel J Walsh SELinux Lead Engineer.
SE Linux Implementation
SELinux RHEL5: A benchmark
IS3440 Linux Security Unit 3 User Account Management
IS3440 Linux Security Unit 6 Using Layered Security for Access Control
SELinux (Security Enhanced Linux)
An Overview Rick Anderson Pat Demko
SELinux
SECURITY IN THE LINUX OPERATING SYSTEM
OS Access Control Mauricio Sifontes.
NSA Security-Enhanced Linux (SELinux)
Access Control What’s New?
Presentation transcript:

FOSS Security through SELinux (Security Enhanced Linux) M.B.G. Suranga De Silva Information Security Specialist TECHCERT c/o Department of Computer Science and Engineering University of Moratuwa.

2 Agenda How to secure Linux OS DAC and MAC LSM Architecture SELinux – what is it? Processes and Domains Security Server Type Enforcement Role Base Access Control Access Vector Cache kernel & File System Integrity process separation Holistic View of a secure Linux OS

3 How to secure Linux OS Only enabling and configuring just wanted services, and patching those services accordingly. This is known as operating system hardening. Improve access control mechanism Process separation– Vulnerability in one should not lead to compromise of all

4 DAC and MAC Most operating systems have a built-in security mechanism known as access control. We can consider them as Discretionary Access Control (DAC) and Mandatory Access Control (MAC).

5 DAC DAC – Discretionary Access Control DAC is used to control access by restricting a subject's access to an object. It is generally used to limit a user's access to a file. In this type of access control it is the owner of the file who controls other users' accesses to the file.” Ex: ls –l -rw-rw-r– 1 suranga suranga 2645 Feb 12 08:48 personnel.txt

6 MAC MAC is much more effective than DAC because MACs are often applied to agents other than users. MACs cannot be overridden by the owner of the object. MACs may be applied to objects not protected by ordinary unix style DACs such as network sockets and processes. The other advantage is it makes data flow control possible which was impossible in DAC.

7 LSM Architecture (Linux Security Module)

8 SELinux – What is it ? Released by NSA September, 2001 Based on previous research projects (FLASK OS) Integrated with Linux Security Module (LSM) Adopted into 2.6 kernel series. Type Enforcement (TE) rules – which subjects can access which objects. Role-Based Access Control (RBAC) – which roles users can adopt and what they can do. Provides fine-grained controls and operation on files, sockets and processes.

9 Processes and Domains A process running with a specific security context is said to be running within a domain (process with a sandbox) Each domain is assigned only sufficient permissions to properly function but do nothing else. Rules are configured to: – Specify which objects a domain can access, and how – Specify which roles a domain can transition to

10 Security Server (SS) The security policy decision logic is embedded to a new kernel component known as Security Server (SS). SS makes labeling, access and transition decisions. Each file is labeled with information called security context. Security context is a data type and it can only be interpreted by the Security Server. SS maintains the Security Context with three security attributes known as identity, role and type.

11 Type Enforcement (TE) Clearly define which subjects can access which objects, and how Define domain transitions. - ex: init run-control processes are in initrc_t domain. When init starts web server process it shouldn't be in that domain but http_t domain. Permissions are encoded as access vectors. Written in plain text, processed by the m4 macro processor.

12 Role Based Access Control (RBAC) Which roles users can adopt and what they can do. Works along with Type Enforcement Users are assigned roles by user statement -ex: user fossed roles { staff_r sysadm_r}; Transition between roles are governed by allow statement -ex: allow staff_r sysadm_r; Roles are authorized to enter domains by the role statement. -ex: role sysadm_r types ifconfig_t

13 Access Vector Cache (AVC) To improve the efficiency of SELinux operation, the Security Server caches access vectors in a data structure called Access Vector Cache. The Access Vector Cache stores past SS policy requests/responses.

14 SELinux’s Object Managers Object management includes labeling objects with a security context, managing object labels in memory. Object managers are there to obtain security policy decisions from the security server and to apply the decisions to label and control access to their objects.

15 SELinux in a Diagram

16 SELinux Complete Diagram

17 SELinux Operation 1. The policy server gathers the security context from the subject and object, and sends the pair of labels to the security server, which is responsible for policy decision making. 2. The policy server first checks the AVC, and returns a decision to the enforcement server. 3. If the AVC does not have a policy decision cached, it turns to the security server, which uses the binary policy that is loaded into the kernel during initialization. The AVC caches the decision, and returns the decision to the policy server. 4. If the policy permits the subject to perform the desired operation on the object, the operation is allowed to proceed. 5. If the policy does not permit the subject to perform the desired operation, the action is denied, and one or more avc: denied messages are logged to $AUDIT_LOG, which is typically /var/log/messages.

18 Process Separation Policy configuration can restrict the interference by a process in one domain to a process in the other domain. SELinux has the ability to trace other processes or send signals to other processes in the same domain. Ex: Sending SIGCHILD to notify the parent of the completion of the child process is ALLOWED BUT when a process signals SIGKILL on all other processes is NOT ALLOWED

19 Complete View of a secure Linux OS

20 Further Reading For a description of the policy language syntax as well as an example policy refer to [1] For a set of some object classes and permissions refer to [2]

21 References [1]P. A. Loscocco and S. D. Smalley. Meeting Critical Security Objectives with Security-Enhanced Linux. x01-abs.cfm [2]P. Loscocco and S. Smalley. Integrating Flexible Support for Security Policies into the Linux Operating System. a01-abs.cfm

22 THANK YOU!!! Any Questions? MAIL ME

23 Kernel and File System integrity Protecting Kernel Integrity Most of /boot files are labeled with boot_t type and can only be modified by an administrator. Protecting System File Integrity Separate types are defined and assigned to system files Ex: The Dynamic Linker is labeled with the ld_so_t type System programs are labeled with type bin_t System Administration Programs are labeled with sbin_t Write access to these types is limited to administrator.

24 Security Context and SID Two security label data types (used in SS): 1. Security ID (SID) – An integer mapped to security context 2. Security context – A string that represents the security level Security context contains all of the security attributes associated with a particular labeled object. Security Identifier (SID) is directly bound to the object. SID is mapped with Security context. The mapping is created at run time and maintained by the Security server. SIDs associated to the new file is send to SS. The Object Managers are responsible for associating SIDs to objects.

25 SELinux-aware Applications Many basic Linux commands have been modified to be SELinux-aware – login, ls, ps, id, cron Ex:su - root id -Z root:system_r:unconfined_t useradd shantha ls -Z /home drwx shantha shantha root:object_r:user_home_dir_t /home/shantha Other applications patched for SELinux – OpenSSH Additional commands added to perform SELinux functions – chcon, restorecon, fixfiles etc. Tresys GUI tools for managing policies Backup be careful !!!

26 Examples ls -aZ /home/suranga drwx suranga suranga root:object_r:user_home_dir_t. drwxr-xr-x root root system_u:object_r:home_root_t.. -rw-r--r-- suranga suranga user_u:object_r:user_home_t anaconda-ks.cfg- rwxr-xr-x suranga suranga user_u:object_r:user_home_t anaconda.log... sudo mv /home/suranga/about.html /var/www/html ls -aZ /var/www/html/ drwxr-xr-x root root system_u:object_r:httpd_sys_content_t. drwxr-xr-x root root system_u:object_r:httpd_sys_content_t.. -rw-r--r-- root root system_u:object_r:httpd_sys_content_t index.php -rw-r--r-- suranga suranga system_u:object_r:user_home_t about.html Oct 19 17:54:59 hostname kernel: audit( :0): avc: \denied { getattr } for pid=19029 exe=/usr/sbin/httpd \path=/var/www/html/about.html dev=dm-0 ino= \scontext=root:system_r:httpd_t tcontext=user_u:object_r:user_home_t \tclass=file chcon -t httpd_sys_content_t /var/www/html/about.html ls -aZ /var/www/html/ drwxr-xr-x root root system_u:object_r:httpd_sys_content_t. drwxr-xr-x root root system_u:object_r:httpd_sys_content_t.. -rw-r--r-- root root system_u:object_r:httpd_sys_content_t index.php -rw-r--r-- suranga suranga system_u:object_r:httpd_sys_content_t about.html