mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-20 01:12:18 +00:00
cb4e7bc09b
The SELinux cases marked their audit window with date "+%H:%M:%S" and gave it to selinux_avc_check.sh. Two failures follow from the time window. The body of selinux_mn_labels runs inside one second, so an el9 run reported SEARCHED=0 and the guard called a quiet node a usage error. And ausearch -ts has one second of granularity, so the denials that the positive control of selinux_mn_labels creates on purpose landed in the window of selinux_restapi_avc, which failed with XCAT_AVC=2 on two httpd_t getattr records it did not cause. selinux_avc_check.sh takes a checkpoint file: --init consumes the records written so far and prints BASELINE, --since reports the denials after that point. A checkpoint is an offset, so an empty answer has one meaning and two cases cannot read one record. Each case opens its own checkpoint, and the positive control opens a second one, which also removes the sleep 1 that the granularity needed. The count refuses an answer that is neither a record nor '<no matches>', so an ausearch error message cannot read as a clean window. The -ts form stays for the keywords boot and today, and now asks for today's records before it calls an empty window a usage error. /xcatpost is reported and no longer asserted on a compute or service node. The kickstart relabel runs in %post, the xCAT post scripts write that tree at the first boot, and the node carries no xCAT-selinux, so a clean restorecon -Rnv there is not what the design promises. selinux_avc_check.bats fails 7 of its 15 checks without this change, on rome01. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>