Skip to contentSkip to conversation

RFE: inheritance

DISCUSSION Ivan Gyurdiev 6 participants 11 messages Feb 27, 2005 – Mar 3, 2005 2 messages not in the archive SELinux security module

lore
Share & tools
lore
#0 lore raw

The Java problem is not solved yet.
The problem is that:
- Java needs its own domain due to legacy requirements
- Java should get all the permissions granted to user_t, since it's a programming language, not an application to be confined.
- Calling base_user_macro($1_java_t) will not work IMHO.

Additionally, I've been looking for a way to inherit from multiple types for a while. I posted about this some time ago re: sharing data between samba and httpd. It would be nice if there was an easy way to combine the rules for several domains. Somebody wrote a perl script about this, but I'm not sure what happened to that.

So, would it be possible to implement macros like INHERIT_SOURCE( { type 1, type 2, type 3 }, { new_type1, new_type2 }) INHERIT_TARGET( { type 1, type 2, type 3 }, { new_type1, new_type2 })

that post-process the policy, and do the following:

INHERIT_SOURCE is for granting a domain the access privileges of parent domains. It takes all rules that include type1, type2, type3.. as a source, and replicate those rules replacing typeX with new_type. Only the source is replaced, not the target. This would be used for inkscape, lame (if they're not fixed any time soon - I've emailed them), and Java.

INHERIT_TARGET would replicate rules that have the parent types in the target of the rule, and replace that with the derived type(s). Only the target is replaced, not the source. This would be used for marking a data type as derived from other data_types, for example, INHERIT_TARGET( { samba_share_t, httpd_sys_content_t }, samba_httpd_content_t)

So, for example, Java would INHERIT_SOURCE from user_t, so it would get the same privileges as user_t, but it would not INHERIT_TARGET, so things like file_type_auto_trans() would properly transition $1_java_t to the right user type.

Comments? I'm still trying to decide whether or not this is a stupid idea...

Signature · 8 lines
Ivan Gyurdiev <[email protected]>
Cornell University


--
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 14 lines · Ivan Gyurdiev

The Java problem is not solved yet.
The problem is that:
- Java needs its own domain due to legacy requirements
- Java should get all the permissions granted to user_t, since it's a programming language, not an application to be confined.
- Calling base_user_macro($1_java_t) will not work IMHO.

Additionally, I've been looking for a way to inherit from multiple types for a while. I posted about this some time ago re: sharing data between samba and httpd. It would be nice if there was an easy way to combine the rules for several domains. Somebody wrote a perl script about this, but I'm not sure what happened to that.

Quoted 5 lines

So, would it be possible to implement macros like INHERIT_SOURCE( { type 1, type 2, type 3 }, { new_type1, new_type2 }) INHERIT_TARGET( { type 1, type 2, type 3 }, { new_type1, new_type2 })

that post-process the policy, and do the following:

an object-orientated meta-macro, that does the work for you.

--
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.

#2 lore raw

Compromise of SHA1 and SElinux

Got a question for this list - the hash collision that was discussed by Rivest, Shamir, and Hoyt at RSA2005 is a serious one. Is there an initiative to upgrade SELinux tools to address these new liabilities in SHA1. Most folks are moving to SHA256 at minimum and to 512 if they can.

Todd

--
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.

#3 lore raw

Re: Compromise of SHA1 and SElinux

Quoted 4 lines · todd glassey

Got a question for this list - the hash collision that was discussed by Rivest, Shamir, and Hoyt at RSA2005 is a serious one. Is there an initiative to upgrade SELinux tools to address these new liabilities in SHA1. Most folks are moving to SHA256 at minimum and to 512 if they can.

You seem confused around the SHA-1 "hash collision" discussed in RSA2005, and also on the scope of SELinux, which AFAIK has nothing to do with cryptography, at least when talking about the stuff available in the public eye.Any crypto-related issue regarding Linux kernel code should be pointed to the CryptoAPI folks.

On the SHA-1 collisions, as you can read at [1], collisions were found in certain amounts of hash operations (SHA-1 2**69, SHA-0 2**39, 58-round SHA-1 2**33).I don't mean this is something to ignore, as *recognized* experts in the subject have talked on it seriously, and also I'm not someone really skilled in crypto terms, but, among that no *real* public information has been made, *currently*, the scope of this is *limited*.

Anyways, it's a matter of time to see *public* announcements about weakening of other algorithms.The point is a bit complex on that terms, just that people shouldn't scare when this information gets publicly available, they should do so when thinking on *how much* information is undisclosed and away of the public eye regarding these research efforts, even for proper information security (in governments, etc) or for other purposes (I would point at RSA SecurID embedded priv. keys, as an example).

Moving to an algorithm *publicly* known as more secure won't help in the game, as we won't know never if we are using something really secure.

In short, don't bother, don't scare, don't run away, just live with it ;)

Cheers,
PS: I wonder on why I've started writing more than just something like "This is not the right place for this" :)

