I have a script executed by a Java app with testmod_t context. This script does
chage -M -1 user to set a user to no expiry. However, when SELinux is enforcing, the command does not seem to do anything and the following appears in the audit log.
type=USER_MGMT msg=audit(1719390859.006:1359): pid=4342 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:testmod_t:s0 msg='op=change-age acct="" exe="/usr/bin/chage" hostname=? addr=? terminal=? res=failed'UID="root" AUID="unset" When SELinux is permissive, the chage command does work correctly and the following appears in the audit log:
type=USER_MGMT msg=audit(1719219933.759:2056): pid=8851 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:testmod_t:s0 msg='op=change-max-age id=1018 exe="/usr/bin/chage" hostname=? addr=? terminal=? res=success'UID="root" AUID="unset" ID="user" There is no "denied" message in the audit log.
When I tried
cat /var/log/audit/audit.log | audit2allow -M testmod it also prints "nothing to do".
Is there anything else I could do to find out why is SELinux affecting my script?