LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-17-2016, 09:57 PM   #1
surlac
LQ Newbie
 
Registered: Aug 2016
Posts: 14

Rep: Reputation: 0
SELinux: any benefit?


I'm reading about SELinux on Android, and I don't understand what are the benefits of using it?
You cannot define too many rules in policy, since it's slowing the system down. I thought normal DAC (permissions) provides every thing needed.
 
Old 10-18-2016, 05:27 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
SELinux provides mandatory permissions (MAC). DAC permissions can be changed by the file owner... MAC can't be bypassed by the user. This protects files by enforcing defined partitions between data, applications, processes.
 
Old 10-18-2016, 05:32 AM   #3
dac.override
LQ Newbie
 
Registered: Oct 2016
Posts: 24

Rep: Reputation: Disabled
SELinux is an *extension* to traditional Linux Access Control. Traditional Linux Access Control has two defining properties: 1. It is "identity-based" access control. 2. It is "de-centralized" access control (AKA discretionary access control)

SELinux aims to address challenges of "traditional identity-based DAC". DAC is coarse grained in that you generally have several process and files all associated with a single identity. DAC allows individual processes to govern security attributes of entities associated with it's identity.

SELinux defines itself as follows: Flexible and customizable access control framework that allows for fine grained mandatory (centralized) access control.

SEAndroid takes advantage of SELinux in several ways. A few ways that come to mind are: 1. ioctl whitelisting/blacklisting. 2. restricting the loading of kernel modules. Only kernel modules from trusted (encrypted) partitions can be loaded.

SELinux enables one to address the widest range of access control challenges.

Last edited by dac.override; 10-18-2016 at 05:37 AM.
 
1 members found this post helpful.
Old 10-18-2016, 07:05 AM   #4
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 4,448
Blog Entries: 7

Rep: Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553Reputation: 2553
Quote:
Originally Posted by dac.override View Post
SELinux enables one to address the widest range of access control challenges.
On a phone/tablet?

That's like building a car from 18 gauge steel. It may never get dented, but it'll be heavy!
 
Old 10-18-2016, 07:25 AM   #5
dac.override
LQ Newbie
 
Registered: Oct 2016
Posts: 24

Rep: Reputation: Disabled
Quote:
Originally Posted by rkelsen View Post
On a phone/tablet?

That's like building a car from 18 gauge steel. It may never get dented, but it'll be heavy!
The art is to achieve your goals in a efficient yet effective way. It is a myth that SELinux is "heavy". Whether SELinux implementations are "heavy" or not depends on the requirements.

The framework gives you the canvas, a wide variety of paint and brushes (most of it is implemented in Linux as a Linux Security Module). Whether you use it to create some complex or some really simple piece is up to you, and it depends on your requirements.

I think it speaks volumes that Android decided to use SELinux on their devices.
 
Old 10-18-2016, 01:32 PM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by rkelsen View Post
On a phone/tablet?

That's like building a car from 18 gauge steel. It may never get dented, but it'll be heavy!
Specially on a phone/tablet. Actually, it would be good everywhere.

The overhead for SELinux is around 3% when access is granted. If DAC rejects the access, the overhead is zero.
 
Old 10-19-2016, 08:35 PM   #7
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
I think that it is also worth noting that, today, there are other technologies ... (very specifically, "AppArmor") that might, today, be more to your liking.

These alternative technologies use the same operating-system "plumbing" that drives SELinux, but with a different and more-targeted approach, e.g. "I really [just] want to constrain Apache ..."
 
Old 10-19-2016, 09:42 PM   #8
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
They are also less reliable.

If you want to constrain Apache, they DON'T work very well. With SELinux you define what accesses are allowed, then assign that restriction to Apache.

With the others, you can't.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Get benefit ? amr_salah944 Linux From Scratch 11 05-29-2012 10:01 AM
Is any benefit of UTC? sluge Linux - Software 5 03-29-2012 08:55 PM
Implementing SeLinux on Debian 5 (Lenny) -- can't install "selinux-basics" bashFUL Linux - Security 3 10-17-2011 01:16 AM
SELinux errors, SELinux and wine ziphem Linux - Security 10 01-27-2011 04:15 PM
Selinux-how do i find out what domains have permissions on what type?(selinux policy) vishyc88 Linux - Security 2 11-22-2010 04:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration