Received: from goalie.tycho.ncsc.mil (goalie [144.51.31.250]) by tarius.tycho.ncsc.mil (8.13.1/8.13.1) with ESMTP id r3PLZCSM001852 for ; Thu, 25 Apr 2013 17:35:12 -0400 Message-ID: <1366925707.22597.YahooMailNeo@web163405.mail.gq1.yahoo.com> Date: Thu, 25 Apr 2013 14:35:07 -0700 (PDT) From: Andy Ruch Reply-To: Andy Ruch Subject: SELinux errors with pam_faillock To: SELinux ML MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="1091002116-147978722-1366925707=:22597" Sender: owner-selinux@tycho.nsa.gov List-Id: selinux@tycho.nsa.gov --1091002116-147978722-1366925707=:22597 Content-Type: text/plain; charset=us-ascii Hello, I'm receiving some SELinux errors related to the pam_faillock module. I'm running RHEL 6.3 with a custom policy based on the reference policy. When a user enters an incorrect password, the pam faillock module will track it with a file in /var/run/faillock/. This is being applied whenever the user enters their password (i.e. console login, newrole, sudo). Everything works appropriately for the console login. For newrole and sudo, I'm getting errors when the /var/run/faillock/ file is trying to be created. Basically, newrole_t and _sudo_t don't have permission to create files in a faillog_t dir. I found a rule in 'selinuxutil.te' allowing newrole_t to read/write to faillog: "auth_rw_faillog(newrole_t)". However, this rule only allows writing if the file already exists. It doesn't address if the faillock file needs to be created. I'm able to address the issues with the following rules: # Note that these rules would be applied in the sudo interface to support all sudo types create_files_pattern( sysadm_sudo_t, faillog_t, faillog_t ) setattr_files_pattern( sysadm_sudo_t, faillog_t, faillog_t )allow sysadm_sudo_t_t self:capability:chown; create_files_pattern( newrole_t, faillog_t, faillog_t ) setattr_files_pattern( newrole_t, faillog_t, faillog_t ) allow newrole_t self:capability:chown; Is this the correct solution? Or should a transition be happening when faillock executes? Thanks, Andy Ruch --1091002116-147978722-1366925707=:22597 Content-Type: text/html; charset=us-ascii
Hello,

I'm receiving some SELinux errors related to the pam_faillock module. I'm running RHEL 6.3 with a custom policy based on the reference policy.

When a user enters an incorrect password, the pam faillock module will track it with a file in /var/run/faillock/<user>. This is being applied whenever the user enters their password (i.e. console login, newrole, sudo). Everything works appropriately for the console login. For newrole and sudo, I'm getting errors when the /var/run/faillock/<user> file is trying to be created. Basically, newrole_t and <role>_sudo_t don't have permission to create files in a faillog_t dir.

I found a rule in 'selinuxutil.te' allowing newrole_t to read/write to faillog: "auth_rw_faillog(newrole_t)". However, this rule only allows writing if the file already exists. It doesn't address if the faillock file needs to be created.

I'm able to address the issues with the following rules:

# Note that these rules would be applied in the sudo interface to support all sudo types
create_files_pattern( sysadm_sudo_t, faillog_t, faillog_t )
setattr_files_pattern( sysadm_sudo_t, faillog_t, faillog_t )
allow sysadm_sudo_t_t self:capability:chown;

create_files_pattern( newrole_t, faillog_t, faillog_t )
setattr_files_pattern( newrole_t, faillog_t, faillog_t )
allow newrole_t self:capability:chown;

Is this the correct solution? Or should a transition be happening when faillock executes?

Thanks,
Andy Ruch
--1091002116-147978722-1366925707=:22597-- -- 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.