Signature · 2 lines
Lorenzo Hernández García-Hierro <[email protected]> 
[1024D/6F2B2DEC] & [2048g/9AE91A22][http://tuxedo-es.org]
#4 lore raw

Re: Compromise of SHA1 and SElinux

In reply to todd glassey
Quoted 4 lines · todd glassey

Got a question for this list - the hash collision that was discussed by Rivest, Shamir, and Hoyt at RSA2005 is a serious one. Is there an initiative to upgrade SELinux tools to address these new liabilities in SHA1. Most folks are moving to SHA256 at minimum and to 512 if they can.

Umm... excuse me if I blinked, but where does SELinux even *use* SHA1 for anything?

Now the guys who wrote the BSD Seclevel LSM *do* need to look at upgrading, as that beast *does* use SHA1 for something.

#5 lore raw

Re: Compromise of SHA1 and SElinux

That was my point VMan. I couldn't remember anywhere where in SEL it was used but I though I would mention it for the sake of thoroughness.

Todd

----- Original Message -----
From: <[email protected]>
To: "todd glassey" <[email protected]>
Cc: <[email protected]>
Sent: Sunday, February 27, 2005 1:39 PM
Subject: Re: Compromise of SHA1 and SElinux

--
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.

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

Re: Fwd: Compromise of SHA1 and SElinux

Quoted 11 lines · Michael Halcrow
Quoted 4 lines

From: [email protected] <[email protected]>

Now the guys who wrote the BSD Seclevel LSM *do* need to look at upgrading, as that beast *does* use SHA1 for something.

The BSD Secure Levels module can accept a SHA1-hash of a passphrase when it initializes. It then hashes a plaintext passphrase that is later passed in to produce a SHA1 hash, which is compared against the SHA1 hash originally sent to the module; a match reduces the secure level.

Quoted 6 lines

From what I have read, this attack's scope is: Given m, you can find m' in 2^69 operations, such that H{m} = H{m'}.

If an attacker is ``given m'' in the first place, well, you're already screwed. I do not see how this attack could apply to BSD Secure Levels.

OK... I'll consider it "looked at".. ;) In some applications, the "given m" is accessible to the attacker (for instance, in a digital signature on a file). If inside seclvl (and any userspace helpers) the original SHA1 hash is never anyplace an attacker has access to without it being "game over" anyhow(*), then there's no real issue. I didn't feel qualified to trace the dataflow through, figured I'd leave that to somebody who understood it better...

(*) Sometimes it's shoot-self-in-foot time - I've seen more than one box where the admin set a Grub password that used MD5 - but /boot/grub/grub.conf was mode 644, and the password was easily brute-forced.... ;)

#9 lore raw
In reply to Ivan Gyurdiev
Quoted 6 lines · Ivan Gyurdiev

The Java problem is not solved yet.
The problem is that:
- Java needs its own domain due to legacy requirements
- Java should get all the permissions granted to user_t, since it's a programming language, not an application to be confined.
- Calling base_user_macro($1_java_t) will not work IMHO.

At least for java and other legacy binaries, this issue should be handled by the kernel change I've proposed. I have a final form of the patch ready for submission post 2.6.11. It will prevent SELinux from checking execmem and file execute when execute permission was not directly requested by the application and is only being added by the read-implies-exec logic in the kernel.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
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.
#10 lore raw
Quoted 8 lines · Stephen Smalley
Quoted 6 lines · Ivan Gyurdiev

The Java problem is not solved yet.
The problem is that:
- Java needs its own domain due to legacy requirements
- Java should get all the permissions granted to user_t, since it's a programming language, not an application to be confined.
- Calling base_user_macro($1_java_t) will not work IMHO.

Quoted 6 lines

At least for java and other legacy binaries, this issue should be handled by the kernel change I've proposed. I have a final form of the patch ready for submission post 2.6.11. It will prevent SELinux from checking execmem and file execute when execute permission was not directly requested by the application and is only being added by the read-implies-exec logic in the kernel.

What about execmod?

define(legacy_domain',
allow $1_t self:process { execmem };
allow $1_t { texrel_shlib_t shlib_t }:file execmod; allow $1_t ld_so_t:file execmod;
allow $1_t ld_so_cache_t:file execute;
')

Also, I still like the idea of inheritance for types, whether or not this problem is fixed differently.

Signature · 8 lines
Ivan Gyurdiev <[email protected]>
Cornell University


--
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.
#11 lore raw
Quoted 8 lines · Ivan Gyurdiev

What about execmod?

define(legacy_domain',
allow $1_t self:process { execmem };
allow $1_t { texrel_shlib_t shlib_t }:file execmod; allow $1_t ld_so_t:file execmod;
allow $1_t ld_so_cache_t:file execute;
')

Depends on whether execute permission to the modified mapping was directly requested by the application (including ld.so) or was added automatically by the kernel read-implies-exec logic. My patch only removes the need for execmod rules for the latter case.

Quoted 2 lines

Also, I still like the idea of inheritance for types, whether or not this problem is fixed differently.

The policy language used to include a 'clone' statement that allowed cloning all TE rules for a given type into another type, but it didn't seem to work very well in practice, so it was left to more customized definition by macros.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
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.
#12 lore raw
Quoted 8 lines · Stephen Smalley
Quoted 2 lines · Ivan Gyurdiev

Also, I still like the idea of inheritance for types, whether or not this problem is fixed differently.

The policy language used to include a 'clone' statement that allowed cloning all TE rules for a given type into another type, but it didn't seem to work very well in practice, so it was left to more customized definition by macros.

One other point to note - Tresys is working on a type hierarchy construct as part of their policy server work, but it is for the purpose of allowing administration of portions of the type space to be safely delegated to various roles by constraining each type to no more permissions than its parent type in the hierarchy. This differs from your notion of type inheritance.

Signature · 8 lines
Stephen Smalley <[email protected]>
National Security Agency


--
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.