Bug 784595

Summary: semanage is sending the wrong kind of audit events
Product: Red Hat Enterprise Linux 6 Reporter: Steve Grubb <sgrubb>
Component: policycoreutilsAssignee: Daniel Walsh <dwalsh>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: high Docs Contact:
Priority: urgent    
Version: 6.2CC: dwalsh, ebenes, jwest, mgrepl, mmalik, msvoboda, mvadkert, slukasik
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: policycoreutils-2.0.83-19.19.el6 Doc Type: Bug Fix
Doc Text:
The semanage utility did not produce correct audit messages in the Common Criteria certified environment. This update modifies semanage so that it now sends correct audit events when the user is assigned to or removed from a new role. This update also modifies behavior of semanage concerning the user's SELinux Multi-Level Security (MLS) and Multi-Category Security (MCS) range. The utility now works with the user's default range of the MLS/MCS security level instead of the lowest. In addition, the semange(8) manual page has been corrected to reflect the current semanage functionality.
Story Points: ---
Clone Of: 784121 Environment:
Last Closed: 2012-06-20 11:10:31 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 784121    
Bug Blocks: 584498, 785678, 846801, 846802    

Description Steve Grubb 2012-01-25 08:59:15 EST
+++ This bug was initially created as a clone of Bug #784121 +++

Description of problem:
Semanage is sending the wrong kind of audit events. When a user is assigned a new role, an AUDIT_ROLE_ASSIGN event should be sent. When a user has a role removed, an AUDIT_ROLE_REMOVE event should be sent. When a user's process changes roles, like during login, its supposed to issue an AUDIT_USER_ROLE_CHANGE event.

Semanage is only sending AUDIT_USER_ROLE_CHANGE - which is the wrong kind of event.

How reproducible:
Always

Steps to Reproduce:
1. semanage login -a -s guest_u  test
2. ausearch -m ROLE_ASSIGN --start recent
Comment 1 Daniel Walsh 2012-01-25 17:22:42 EST
Fixed in policycoreutils-2.0.83-19.19.el6.src.rpm
Comment 3 Eduard Benes 2012-01-26 11:21:51 EST
Following audit-test trustedprograms tests will have to be reviewed and updated in the upstream test suite because they expect type=USER_ROLE_CHANGE:

./audit/libpam/tests/test_mls_default_login.bash
./audit/libpam/tests/test_mls_level_login.bash
./audit/libpam/tests/test_mls_level_login_fail.bash
./audit/trustedprograms/tests/test_newrole.bash
./audit/trustedprograms/tests/test_semanage_chglvl.bash
Comment 4 Steve Grubb 2012-01-26 11:59:55 EST
Logins and any use of newrole should still send USER_ROLE_CHANGE because the user is changing roles. But adding/deleting roles from a user's login database by using semanage with either of the -a or -d command line options are in fact affected by this patch. You should be able to grep the test suite looking for any use of semanage. If there is none, then the test suite is unaffected.
Comment 6 Miroslav Svoboda 2012-02-14 12:49:52 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
The semanage utility did not produce correct audit messages in the Common Criteria certified environment. This update modifies semanage so that it now sends correct audit events when the user is assigned to or removed from a new role.

This update also modifies behavior of semanage concerning the user's SELinux Multi-Level Security (MLS) and Multi-Category Security (MCS) range. The utility now works with the user's default range of the MLS/MCS security level instead of the lowest.

In addition, the semange(8) manual page has been corrected to reflect the current semanage functionality.
Comment 11 errata-xmlrpc 2012-06-20 11:10:31 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0969.html