diff --git a/ima-setup.sh b/ima-setup.sh index bc689f8..178f1fd 100755 --- a/ima-setup.sh +++ b/ima-setup.sh @@ -113,7 +113,7 @@ load_ima_policy() { # policy containing rules like "appraise obj_type=ifconfig_exec_t" can be # loaded [[ -e /etc/ima ]] || mkdir -p /etc/ima/ - if ! cp --preserve=xattr "$ima_policy_path" "$IMA_SYSTEMD_POLICY"; then + if ! cp --preserve=all "$ima_policy_path" "$IMA_SYSTEMD_POLICY"; then echo "Failed to copy $ima_policy_path to $IMA_SYSTEMD_POLICY" return 1 fi @@ -125,7 +125,7 @@ load_ima_keys # Include the dracut integrity module to load the IMA keys and policy # automatically when there is a system reboot if ! lsinitrd --mod | grep -q integrity; then - cp --preserve=xattr /usr/share/ima/dracut-98-integrity.conf /etc/dracut.conf.d/98-integrity.conf + cp --preserve=all /usr/share/ima/dracut-98-integrity.conf /etc/dracut.conf.d/98-integrity.conf echo "Rebuilding the initramfs of kernel-$(uname -r) to include the dracut integrity module" dracut -f