By: Arpit Pandey SELINUX (SECURITY-ENHANCED LINUX)

Slides:



Advertisements
Similar presentations
Operating System Security
Advertisements

1 cs691 chow C. Edward Chow Confidentiality Policy CS691 – Chapter 5 of Matt Bishop.
Access Control Chapter 3 Part 3 Pages 209 to 227.
1 Defining System Security Policies. 2 Module - Defining System Security Policies ♦ Overview An important aspect of Network management is to protect your.
Title of Selected Paper: Design and Implementation of Secure Embedded Systems Based on Trustzone Authors: Yan-ling Xu, Wei Pan, Xin-guo Zhang Presented.
Access Control Patterns Fatemeh Imani Mehr Amirkabir university of technology, Department of Computer Engineering & Information Technology.
Access Control Intro, DAC and MAC System Security.
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.
2  A system can protect itself in two ways: It can limit who can access the system. This requires the system to implement a two-step process of identification.
Lecture 7 Access Control
Lecture slides prepared for “Computer Security: Principles and Practice”, 2/e, by William Stallings and Lawrie Brown, Chapter 4 “Overview”.
7-Access Control Fundamentals Dr. John P. Abraham Professor UTPA.
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.
Computer Security & OS Lab. DKU May 26 Younsik Jeong Ph.D. Student.
Computer Security An overview of terms and key concepts.
Secure Operating Systems
SELinux US/Fedora/13/html/Security-Enhanced_Linux/
© G. Dhillon, IS Department Virginia Commonwealth University Principles of IS Security Formal Models.
Switch off your Mobiles Phones or Change Profile to Silent Mode.
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.
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.
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.
CSCE 201 Introduction to Information Security Fall 2010 Access Control.
G53SEC 1 Access Control principals, objects and their operations.
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.
Linux Security. Authors:- Advanced Linux Programming by Mark Mitchell, Jeffrey Oldham, and Alex Samuel, of CodeSourcery LLC published by New Riders Publishing.
SELinux. The need for secure OS Increasing risk to valuable information Dependence on OS protection mechanisms Inadequacy of mainstream operating systems.
Lecture 18 Page 1 CS 111 Online OS Use of Access Control Operating systems often use both ACLs and capabilities – Sometimes for the same resource E.g.,
Access Controls Henry Parks SSAC 2012 Presentation Outline Purpose of Access Controls Access Control Models –Mandatory –Nondiscretionary/Discretionary.
Academic Year 2014 Spring Academic Year 2014 Spring.
COEN 350: Network Security Authorization. Fundamental Mechanisms: Access Matrix Subjects Objects (Subjects can be objects, too.) Access Rights Example:
Trusted Operating Systems
Access Control Lesson Introduction ●Understand the importance of access control ●Explore ways in which access control can be implemented ●Understand how.
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.
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.
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.
Linux Kernel Security (SELinux vs AppArmor vs Grsecurity)
SELinux Overview Dan Walsh SELinux for Dummies Dan Walsh
SE Linux Implementation Russell Coker. What is SE Linux? A system for Mandatory Access Control (MAC) based on the Linux Security Modules (LSM) framework.
Access Control Model SAM-5.
Demystifying SELinux: WTF is it saying?
SELinux in 20 Minutes LCA Miniconf Jan. 28th, Canberra AU
SELinux RHEL5: A benchmark
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)
Operating System Concepts
Access Control What’s New?
Presentation transcript:

By: Arpit Pandey SELINUX (SECURITY-ENHANCED LINUX)

UNIX was born in 1969 but when it was created it was not created ever thinking about security. In a 1979 document titled On the Security of UNIX, Dennis Ritchie said: “The first fact to face is that UNIX was not developed with security, in any realistic sense, in mind; this fact alone guarantees a vast number of holes.” FACT ABOUT UNIX SYSTEM

WHY DO WE NEED SECURE SYSTEM? Protect system from crashes Protect operating system from bugs Stopping application from becoming dangerous for your own data Protect from Internet threats Protect from unauthorized access

A BRIEF HISTORY OF SELINUX Originally started by the Information Assurance Research Group of the National Security Agency (NSA), working with Secure Computing Corporation. Released to the open source development community under the GNU GPL on December 22, 2000 Merger into mainline kernel in 2003 Fedora since Core 2 (2004) RHEL since version 4 (2005) Debian since Etch (2007) Ubuntu since version 8.04 (2008)

