Bug 784121 - semanage is sending the wrong kind of audit events
Summary: semanage is sending the wrong kind of audit events
Alias: None
Product: Fedora
Classification: Fedora
Component: policycoreutils
Version: 19
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 784595 784619
TreeView+ depends on / blocked
Reported: 2012-01-23 21:19 UTC by Steve Grubb
Modified: 2015-01-14 13:15 UTC (History)
3 users (show)

Clone Of:
: 784595 784619 (view as bug list)
Last Closed: 2015-01-14 13:15:43 UTC

Attachments (Terms of Use)

Description Steve Grubb 2012-01-23 21:19:34 UTC
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:

Steps to Reproduce:
1. semanage user --add -R staff_r test
2. ausearch -m ROLE_ASSIGN --start recent

Comment 1 Steve Grubb 2012-01-23 21:23:33 UTC
Actually on further review, AUDIT_USER_ROLE_CHANGE is being sent by newrole, which is good. I guess semanage is simply missing assign/delete of roles to user accounts.

Comment 2 Daniel Walsh 2012-01-24 15:38:52 UTC
semanage login -a -s guest_u pwalsh

Wrote this record to the audit log.

time->Tue Jan 24 10:37:44 2012
type=USER_ROLE_CHANGE msg=audit(1327419464.300:60279): pid=0 uid=0 auid=3267 ses=7 subj=staff_u:unconfined_r:semanage_t:s0-s0:c0.c1023 msg='op=add SELinux user mapping acct="pwalsh" old-seuser=? old-role=? old-range=? new-seuser=guest_u new-role=? new-range=? exe=/usr/sbin/semanage hostname=? addr=? terminal=pts/0 res=success'

Comment 3 Steve Grubb 2012-01-24 15:52:26 UTC
That is the wrong kind of event. It should be AUDIT_ROLE_ASSIGN because you are adding something to the user's security attributes. Also, on delete I am not seeing the old role in the event:

type=USER_ROLE_CHANGE msg=audit(1327347475.071:2739): user pid=11644 uid=0 auid=4325 ses=1 subj=unconfined_u:unconfined_r:semanage_t:s0 msg='op=delete SELinux user record acct="test" old-seuser=? old-role=? old-range=? new-seuser=? new-role=? new-range=? exe=/usr/sbin/semanage hostname=? addr=? terminal=pts/0 res=success'

Not to mention I deleted a role and its telling me I deleted the user.

Comment 4 Milos Malik 2012-01-27 10:45:43 UTC
Correct me if I'm wrong:

ROLE_ASSIGN event should be returned when I run "semanage user --add -R staff_r test".
ROLE_REMOVE event should be returned when I run "semanage user --delete -R staff_r test".

What kind of event should be returned when I run "semanage user --modify -R user_r test" ?

Comment 5 Steve Grubb 2012-01-27 13:58:41 UTC
That is correct. For the time being, the modify should produce a ROLE_ASSIGN event. Someday in the future, we can make a ROLE_MODIFY event. But not right now.

Comment 6 Fedora End Of Life 2013-04-03 14:41:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:

Comment 7 Fedora End Of Life 2015-01-09 16:57:52 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Note You need to log in before you can comment on or make changes to this bug.