Skip to contentSkip to conversation

Untrusted applications under SELinux

DISCUSSION Gaurav Poothia 3 participants 3 messages Apr 12, 2006 – Apr 13, 2006 SELinux security module

lore
Share & tools
lore
#0 lore raw

I am researching security infrastructures that protect the TCB (or atleast some notion of trusted apps) from untrusted code.

In a paper titled "Meeting Critical Security Objectives with Security-Enhanced" you mention the relevant drawbacks of DAC:
" (Under DAC)....malicious programs are free to change the permissions associated with all of the user's objects, as well as disclose or alter the objects themselves."

Lets assume that user acquires an untrusted application. Its functionality is not well defined and even if it is the user is not inclined to type out a confinement policy tailored to this app.

Under this assumption can you please clarify how SELinux :
1.Ensures that the untrusted application doesnt compromise integrity of data owned by the executing UID.

2.Lets the app access the parts of the filesystem
and other resources (media related devices/net resources) which the domain it defaulted to (user_t in the strict policy?) might not have access to. In other words how do I get an unknown/untrusted app to work safely under the strict policy. This might be one reason for the targeted policy but what is the approximate solution to this?

Thanks and regards
-Gaurav

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 3 lines · Gaurav Poothia

Under this assumption can you please clarify how SELinux :
1.Ensures that the untrusted application doesnt compromise integrity of data owned by the executing UID.

There is no reasonable way to keep a user from shooting themselves in the foot.

SELinux is designed to contain the damage and protect the *other* user's feet.

Quoted 4 lines

2.Lets the app access the parts of the filesystem
and other resources (media related devices/net resources) which the domain it defaulted to (user_t in the strict policy?) might not have access to.

That's the protection that SELinux is giving you - keeping you out of stuff you shouldn't be accessing.

If you want to let this app access things the user can't, you're going to have to create an SELinux policy for the app, and use a transition...

#2 lore raw

Hi,

Quoted 1 line

There is no reasonable way to keep a user from shooting themselves in the foot.

I mostly agree here. There are some exceptions, though. But it all depends on how much the user is willing to give up in convenience stuff.

For example, you might not want to allow "untrusted" apps (e.g. webbrowsers) to read personal data files. However, this basically breaks all webmail applications, flickr and so on. People will often want their webbrowser to be able to read their photo collection, for example. This also applies to untrusted applications downloaded from the internet, let's say a photo manager. That application is untrusted, yet it needs to be able to write to your photo collection to be of use.

So it boils down to:
If the user wants a high security system, he needs to accept that:
- He sometimes needs to manually "transition" files from a "secured" part to an "unsecured" part (e.g. by copying files to a directory the browser can access before uploading them)
- He sometimes needs to manually transition files from a "unsecured" part to a secure part (e.g. moving downloaded files from the download folder to his photo collection)
- He can not just download and run applications that access his secured data.

You can do some high-effort security measures. For example, you might not allow the user to execute any of his downloaded files, or write his own applications.
But you can write an application that takes a downloaded file, virus-checks it and then puts it into a directory (read: relabel it) where he can execute it.
But that is a) inconvenient for the user b) still not too secure due to VMs and scripting languages and other means to dynamically load code that the virus scanner can't check.

Quoted 1 line

SELinux is designed to contain the damage and protect the *other* user's feet.

Well, DAC does try to do that already. SELinux tries to do so for *one* user, mostly for root. It prevents bugs in e.g. bind to be able to damage your other processes, despite running as root.

But deny-by-default (a key security concept) and unknown apps (security hell) basically boils down to "deny everything". (because "true" doesn't need any rights)
This security concept just doesn't mix with completely unknown apps!

You can however define a "confined_user_t" role that has only these access rights that you are willing to give to, well, applications you want to confine.
But this "you are willing" is very unspecific. You need to find out what you are willing to allow. I wouldn't include read access to the users home directory. Nor to his mail. Just to maybe /tmp (rwc), ~/download (rwc) and ~/upload (r), maybe ro access to some config files (for visual integration, e.g. .gtkrc)
and read access to common system libraries, but thats it.
I don't think this will be very useful, though. I don't know any applications I would use this with.

best regards,
Erich Schubert

Signature · 11 lines
    erich@(vitavonni.de|debian.org)    --    GPG Key ID: 4B3A135C    (o_
  A polar bear is a rectangular bear after a coordinate transform.   //\
     Zwei Freunde müssen sich im Herzen ähneln, in allem anderen     V_/_
        können sie grundverschieden sein. --- Sully Prudhomme



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.