SlideShare a Scribd company logo
Linux Security
YEHONATAN BITTON
outline
 introduction
 Linux security modules = LSM
 Grsecurity
 Sandboxing in the kernel
Who am I?
 Yehonatan Bitton , Married +2
 Security Researcher at BGU
Introduction
 What are we protecting?
 User apps?
 Kernel modules?
 The core kernel functionallity?
Linux security modules
 Kernel hooks
 Pluggable - kernel module style
 It is not intended as a general "hook" or "upcall" mechanism
 Examples: SElinux , AppArmor, Smack, Yama, …
 Least privileges
SELinux
 Mandatory access control
 Very complicated
 Learning mode
 Just access control
 Auditing
 In mainline
GRsecurity
 More than access control module
 RBAC
 Can be stacked with LSM (not an LSM module)
 Policy learning and analysis
 PaX (will be covered later)
 Improved ASLR
 Chroot hardening (using containers)
PaX
 Least privileges protections for memory pages
 Executable space protections
 PAGEEXEC
 SEGMEXEC
 ...
 ASLR
PaX Executable space protections
 Prevent shellcode/code injection attacks
 NX-bit (none executable bit, hardware base or emulated where needed)
 Restrict mprotect syscall
 Don't work with java just in time compiler
 There are exceptions
PaX cont'
PaX - PAGEEXEC
 Uses or emulates nx-bit on architectures without hardware support
 On IA-32 - uses supervisor bit
 Using two different TLB's (ITLB, DTLB) we can determine which one will cause
protection fault and inform the kernel, it the fault is from the ITLB than PaX will
kill the process otherwise everything will be fine
 Pageexec patch overrides the fault handler and checks whether it's results
from instruction fetch
 Each fault is checked for the user address and if it's with write permissions PaX
will terminate the process.
SEGMEXEC
 Reduce process VM size to 1.5G
 The process memory is mirrored
 Mapping in the upper and lower parts is the same
 Don't double RAM usage
 Each execution is checked against the mirror if code is not paged there
PaX will terminate the process
Seccomp
 Module for sandboxing in the kernel (no virtualization)
 Restrict process system calls
 All child processes inherit the parent restrictions
 Initially used for cloud computing
 A user upload a program and it cannot abuse the server
 Seccomp v2 supports dynamic policies
 Each process defines the syscalls which he can use and then enter
seccomp mode
 On seccomp mode process can add more restrictions
Namespaces
 Create multiple processes trees
 Process from child tree cannot affect parent tree
 Ptrace
 Kill
 Each process has multiple PID's one for each nested tree
Namespaces - network mounts
 When using clone enter special network flag - CLONE_NEWNET
 Each process have different set of network interfaces
Linux Security Overview
Result
Communication
 Using ssh daemon
 Create special uds device from the init process and pass it down to the
child trees
 Using TCP
CGroups
 Create separate groups for similar tasks
 Each group has restrictions
 Resource limitation - memory usage
 Prioritization - cpu share
 Control - stop, restart,… a group
 Each control group is in different namespace
 In 2007 “container”

More Related Content

What's hot (20)

PPT
Linux Operating System Vulnerabilities
Information Technology
 
PPTX
Linux security
trilokchandra prakash
 
ODP
Linux Network Security
Amr Ali
 
PDF
Security of Linux containers in the cloud
Dobrica Pavlinušić
 
PDF
Kernel Recipes 2013 - Linux Security Modules: different formal concepts
Anne Nicolas
 
PDF
Linux Kernel Security Overview - KCA 2009
James Morris
 
PDF
Linux Kernel Security: Adapting 1960s Technology to Meet 21st Century Threats
James Morris
 
PDF
Secure and Simple Sandboxing in SELinux
James Morris
 
PPTX
Essential security for linux servers
Juan Carlos Pérez Pardo
 
PDF
Hardening Linux and introducing Securix Linux
Security Session
 
PDF
How Many Linux Security Layers Are Enough?
Michael Boelen
 
PPTX
Linux security introduction
Mohamed Gad
 
PDF
Adding Extended Attribute Support to NFS
James Morris
 
PDF
Directions in SELinux Networking
James Morris
 
PDF
FreeBSD is not Linux
Muhammad Moinur Rahman
 
PDF
XPDS16: XSM-Flask, current limitations and Ongoing work. - Anshul Makkar, Ct...
The Linux Foundation
 
PDF
31c3 Presentation - Virtual Machine Introspection
Tamas K Lengyel
 
ODP
Hacktivity2014: Virtual Machine Introspection to Detect and Protect
Tamas K Lengyel
 
PDF
FreeBSD and Hardening Web Server
Muhammad Moinur Rahman
 
PDF
Have You Driven an SELinux Lately? - An Update on the SELinux Project - OLS ...
James Morris
 
Linux Operating System Vulnerabilities
Information Technology
 
Linux security
trilokchandra prakash
 
Linux Network Security
Amr Ali
 
Security of Linux containers in the cloud
Dobrica Pavlinušić
 
Kernel Recipes 2013 - Linux Security Modules: different formal concepts
Anne Nicolas
 
Linux Kernel Security Overview - KCA 2009
James Morris
 
Linux Kernel Security: Adapting 1960s Technology to Meet 21st Century Threats
James Morris
 
Secure and Simple Sandboxing in SELinux
James Morris
 
Essential security for linux servers
Juan Carlos Pérez Pardo
 
Hardening Linux and introducing Securix Linux
Security Session
 
How Many Linux Security Layers Are Enough?
Michael Boelen
 
Linux security introduction
Mohamed Gad
 
Adding Extended Attribute Support to NFS
James Morris
 
Directions in SELinux Networking
James Morris
 
FreeBSD is not Linux
Muhammad Moinur Rahman
 
XPDS16: XSM-Flask, current limitations and Ongoing work. - Anshul Makkar, Ct...
The Linux Foundation
 
31c3 Presentation - Virtual Machine Introspection
Tamas K Lengyel
 
Hacktivity2014: Virtual Machine Introspection to Detect and Protect
Tamas K Lengyel
 
FreeBSD and Hardening Web Server
Muhammad Moinur Rahman
 
Have You Driven an SELinux Lately? - An Update on the SELinux Project - OLS ...
James Morris
 

Similar to Linux Security Overview (20)

PDF
SELinux Kernel Internals and Architecture - FOSS.IN/2005
James Morris
 
PPTX
SELinux_@gnu_group_meetup
Jayant Chutke
 
PDF
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
PROIDEA
 
PDF
Linux seccomp(2) vs OpenBSD pledge(2)
Giovanni Bechis
 
PPTX
Security Enhanced Linux Overview
Emre Can Kucukoglu
 
PPTX
Linux 开源操作系统发展新趋势
Anthony Wong
 
PDF
Understanding SELinux For the Win
bmbouter
 
ODP
SELinux Basic Usage
Dmytro Minochkin
 
PDF
Chromium Sandbox on Linux (BlackHoodie 2018)
Patricia Aas
 
PDF
Linux Security Crash Course
UTD Computer Security Group
 
PDF
SELinux Johannesburg Linux User Group (JoziJUg)
Jumping Bean
 
PDF
Chromium Sandbox on Linux (NDC Security 2019)
Patricia Aas
 
PPTX
selinuxbasicusage.pptx
Pandiya Rajan
 
PDF
BSides Algiers - Linux Kernel and Recent Security Protections - Djallal Harouni
Shellmates
 
PDF
CS 626 - March : Capsicum: Practical Capabilities for UNIX
ruchith
 
ODP
SELinux for Everyday Users
PaulWay
 
PDF
Hardening Linux, introducing Securix GNU/Linux
Martin Holovský
 
