Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DISA STIG secured Red Hat system: libraries failing to copy during mkrescue ('fapolicyd' hinders it) #2779

Closed
rtinsley87 opened this issue Mar 25, 2022 · 4 comments
Labels
external tool The issue depends on other software e.g. third-party backup tools. fixed / solved / done not ReaR / invalid The root cause is not in the ReaR code or ReaR is misused. support / question

Comments

@rtinsley87
Copy link

rtinsley87 commented Mar 25, 2022

Relax-and-Recover (ReaR) Issue Template

Fill in the following items before submitting a new issue
(quick response is not guaranteed with free support):

  • ReaR version ("/usr/sbin/rear -V"):
    2.6

  • OS version ("cat /etc/os-release" or "lsb_release -a" or "cat /etc/rear/os.conf"):
    Red Hat 8.5

  • ReaR configuration files ("cat /etc/rear/site.conf" and/or "cat /etc/rear/local.conf"):

export TMPDIR=/mnt/backup/Admin/tmp
OUTPUT=ISO
OUT_URL=file:///mnt/backup
COPY_AS_IS+=(/usr/lib*)
  • Hardware vendor/product (PC or PowerNV BareMetal or ARM) or VM (KVM guest or PowerVM LPAR):
    PC

  • System architecture (x86 compatible or PPC64/PPC64LE or what exact ARM device):
    x86 compatible

  • Firmware (BIOS or UEFI or Open Firmware) and bootloader (GRUB or ELILO or Petitboot):
    UEFI & GRUB

  • Storage (local disk or SSD) and/or SAN (FC or iSCSI or FCoE) and/or multipath (DM or NVMe):
    local SSD

  • Storage layout ("lsblk -ipo NAME,KNAME,PKNAME,TRAN,TYPE,FSTYPE,LABEL,SIZE,MOUNTPOINT"):

  • Description of the issue (ideally so that others can reproduce it):

This system is being setup for secure use so it was imaged
configured with the DISA stig for Red hat 8.5 with GUI.
When I run a the command "sudo rear -v mkrescue" it fails with a error warning

BUG in /usr/share/rear/build/default/990_verify_rootfs.sh line 48:
'\''ReaR recovery system in '\''/mnt/backup/Admin/tmp/rear.ssBwqpOHnTJkjO0/rootfs'\'' is broken: '\''bash -c true'\'' failed'\''

and it also shows this during recovery system test

/bin/bash: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: Operation not permitted

When I checked the rootfs folder under usr/lib libtinfo.so.6 is missing from the folder.
I tried including the configuration line LIBS=(libtinfo.so.6) and it will give a line
during the verbose run that says libtinfo.so.6 failed to copy.

  • Workaround, if any:
    tested on VM without controls implemented during imaging
    and just required grub2 modules to be installed

  • Attachments, as applicable ("rear -D mkrescue/mkbackup/recover" debug log files): rear-Thuja.log

@rtinsley87 rtinsley87 changed the title Secured Red Hat libraries failing to copy to rescue folder Secured Red Hat system: libraries failing to copy to rescue folder Mar 25, 2022
@rtinsley87 rtinsley87 changed the title Secured Red Hat system: libraries failing to copy to rescue folder Secured Red Hat system: libraries failing to copy dur mkrescue Mar 25, 2022
@jsmeix jsmeix added support / question external tool The issue depends on other software e.g. third-party backup tools. labels Mar 28, 2022
@jsmeix jsmeix changed the title Secured Red Hat system: libraries failing to copy dur mkrescue DISA stig secured Red Hat system: libraries failing to copy dur mkrescue Mar 28, 2022
@rtinsley87 rtinsley87 changed the title DISA stig secured Red Hat system: libraries failing to copy dur mkrescue DISA stig secured Red Hat system: libraries failing to copy during mkrescue Mar 28, 2022
@rtinsley87
Copy link
Author

rtinsley87 commented Mar 29, 2022

I was able to resolve this issue by adding "EXCLUDE_MOUNTPOINTS=(/dev/sdb)" to my local.conf. This was the secondary drive for the backup itself.

So the local.conf looks like this:

export TMPDIR="//mnt/backup/Admin/tmp"
BACKUP=NETFS
NETFS_KEEP_OLD_BACKUP_COPY=y
EXCLUDE_MOUNTPOINTS=(/dev/sdb)
OUTPUT=ISO
OUTPUT_URL=file:///mnt/backup/Admin/Rescue
BACKUP_PROG=rsync
BACKUP_URL=file:///mnt/backup/Admin/Backup
FULLBACKUP=THU

@rtinsley87
Copy link
Author

rtinsley87 commented Mar 29, 2022

Further investigating revealed that these settings didn't fix the issue but removing and re-installing fapolicyd application fixes it. This app controls app and file whitelist and is required under the stig

@jsmeix jsmeix changed the title DISA stig secured Red Hat system: libraries failing to copy during mkrescue DISA STIG secured Red Hat system: libraries failing to copy during mkrescue ('fapolicyd' hinders it) Mar 30, 2022
@jsmeix jsmeix added fixed / solved / done not ReaR / invalid The root cause is not in the ReaR code or ReaR is misused. labels Mar 30, 2022
@jsmeix
Copy link
Member

jsmeix commented Mar 30, 2022

@rtinsley87
thank you for your feedback what the actual root cause is.
Such feedback helps us at ReaR upstream a lot because now we know
there is no hidden bug in ReaR and - at least I - learned about
yet another security thingy that hinders what even 'root' can do
besides the well known suspects "AppArmor" and "SELinux"
(because "rear mkresue" runs as 'root' one assumes it has unlimited permissions).

You wrote "removing and re-installing fapolicyd":
According to
https://github.com/linux-application-whitelisting/fapolicyd
fapolicyd is a "File Access Policy Daemon" so I would assume
it should be sufficient to only stop this daemon before "rear mkrescue"
and re-start it afterwards.
But this removes fapolicyd protection while "rear mkrescue" is running
so I think a better solution would be to configure fapolicyd appropriately
so that "rear mkrescue" can work.
But I know nothing about fapolicyd whether or not it can be configured
this way with reasonable effort.

@rtinsley87
Copy link
Author

@jsmeix
Thank you for following up! My supervisor and I are Windows users mainly so I didn't think about fapolicyd being a daemon or service in Windows that I could stop instead. I believe what may have happened is that the daemon generates a default whitelist when it is initially installed which is during the OS installation and when I removed and reinstalled it generated a new default list that included everything currently on the system or maybe not to that extent. The point is that, the rescue ISO creation would work after the daemon was reinstalled and active as well as if I uninstalled it then ran rescue and then re-installed.

I agree that we should configure it correctly if we want to leave it installed. Thank you for providing the github link for fapolicyd so that we can understand it better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external tool The issue depends on other software e.g. third-party backup tools. fixed / solved / done not ReaR / invalid The root cause is not in the ReaR code or ReaR is misused. support / question
Projects
None yet
Development

No branches or pull requests

2 participants