Information
OL 9 must configure SELinux context type to allow the use of a nondefault faillock tally directory.
GROUP ID: V-271836
RULE ID: SV-271836r1092637
Not having the correct SELinux context on the faillock directory may lead to unauthorized access to the directory.
Solution
Configure OL 9 to allow the use of a nondefault faillock tally directory while SELinux enforces a targeted policy.
Create a nondefault faillock tally directory (if it does not already exist) with the following example:
$ sudo mkdir /var/log/faillock
Update the /etc/selinux/targeted/contexts/files/file_contexts.local with "faillog_t" context type for the nondefault faillock tally directory with the following command:
$ sudo semanage fcontext -a -t faillog_t "/var/log/faillock(/.*)?"
Update the context type of the nondefault faillock directory/subdirectories and files with the following command:
$ sudo restorecon -R -v /var/log/faillock