The selinux cases cover the management node and a compute node. A
hierarchical cluster has a service node, which installs xCAT itself and
serves /install and /tftpboot to its own nodes, and nothing measured it
under SELinux. A statelite node was not measured either, although
node_modes resolves it to disabled on purpose.
selinux_sn_enforcing reads the provisioned service node: getenforce,
the kernel command line, the xcat policy module, the labels of /install,
/tftpboot, /opt/xcat and /xcatpost, a restorecon dry run that must find
nothing to relabel, xcatd active, and no xCAT denial since boot.
selinux_sn_per_node_switch sets noderes.selinux on the service node and
reads the mode out of the kickstart that nodeset writes for it, in all
three directions, and checks that a value on the compute node does not
reach the service node.
selinux_cn_statelite_disabled_by_design asks for enforcing on a
statelite node and requires selinux=0 on its boot configuration, with
nodeset saying why.
selinux_bundle.t now keeps a service-node case out of the
management-node bundle, the same way it keeps a compute-node case out.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
selinux_bundle.t fails on this branch: selinux_client_domain is in no
bundle, so no run selects it. The case measures that an xCAT client
command execs and transitions into xcat_t, which is the check that a
client cannot run at all under enforcing.
Name it in selinux.bundle and selinux_mn.bundle. It needs no compute
node, so it belongs in both.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
No case in xCAT-test/autotest/testcase runs xcatprobe xcatmn, so a broken MN
check reaches a release unseen. The new case runs the probe and asserts that
the SELinux checkpoint appears and does not carry the FAIL marker.
The case cannot reach the enforcing mode. A management node under test runs
with SELinux disabled, and a disabled node needs a reboot and a relabel to
become enforcing. probe_utils_selinux.t covers the enforcing verdict.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Eight checks in the selinux testcases asserted ausearch output =~ "<no
matches>", which is zero denials of any kind in the window. A cluster
denies things xCAT has nothing to do with. On an idle enforcing
management node httpd asks the kernel for net_admin on itself every ten
seconds, and the base policy carries no dontaudit rule for that shape.
One node logged 1034 denials in a day, 817 of them that one shape. So
the assertion cannot pass once ausearch is called correctly, and before
--input-logs was added it could not fail.
selinux_avc_check.sh keeps the denials whose subject program or object
path belongs to xCAT and counts those. The cases assert XCAT_AVC=0.
selinux_mn_labels now also plants a denial on purpose: it mislabels
/install/postscripts/xcatdsklspost, shows httpd answering 403, and
requires the check to report XCAT_AVC=[1-9] before restoring the label.
A counting method with no positive control cannot be trusted to find
anything.
restorecon -RnvF reports a difference in the SELinux user as well as the
type, and the files xCAT writes carry unconfined_u. On one node -RnvF
printed 12 lines over /install where -Rnv printed 2. The checks use
-Rnv, which is the type they assert.
The six cases were in no bundle and in no pipeline conf, so none had
ever run, which is why the dead checks were not noticed.
selinux.bundle and selinux_mn.bundle name them, and selinux_bundle.t
fails when a case is in no bundle.
Tests: selinux_avc_check.bats drives the classifier with records
measured on an enforcing management node. Replacing the filter with one
that keeps every record fails 4 of its 8 checks; dropping the
object-path branch fails 2. selinux_bundle.t fails when selinux.bundle
is removed. selinux_kickstart_template.t asserted the relabel order with
a regex that matched wherever the relabel sat; it now compares line
positions, and moving #SELINUXRELABEL# above the xCAT post includes
fails it.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xcatprobe subcommands (xcatmn, discovery, osdeploy) and hierarchy.pm load
xCAT:: perl modules but only add $XCATROOT/probe/lib/perl to @INC, not the
main $XCATROOT/lib/perl where perl-xCAT ships them. The RPM builder stopped
embedding those helpers, so /opt/xcat/probe/lib/perl/xCAT/ was absent on
installed systems and the subcommands were reported "Unsupported sub command".
Stage GlobalDef.pm, NetworkUtils.pm and ServiceNodeUtils.pm into a temporary
xCAT-probe tree and build its source tarball once, before the parallel target
builds fork, so workers only read a complete archive. Add package-payload
regression tests. Adopts the approach from upstream PR #7581.
The remaining buildrpms.pl changes are deployment-compliance refactoring
(signed, self-contained core repo output).
Closes#7579
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Docker container lifecycle management (mgt=docker, mkdocker, rmdocker,
lsdocker) was added in 2015-2016 as an experiment targeting Docker API
v1.22 on Ubuntu only. Documentation and man pages were deliberately
removed in 2019 (PRs #6222 and #6324) with the original developer's
approval, noting that "the interface of Docker has become very simple
right now, so there is no value for xCAT to offer such functions."
The plugin was still being shipped but has had no functional code changes
since April 2016, was never listed as a valid mgt value in Schema.pm,
and no user ever filed an issue about it.
Removed:
- xCAT-server/lib/xcat/plugins/docker.pm (1,142 lines)
- xCAT/postscripts/setupdockerhost
- xCAT-server/share/xcat/scripts/setup-dockerhost-cert.sh
- xCAT-test/autotest/testcase/dockercommand/ (test cases)
- Docker attribute definitions in Schema.pm
- Client symlinks (mkdocker, rmdocker, lsdocker)
- Usage entries and dockerhost cert handling in credentials.pm
- Docker attribute documentation in man7 pages
The "Running xCAT in Docker" documentation (dockerized_xcat/) is
retained as it documents containerizing xCAT itself, not the removed
mgt=docker feature.
Closes#7518