LINUX ACCESS CONTROL INTRODUCTION Kernel Controlling Process (running program) access to Resources (file, directory, socket etc.) Linux Access Control involves :

STANDARD LINUX SECURITY Processes and files have security properties –process: user and group (real and effective) –resources: user and group + access bits read, write, and execute for user, group, other Standard access control is discretionary Includes concept of resource ownership Only two privilege levels: user and root An access control list (ACL) is maintained An ACL specifies which users or system processes are granted access to objects

If an individual user can set an access control mechanism to allow or deny access to an object, that mechanism is a discretionary access control (DAC), also called identity-based access control (IBAC). DISCRETIONARY ACCESS CONTROL

STANDARD LINUX SECURITY PROBLEMS Kernel can't distinguish applications from users Processes can escape security policy No way to enforce least privilege. Granting read access is transitive. DAC policy is vulnerable to Trojan horse attack. No restriction applied to the usage of information. The privileges for accessing objects are decided by the owner of the object

WHAT IS SELINUX??  A kernel level MAC (Mandatory Access Control) implementation for Linux.  Originally commissioned and built by/for the NSA.  Make it possible to configure the system to meet a wide range of security requirements.  Limit what the process is allowed to do with the object.  Very effective if done right.

MANDATORY ACCESS CONTROL MAC mechanisms assign a security level to all information, assign a security clearance to each user, and ensure that all users only have access to that data for which they have a clearance. Provides better security than DAC Principle: Read Down Access equal or less Clearance Write Up Access equal or higher Clearance

SELINUX MODES Enforcing The default mode which will enable and enforce the SELinux security policy on the system, denying access and logging actions Permissive In Permissive mode, SELinux is enabled but will not enforce the security policy, only warn and log actions. Permissive mode is useful for troubleshooting SELinux issues Disabled SELinux is turned off The 'setenforce' command may be used to switch between Enforcing and Permissive modes

SELINUX POLICIES Strict Policy By default everything is denied and then a policy is written that gives each element of the system only the access required to function. Targeted Policy In most of the Linux systems targeted policy is used which “targets” and confines selected system processes. -- Confined and Unconfined Process -- Confined and Unconfined Users Users who prefer the command line may use the 'sestatus' command to view the current SELinux status SELinux policy is the set of rules which guides through the SELinux Engine

SECURITY CONTEXT IN SELINUX SELinux makes access decisions by checking the security context of the subject (a process or a user) against the security context of the object (such as a file or network port) and then against the action attempted (e.g. a file read, file write).

SELINUX WORKING SELinux Enabled SELinux Mode Selection SELinux Policy (Strict/Targeted) SELinux Policy (Strict/Targeted) Enforcing Mode Permissive Mode Access Decision? Check Security Context of subject and object Authenticate Security Access Granted Access Not Granted YesNo

SELINUX ARCHITECTURE Subject (Process) Subject (Process) Access Vector Cache (AVC) Security Server (SS) Security Server (SS) Policy Object (file, socket,..) Object (file, socket,..) OK? Yes/No Access Linux-Kernel Access? Yes/No SELinux access denies will be logged in: /var/log/audit/audit.log No Yes

SELINUX DESIGN User Level Process open system call look up inode error checks DAC checks LSM hook access inode User space Kernel space Examine context. Does request pass policy? Grant or Deny. OK? Yes or No LSM Policy Engine Linux Security Model (LSM) is to mediate access to internal kernel objects  By placing hooks in kernel code just before the access  LSM module provides the functions to be called by these hooks

SELINUX SECURITY MODEL Security Policies are implemented using : – Type Enforcement (TE) (introduced in 1985 by Boebert and Kain) – Role-based access control (RBAC) – Multi-level Security

TYPE ENFORCEMENT Based on a single security property – type –applied to processes and resources –represents all security relevant information Types are assigned to processes and resources. type_transition source-type(s) target-type(s) : class(es) new-type ; DOMAIN TRANSITION

TYPE ENFORCEMENT In SElinux there are three possibilities for the outcome of decisions: allowed audit allow - allow but log that this took place audit deny - deny and log that this took place

