Received: from mummy.ncsc.mil (mummy.ncsc.mil [144.51.88.129]) by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id m0VGUrgU014370 for ; Thu, 31 Jan 2008 11:30:53 -0500 Received: from fw5540.nrl.navy.mil (jazzhorn.ncsc.mil [144.51.5.9]) by mummy.ncsc.mil (8.12.10/8.12.10) with ESMTP id m0VGUqYA025037 for ; Thu, 31 Jan 2008 16:30:52 GMT Received: from chacs.nrl.navy.mil (sun1.fw5540.net [10.0.0.11]) by fw5540.nrl.navy.mil (8.13.6/8.13.6) with ESMTP id m0VGUqax001913 for ; Thu, 31 Jan 2008 11:30:52 -0500 (EST) Received: from chacs.nrl.navy.mil (sun1 [10.0.0.11]) by chacs.nrl.navy.mil (8.13.6/8.13.6) with SMTP id m0VGUq9w007911 for ; Thu, 31 Jan 2008 11:30:52 -0500 (EST) Received: (from PC05 [10.0.1.195]) by chacs.nrl.navy.mil (SMSSMTP 4.1.16.48) with SMTP id M2008013111305104814 for ; Thu, 31 Jan 2008 11:30:51 -0500 From: "Kim Lawson-Jenkins" To: Subject: problems updating /etc/shadow using strict example policy on Fedora Core 3 Date: Thu, 31 Jan 2008 11:28:35 -0500 Message-ID: <002501c86426$538c0800$c301000a@PC05> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0026_01C863FC.6AB60000" Sender: owner-selinux@tycho.nsa.gov List-Id: selinux@tycho.nsa.gov This is a multi-part message in MIME format. ------=_NextPart_000_0026_01C863FC.6AB60000 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi: I'm updating a legacy system where due to the SELinux policy a user was not permitted to replace an expired password. I gradually added allow statements to eliminate the AVC messages. The final SELinux change which corrupts the shadow file is allow system_chkpwd_t shadow_t:file { create setattr rename write unlink }; or more specifically including the write permission in the allow statement corrupts the shadow file. If the write permission is not included, an AVC is generated indicating we need to add the write permission. But when the write permission is included the shadow file is corrupted - the shadow file is updated without a hash of the new password and the user is allowed to log in without a password. So I'm wondering is there a SELinux patch I need for chkpwd? Or do I need to add/modify an allow statement for a process other than chkpwd to have the shadow file updated correctly? Here is the AVC message - Jan 10 19:00:24 nrl-xml-nkm kernel: audit(1200009624.533:0): avc: denied { write } for pid=16563 exe=/sbin/unix_chkpwd path=/etc/nshadow dev=dm-0 ino=5275736 scontext=system_u:system_r:system_chkpwd_t tcontext=system_u:object_r:shadow_t tclass=file This is a SELinux problem because when the system is in permissive instead of enforcing mode, the user can replace the expired password and the shadow file is updated correctly. I know most people ignored this email as soon as they saw the words "Fedora Core 3" in the subject heading. Any feedback would be greatly appreciated. Thanks in advance. Kim ------=_NextPart_000_0026_01C863FC.6AB60000 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi:

 

I’m updating a legacy system where due to the SELinux = policy a user was not permitted to replace an expired password.  I gradually = added allow statements to eliminate the AVC = messages.

 

The final = SELinux change which corrupts the shadow file is

 

allow = system_chkpwd_t shadow_t:file { create setattr rename write unlink = };

 

or more = specifically including the write permission in the allow statement corrupts the = shadow file.  If the write permission is not included, an AVC is generated indicating = we need to add the write permission.  But when the write permission is = included the shadow file is corrupted – the shadow file is updated without = a hash of the new password and the user is allowed to log in without a = password.  So I'm wondering is there a SELinux patch I need for chkpwd?  Or do = I need to add/modify an allow statement for a process other than chkpwd to have = the shadow file updated correctly?

 

Here is the = AVC message –

 

Jan 10 = 19:00:24 nrl-xml-nkm kernel: audit(1200009624.533:0): avc:  denied  { = write } for  pid=3D16563 exe=3D/sbin/unix_chkpwd path=3D/etc/nshadow = dev=3Ddm-0 ino=3D5275736 scontext=3Dsystem_u:system_r:system_chkpwd_t tcontext=3Dsystem_u:object_r:shadow_t = tclass=3Dfile

 

This is a = SELinux problem because when the system is in permissive instead of enforcing mode, the = user can replace the expired password and the shadow file is updated = correctly.

 

I know most = people ignored this email as soon as they saw the words “Fedora Core = 3” in the subject heading.  Any feedback would be greatly = appreciated.  Thanks in advance.

 

Kim

 

------=_NextPart_000_0026_01C863FC.6AB60000-- -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with the words "unsubscribe selinux" without quotes as the message.