ODP
chroot and SELinux
Shay Cohen
 
PDF
Overview of NSA Security Enhanced Linux - FOSS.IN/2005
James Morris
 
PPTX
interprocess communation and security in linux.pptx
paathuu04
 
SELinux Kernel Internals and Architecture - FOSS.IN/2005
James Morris
 
SELinux_@gnu_group_meetup
Jayant Chutke
 
CONFidence 2017: Escaping the (sand)box: The promises and pitfalls of modern ...
PROIDEA
 
Linux seccomp(2) vs OpenBSD pledge(2)
Giovanni Bechis
 
Security Enhanced Linux Overview
Emre Can Kucukoglu
 
Linux 开源操作系统发展新趋势
Anthony Wong
 
Understanding SELinux For the Win
bmbouter
 
SELinux Basic Usage
Dmytro Minochkin
 
Chromium Sandbox on Linux (BlackHoodie 2018)
Patricia Aas
 
Linux Security Crash Course
UTD Computer Security Group
 
SELinux Johannesburg Linux User Group (JoziJUg)
Jumping Bean
 
Chromium Sandbox on Linux (NDC Security 2019)
Patricia Aas
 
selinuxbasicusage.pptx
Pandiya Rajan
 
BSides Algiers - Linux Kernel and Recent Security Protections - Djallal Harouni
Shellmates
 
CS 626 - March : Capsicum: Practical Capabilities for UNIX
ruchith
 
SELinux for Everyday Users
PaulWay
 
Hardening Linux, introducing Securix GNU/Linux
Martin Holovský
 
chroot and SELinux
Shay Cohen
 
Overview of NSA Security Enhanced Linux - FOSS.IN/2005
James Morris
 
interprocess communation and security in linux.pptx
paathuu04
 
Ad

More from Kernel TLV (20)

PDF
DPDK In Depth
Kernel TLV
 
PDF
Building Network Functions with eBPF & BCC
Kernel TLV
 
PDF
SGX Trusted Execution Environment
Kernel TLV
 
PDF
Fun with FUSE
Kernel TLV
 
PPTX
Kernel Proc Connector and Containers
Kernel TLV
 
PPTX
Bypassing ASLR Exploiting CVE 2015-7545
Kernel TLV
 
PDF
Present Absence of Linux Filesystem Security
Kernel TLV
 
PDF
OpenWrt From Top to Bottom
Kernel TLV
 
PDF
Make Your Containers Faster: Linux Container Performance Tools
Kernel TLV
 
PDF
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
Kernel TLV
 
PDF
File Systems: Why, How and Where
Kernel TLV
 
PDF
netfilter and iptables
Kernel TLV
 
PDF
KernelTLV Speaker Guidelines
Kernel TLV
 
PDF
Userfaultfd: Current Features, Limitations and Future Development
Kernel TLV
 
PDF
The Linux Block Layer - Built for Fast Storage
Kernel TLV
 
PDF
Linux Kernel Cryptographic API and Use Cases
Kernel TLV
 
PPTX
DMA Survival Guide
Kernel TLV
 
PPSX
FD.IO Vector Packet Processing
Kernel TLV
 
PPTX
WiFi and the Beast
Kernel TLV
 
PPTX
Introduction to DPDK
Kernel TLV
 
DPDK In Depth
Kernel TLV
 
Building Network Functions with eBPF & BCC
Kernel TLV
 
SGX Trusted Execution Environment
Kernel TLV
 
Fun with FUSE
Kernel TLV
 
Kernel Proc Connector and Containers
Kernel TLV
 
Bypassing ASLR Exploiting CVE 2015-7545
Kernel TLV
 
Present Absence of Linux Filesystem Security
Kernel TLV
 
OpenWrt From Top to Bottom
Kernel TLV
 
Make Your Containers Faster: Linux Container Performance Tools
Kernel TLV
 
Emerging Persistent Memory Hardware and ZUFS - PM-based File Systems in User ...
Kernel TLV
 