ASSIGNING PROCESS TYPES Process types are: –(default) inherited from parent process –Set by policy (type transition rule) –Set by application (e.g. login) Examples: –Bash ( user_t) -> ls ( user_t) –init (init_t) -> httpd init script ( initrc_t) -> httpd (httpd_t) –Login ( login_t) -> bash (user_t)

ROLES An organizational job function with a clear definition of inherent responsibility and authority (permissions). Developer Director Team Leader Data Base Developer

ROLE-BASED ACCESS CONTROL A user has access to an object based on the assigned role. Roles are defined based on job functions. Permissions are defined based on job authority and responsibilities within a job function. Operations on an object are invocated based on the permissions. The object is concerned with the user’s role and not the user. Effectively, there are only two roles in the targeted policy: system_r and object_r.

The top row shows our SELinux users, the middle row lists the roles, and the bottom row lists domains. A valid security context can be constructed using one item from each row as long as the three are connected. In policy, the user definition: user full_u roles { mgr_r cashier_r }; defines one of the users and its connections to roles, while the role definition: role cashier_r types { cashier_t cashier_register_t };

MULTI LEVEL SECURITY Often hidden in targeted and strict The MLS Range contains two components, the low and high (clearance) sensitivity label, in which the high must always dominate the low. Identifies one level or range –Single level: s0 –Range: s0-s15:c0.c1023 Sensitivity and category/compartment list Usually translated –S15:c0.c1023 -> “System High” –S0 -> “System Low”

THE BELL-LA PADULA MODEL (BLP)

SELINUX AUDIT MESSAGE Errors can get created for a variety of reasons –A process running the wrong context –A mislabeled file –A bug in policy

SELINUX TOOLS sestatus: A command line tool that shows the current status of SElinux on the system. –a configuration file /etc/sestatus.con seinfo: A command line tool that allows querying of the current active policy. setenforce: A command line tool to switch between the SElinux enforcing and permissive modes. semanage A general tool that allows certain parts of the SElinux configuration and policy to be altered on the fly. semodule: A command line tool for managing policy modules.

SELINUX TOOLS CONT.… restorecon: A command line tool to "restore" the default SELinux security contexts for objects given as arguments (files, directories etc.). chcon: A command line tool in the genre of chmod, chown etc. setroubleshoot: A server and graphical frontend written in python to watch real-time AVC violations.

SELINUX TROUBLESHOOTER Sooner or later we may run into situations where SELinux denies access to something and we need to troubleshoot the issue. There are a number of fundamental reasons why SELinux may deny access to a file, process or resource: –A mislabeled file. –A process running under the wrong SELinux security context. –A bug in policy. An application requires access to a file that wasn't anticipated when the policy was written and generates an error.

31 DAC vs MAC Discretionary Access Control Familiar, easy to understand model used by most operating systems users have control (discretion) over their files and programs programs run as a user have that user's privileges root/superuser has complete control Trusted programs often run as superuser attacker's goal is to exploit program running with root privileges Superuser privileges harder to breakup Mandatory Access Control  Newer concept, than DAC hard to grasp  Not part of mainstream OS  program privileges under the control of security policy  easier to implement principle of least privilege  supplements DAC  Trusted programs privileges also under the control of security policy  Attacker is contained  Role separation Kernel Policy Enforcement Mandatory Access Control Kernel policy defines application rights, firewalling applications from compromising the entire system Kernel Discretionary Access Control Once a security exploit gains access to privileged system components the entire system is compromised

CONCLUSION SELinux is a practical implementation of Mandatory Access control. As SELinux provides a strong layer of protection which is hard to ignore that’s why it makes system more robust and safe. SELinux not only protects user from viruses, Trojan horses and other malicious software but also from the bugs in the web application. Properly defined policies can help a user, but if this is not properly defined then this may cause problem and may also crash the application. So it is really important to define policies properly.

REFERENCES mls-ov.htmlhttp:// mls-ov.html linux/ linux/ US/Fedora/13/html/Managing_Confined_Services/index.htmlhttp://docs.fedoraproject.org/en- US/Fedora/13/html/Managing_Confined_Services/index.html doc.user/webdocs.htmhttp://oss.tresys.com/projects/slide/chrome/site/help/com.tresys.slide. doc.user/webdocs.htm