File Access Policy Daemon - Whitelisting scanner
Whitelisting method for the scanner executables.
This section describes the methods to whitelist scanner services in File Access Policy Daemon.
By default, fapolicyd (File Access Policy Daemon) blocks the scan. To use the BigFix Inventory on such system it is needed to update the rules to allow execution of BigFix Scanner executables: wcitinst, wscancfg, wscansw, wscanfs, wscanhw and cpuid. Otherwise, the following actions will fail:
- Installation of the software scanner, Install or Upgrade Scanner fixlet fails
with error code 1 (
wcitinst / wcitcfg) - Initiate Software Scan fixlet completes, but all types of scan end with error
code 57 in the <computer_id>_citlog.log file located in
BESClient/LMT/CIT/ folder (
wscansw / wscanfs)Catalog scan failed: scanner finished with errors (57)
- Running capacity scanner Run Capacity Scan and Upload Results fails with
error code 2. (
wscanhw) - Detailed Hardware Information action Collect Detailed Hardware Information
fails with error code 1. (
wscanhw)
Enable the scanner to install, update, and perform scans on the endpoint
- Locate the first fapolicy file that contains any rule starting from
deny_Run the command:# grep deny_ /etc/fapolicyd/rules.d/*to get a list of the file with
deny_inside and locate the one with lowest number. - Create Custom Rules File Create a new rules file with a prefix
number lower than the first deny rule file. For example, if the first
deny rule is in
30-patterns.rules, create:/etc/fapolicyd/rules.d/29-bigfix.ruleswith the following content:<11.0.38.1>allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscancfg : dir=/opt/BESClient/allow perm=open auid=-1 exe=/opt/BESClient/bin/BESClient : all allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/installer/wcitinst : dir=/etc/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/installer/wcitinst : dir=/opt/BESClient/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/installer/wcitinst : path=/usr/bin/bash ftype=application/x-executable trust=1 allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/installer/wcitinst : dir=/usr/share/zoneinfo ftype=application/octet-stream allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscancfg : dir=/usr/lib64/gconv/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscancfg : dir=/etc/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscancfg : dir=/opt/BESClient/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscancfg : dir=/var/opt/BESClient/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscancfg : dir=/usr/lib/locale ftype=application/octet-stream allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscancfg : dir=/usr/share/locale ftype=text/plain allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscanfs : dir=/opt/BESClient/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscanfs : dir=/var/opt/BESClient/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscanfs : dir=/tmp/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscanfs : dir=/etc/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscanfs : dir=/usr/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscanhw : dir=/opt/BESClient/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscanhw : dir=/var/opt/BESClient/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscanhw : dir=/etc/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscanhw : dir=/usr/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscanhw : path=/usr/bin/bash ftype=application/x-executable trust=1 allow perm=execute auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscanhw : path=/opt/BESClient/tools/scanner/internal/bin/diskscan ftype=application/x-executable allow perm=execute auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscanhw : path=/opt/BESClient/tools/scanner/internal/bin/cpuid ftype=application/x-executable allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/cpuid : dir=/etc/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/cpuid : dir=/usr/share/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/cpuid : dir=/opt/BESClient/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/diskscan : dir=/etc/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/diskscan : path=/usr/bin/sg_map ftype=application/x-executable trust=1 allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/diskscan : path=/usr/sbin/dmsetup ftype=application/x-executable trust=1 allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/diskscan : path=/usr/sbin/lvm ftype=application/x-executable trust=1 allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscansw : dir=/opt/BESClient/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscansw : dir=/var/opt/BESClient/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscansw : dir=/etc/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscansw : dir=/usr/ allow perm=open auid=-1 exe=/opt/BESClient/tools/scanner/internal/bin/wscansw : dir=/tmp/ allow perm=open auid=-1 exe=/var/opt/BESClient/LMT/CIT/bzip2 : dir=/etc/ allow perm=open auid=-1 exe=/var/opt/BESClient/LMT/CIT/bzip2 : dir=/var/opt/BESClient/
- Add Scanner rules into the Custom Rules file:
#vi 29-bigfix.rules #copy/paste the rules into the file - Apply and activate the rule:
- Check the created rules: # fagenrules --check
- Compile and load the updated rules: # fagenrules --load
- Restart the fapolicyd service: # systemctl start fapolicyd
After restarting the fapolicyd in case of failed Scanner installation, run Uninstall Scanner fixlet and repeat installation. Otherwise repeat the failed operation to check if Scanner is allowed to executed on the endpoint.
Removing BigFix Scanner fapolicyd rules
- Go to rules directory: # cd /etc/fapolicyd/rules.d
- Identify and delete the custom rules file, e.g.: # rm 29-bigfix.rules
-
Run #fagenrules --load to reload configuration without custom rules
- Restart the fapolicyd service: # systemctl restart
fapolicyd
If there are still some issues with running BigFix Scanner try to investigate this as follows:
- Enable the debug mode for the fapolicyd denials
- Connect to the affected device
- Stop the fapolicy:# systemctl stop fapolicyd
- Start the fapolicyd with debug on# fapolicyd --debug-deny
- Keep the session open to watch the output
- From BigFix Console re-issue the failing action
- Watch the output on the console, first denial should be reported
- Get back to the affected device:
- Interrupt debug
- Adjust the configuration
- Run fagenrules --check to confirm that rules were correctly entered
- Run fagenrules --load to reload configuration
- Start debug: # fapolicyd --debug-deny again
- Repeat steps 2, 3 and 4 until no errors are reported.
- Start again fapolicyd: # systemctl start fapolicyd
See also Red Hat Documentation: Troubleshooting issues related to fapolicyd
- Enable the debug mode for the fapolicyd denials