Skip to contentSkip to conversation

/etc/passwd labeling issues

DISCUSSION Ed Street 3 participants 6 messages Apr 25, 2004 – Apr 27, 2004 SELinux security module

lore
Share & tools
lore

Ed Street

author
#0 lore raw

Hello,

As for the labeling issue for /etc/passwd I noticed in passwd.te this line

file_type_auto_trans($1_t, etc_t, shadow_t, file)

Wouldn’t this cause our labeling issue? If I remarked it out and added the following lines.

allow passwd_t etc_t:dir { add_name remove_name write };

allow passwd_t initrc_var_run_t:file { lock };

allow passwd_t passwd_t:process { setrlimit };

allow passwd_t shadow_t:file { write lock create getattr read rename setattr unlink };

then the labeling on /etc/passwd is the same domain. i.e.

-rw-r--r-- root root blacknet:object_r:etc_t /etc/passwd

Then the only issue is the username which is workable.

The question I have is why we need to patch passwd when this seems to be a policy issue.

Ed

---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.662 / Virus Database: 425 - Release Date: 4/20/2004

#1 lore raw
Quoted 5 lines · Ed Street

As for the labeling issue for /etc/passwd I noticed in passwd.te this line

file_type_auto_trans($1_t, etc_t, shadow_t, file)

If you don't have that then the new /etc/shadow file (with a complete copy of all /etc/shadow data) will briefly have the type etc_t and be readable by almost every domain.

Signature · 9 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

--
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.
author
#2 lore raw

Hello,

So we have 2 choices for our debian users. A) Change the password, change to permissive mode, relabel /etc/passwd and switch back to enforcement mode.
B) disallow all system users from changing passwords, adding users or modifying existing users Or C) the policy change that I pasted and run the risk of /etc/shadow being read by almost every domain. In either case a rogue daemon may compromise the system. Ideally the bug needs to be fixed but for the time being it's the less of the 3 evils.

Perhaps there's a line we could add to stop the /etc/shadow issue and not use the file_type_auto_trans macro.

Ed

-----Original Message-----
From: Russell Coker [mailto:[email protected]]
Sent: Sunday, April 25, 2004 11:04 PM
To: Ed Street
Cc: [email protected]
Subject: Re: /etc/passwd labeling issues

Quoted 5 lines · Ed Street

As for the labeling issue for /etc/passwd I noticed in passwd.te this line

file_type_auto_trans($1_t, etc_t, shadow_t, file)

If you don't have that then the new /etc/shadow file (with a complete copy of
all /etc/shadow data) will briefly have the type etc_t and be readable by almost every domain.

Signature · 16 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.667 / Virus Database: 429 - Release Date: 4/23/2004
 


--
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
Quoted 1 line · Ed Street

So we have 2 choices for our debian users. A) Change the password, change

No, we have only one realistic choice. To fix PAM and make it work correctly as it does in Fedora.

Signature · 9 lines
http://www.coker.com.au/selinux/   My NSA Security Enhanced Linux packages
http://www.coker.com.au/bonnie++/  Bonnie++ hard drive benchmark
http://www.coker.com.au/postal/    Postal SMTP/POP benchmark
http://www.coker.com.au/~russell/  My home page

--
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.
#4 lore raw
Quoted 5 lines · Russell Coker
Quoted 1 line · Ed Street

So we have 2 choices for our debian users. A) Change the password, change

No, we have only one realistic choice. To fix PAM and make it work correctly as it does in Fedora.

Or use the wrapper-based approach of the older SELinux, i.e. spasswd and friends.

As I recall, Fedora includes more than just a modified pam for this purpose; it also required modifications to libuser, shadow-utils, and components of util-linux to preserve contexts on /etc/passwd and /etc/shadow.

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.
author
#5 lore raw

Hello,

I would recommend using the wrapper because it can be generic in case of other issues like this, at least until the main problem is solved.

Ed

-----Original Message-----
From: Stephen Smalley [mailto:[email protected]]
Sent: Tuesday, April 27, 2004 11:42 AM
To: Russell Coker
Cc: Ed Street; Selinux
Subject: Re: /etc/passwd labeling issues

Quoted 2 lines · Russell Coker
Quoted 1 line · Ed Street

So we have 2 choices for our debian users. A) Change the password,

change

Quoted 2 lines

No, we have only one realistic choice. To fix PAM and make it work

correctly

Quoted 1 line

as it does in Fedora.

Or use the wrapper-based approach of the older SELinux, i.e. spasswd and friends.

As I recall, Fedora includes more than just a modified pam for this purpose; it also required modifications to libuser, shadow-utils, and components of util-linux to preserve contexts on /etc/passwd and /etc/shadow.

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

---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.667 / Virus Database: 429 - Release Date: 4/23/2004
 

---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.670 / Virus Database: 432 - Release Date: 4/27/2004
 


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