File Systems: Why, How and Where
Kernel TLV
 
netfilter and iptables
Kernel TLV
 
KernelTLV Speaker Guidelines
Kernel TLV
 
Userfaultfd: Current Features, Limitations and Future Development
Kernel TLV
 
The Linux Block Layer - Built for Fast Storage
Kernel TLV
 
Linux Kernel Cryptographic API and Use Cases
Kernel TLV
 
DMA Survival Guide
Kernel TLV
 
FD.IO Vector Packet Processing
Kernel TLV
 
WiFi and the Beast
Kernel TLV
 
Introduction to DPDK
Kernel TLV
 
Ad

Recently uploaded (20)

PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Human Resources Information System (HRIS)
Amity University, Patna
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 

Linux Security Overview

  • 2. outline  introduction  Linux security modules = LSM  Grsecurity  Sandboxing in the kernel
  • 3. Who am I?  Yehonatan Bitton , Married +2  Security Researcher at BGU
  • 4. Introduction  What are we protecting?  User apps?  Kernel modules?  The core kernel functionallity?
  • 5. Linux security modules  Kernel hooks  Pluggable - kernel module style  It is not intended as a general "hook" or "upcall" mechanism  Examples: SElinux , AppArmor, Smack, Yama, …  Least privileges
  • 6. SELinux  Mandatory access control  Very complicated  Learning mode  Just access control  Auditing  In mainline
  • 7. GRsecurity  More than access control module  RBAC  Can be stacked with LSM (not an LSM module)  Policy learning and analysis  PaX (will be covered later)  Improved ASLR  Chroot hardening (using containers)
  • 8. PaX  Least privileges protections for memory pages  Executable space protections  PAGEEXEC  SEGMEXEC  ...  ASLR
  • 9. PaX Executable space protections  Prevent shellcode/code injection attacks  NX-bit (none executable bit, hardware base or emulated where needed)  Restrict mprotect syscall  Don't work with java just in time compiler  There are exceptions
  • 11. PaX - PAGEEXEC  Uses or emulates nx-bit on architectures without hardware support  On IA-32 - uses supervisor bit  Using two different TLB's (ITLB, DTLB) we can determine which one will cause protection fault and inform the kernel, it the fault is from the ITLB than PaX will kill the process otherwise everything will be fine  Pageexec patch overrides the fault handler and checks whether it's results from instruction fetch  Each fault is checked for the user address and if it's with write permissions PaX will terminate the process.
  • 12. SEGMEXEC  Reduce process VM size to 1.5G  The process memory is mirrored  Mapping in the upper and lower parts is the same  Don't double RAM usage  Each execution is checked against the mirror if code is not paged there PaX will terminate the process
  • 13. Seccomp  Module for sandboxing in the kernel (no virtualization)  Restrict process system calls  All child processes inherit the parent restrictions  Initially used for cloud computing  A user upload a program and it cannot abuse the server  Seccomp v2 supports dynamic policies  Each process defines the syscalls which he can use and then enter seccomp mode  On seccomp mode process can add more restrictions
  • 14. Namespaces  Create multiple processes trees  Process from child tree cannot affect parent tree  Ptrace  Kill  Each process has multiple PID's one for each nested tree
  • 15. Namespaces - network mounts  When using clone enter special network flag - CLONE_NEWNET  Each process have different set of network interfaces
  • 18. Communication  Using ssh daemon  Create special uds device from the init process and pass it down to the child trees  Using TCP
  • 19. CGroups  Create separate groups for similar tasks  Each group has restrictions  Resource limitation - memory usage  Prioritization - cpu share  Control - stop, restart,… a group  Each control group is in different namespace  In 2007 “container”

Editor's Notes

  • #16: If things where to stay asIf things where to stay before we would have shared resources between processes in trees whitout knowing which one broke the system (why is port 80 unavailable???)