2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-07-31 18:19:40 +00:00
Commit Graph

27304 Commits

Author SHA1 Message Date
Vinícius Ferrão 06eced0951 test(httpd): verify security response headers
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-07-27 17:18:57 -03:00
Vinícius Ferrão f6ba29ef80 build(spec): activate the hardened Apache headers on SUSE
The security response headers added to xcat.conf are wrapped in
<IfModule mod_headers.c>, so they only take effect where mod_headers is loaded.
EL loads it by default and the Debian postinst enables it with a2enmod, but SUSE
apache2 does not load it by default, so the headers stayed inactive there. Enable
it in the RPM %post for the apache2 case, guarded so it is a no-op on EL (where
a2enmod is absent and mod_headers is already loaded).

Verified on openSUSE Leap 15.6: mod_headers is off by default, the hardened
config still starts, and after a2enmod the served response carries all four
security headers. The need to load mod_headers on SUSE was identified in the
lenovobuild branch (660df81379 / xcat.conf.apach24.sles), here done via
a2enmod rather than a separate config file.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-27 17:18:57 -03:00
Vinícius Ferrão 9261a765bd fix(httpd): harden the xCAT Apache configuration
Add standard security response headers (X-Frame-Options, X-Content-Type-
Options, Content-Security-Policy, X-Permitted-Cross-Domain-Policies) to the
/install and /tftpboot directories, mask the server banner with
"ServerTokens Prod", and drop the Includes (SSI) and MultiViews options from
those file-serving directories. Indexes on /install/postscripts, /install/post
and the doc directory are left intact so directory browsing still works where
xCAT relies on it.

The Header directives are wrapped in <IfModule mod_headers.c> so a server
whose mod_headers is not loaded still starts cleanly instead of failing on an
unknown directive. On Debian/Ubuntu, where mod_headers is not enabled by
default, the xCAT and xCATsn package postinst scripts run "a2enmod headers"
before restarting Apache so the headers take effect there as well; on
RHEL/SLES the module is loaded by default and needs no action.

Recovered from the unmerged lenovobuild branch (originals 7ee0c129, 85c8bc09,
d4d1783a), adapted: the deprecated X-XSS-Protection header and the
mod_allowmethods-dependent AllowMethods directive are omitted, and the Header
directives use "set" rather than "append".

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-27 17:18:57 -03:00
Daniel Hilst eb76ddfbb6 Merge pull request #7673 from VersatusHPC/refactor/network-address-accumulation
refactor(network): centralize address accumulation
2026-07-27 15:32:09 -03:00
Daniel Hilst c8562284ee Merge pull request #7672 from VersatusHPC/harvest/blade-findme-nodetype
fix(blade): only scan a node MPA during discovery if it is a blade
2026-07-27 15:30:16 -03:00
Daniel Hilst 5fb329d2dc Merge pull request #7671 from VersatusHPC/harvest/bmcsetup-robustness
fix(bmcsetup): settle after IBM port change and support long BMC passwords
2026-07-27 15:28:14 -03:00
Daniel Hilst aeaf4df315 Merge pull request #7676 from VersatusHPC/harvest/sle-root-partition-max
fix(sle): give the SUSE root partition the whole disk (align with RHEL/Ubuntu)
2026-07-27 15:22:58 -03:00
Daniel Hilst 7ebb7ffc9a Merge pull request #7678 from VersatusHPC/refactor/ipmi-sha1-fallback
refactor(ipmi): centralize RMCP+ SHA1 fallback
2026-07-27 15:22:01 -03:00
Daniel Hilst d4d9d5c859 Merge pull request #7690 from VersatusHPC/harvest/port80
fix(netboot): omit the default HTTP port from generated boot URLs
2026-07-27 15:15:18 -03:00
Daniel Hilst c7c548fbb3 Merge pull request #7628 from VersatusHPC/harvest/xnba-ipxe-mac-format
fix(xnba): use the iPXE-native MAC format on the BIOS boot path
2026-07-27 15:12:06 -03:00
Daniel Hilst e2c57c636d Merge pull request #7647 from VersatusHPC/refactor/probe-netplan-command-capture
refactor(probe): reuse command capture for netplan
2026-07-27 12:27:36 -03:00
Daniel Hilst 4e891c4eaa Merge pull request #7692 from VersatusHPC/harvest/genimagenote
fix(genimage): explain the harmless bus messages from the image chroot
2026-07-27 11:28:42 -03:00
Daniel Hilst 433bdf015b Merge pull request #7693 from VersatusHPC/harvest/cfglocorig
fix(xcatserver): keep the server-provided cfgloc before rewriting host=
2026-07-27 11:27:38 -03:00
Daniel Hilst f28ad8587e Merge pull request #7694 from VersatusHPC/harvest/grub2-protocol-regex
fix(grub2): anchor the netboot protocol validation regex
2026-07-27 11:24:20 -03:00
Daniel Hilst 5bae5b2700 Merge pull request #7675 from VersatusHPC/harvest/reboot-systemd-timer-suse
fix(postscripts): schedule the reboot with a systemd timer on SUSE
2026-07-27 11:21:49 -03:00
Vinícius Ferrão 3967b83290 Merge pull request #7622 from VersatusHPC/harvest/xcatconfig-upgrade-log-stderr 2026-07-27 11:14:36 -03:00
Vinícius Ferrão 5c7230f0f8 Merge pull request #7623 from VersatusHPC/harvest/buildcore-describe-tags 2026-07-27 11:14:12 -03:00
Daniel Hilst e5bc261811 Merge pull request #7667 from VersatusHPC/harvest/ipmi-fpc-neverwait
fix(ipmi): never rate-limit packets to an FPC during reseat
2026-07-27 11:11:52 -03:00
Daniel Hilst 8fc3a309a0 Merge pull request #7670 from VersatusHPC/harvest/macmap-cumulus-breakout
fix(MacMap): discover nodes on Cumulus breakout ports (swpNsM)
2026-07-27 11:09:39 -03:00
Daniel Hilst a7455df957 Merge pull request #7649 from VersatusHPC/harvest/pasu-onecli-output-filter
fix(pasu): filter more OneCLI status banner lines from command output
2026-07-27 11:04:44 -03:00
Daniel Hilst caffd43e2d Merge pull request #7660 from VersatusHPC/harvest/ipmi-lenovo-recognition
fix(ipmi): recognize additional Lenovo IMM firmware prefixes and energy code
2026-07-27 10:55:02 -03:00
Daniel Hilst 34fd97ae63 Merge pull request #7666 from VersatusHPC/harvest/esx-esxboot-fallback
fix(esx): stage esxboot-x64.efi from the install media if missing
2026-07-27 10:39:05 -03:00
Daniel Hilst 38c0674394 Merge pull request #7663 from VersatusHPC/harvest/bmcsetup-walker-pass
fix(bmcsetup): support Intel Walker Pass (S9200WK) BMC LAN
2026-07-27 10:35:59 -03:00
Daniel Hilst 90b63577f5 Merge pull request #7664 from VersatusHPC/harvest/getinstdisk-vroc
fix(getinstdisk): use an Intel RSTe/VROC RAID when no other disk is found
2026-07-27 10:34:30 -03:00
Daniel Hilst 2533c4ac62 Merge pull request #7635 from VersatusHPC/harvest/rinv-deterministic-sort
fix(rinv): sort FRU output deterministically
2026-07-27 08:26:08 -03:00
Daniel Hilst defa2e3196 Merge pull request #7636 from VersatusHPC/harvest/nodestat-fping-missing-msg
fix(nodestat): report a clear error when fping is missing
2026-07-27 08:24:27 -03:00
Daniel Hilst 4729139cb1 Merge pull request #7637 from VersatusHPC/harvest/rspconfig-empty-option-msg
fix(rspconfig): clearer error when no option is given
2026-07-27 08:22:07 -03:00
Daniel Hilst efd205a407 Merge pull request #7642 from VersatusHPC/harvest/replaycons-usage-and-docs
fix(replaycons): print full usage on missing argument, document confluent log rotation
2026-07-27 07:59:22 -03:00
Daniel Hilst db9da9667f Merge pull request #7646 from VersatusHPC/harvest/bmcsetup-verify-before-set
fix(bmcsetup): skip BMC LAN settings that already match (verify before set)
2026-07-27 07:58:09 -03:00
Daniel Hilst d28e7b39e2 Merge pull request #7643 from VersatusHPC/harvest/docs-manpage-clarifications
docs: port man-page clarifications from lenovobuild
2026-07-27 07:52:47 -03:00
Daniel Hilst a6f93d26b9 Merge pull request #7605 from VersatusHPC/fix/kea-control-agent-runtime-paths
fix(dhcp): use Kea runtime paths
2026-07-26 08:33:58 -03:00
Vinícius Ferrão 39f721713e fix(netboot): omit the default HTTP port from generated boot URLs
Boot URLs handed to nodes always carried an explicit :80 even when the HTTP
server listens on the default port. grub2.pm already omits the port when it is
80; make the xNBA, genesis and DHCP boot URLs consistent with it.

$portsuffix is empty when site.httpport is unset or 80 and ":<port>" otherwise,
so a non-default port is unchanged. Covers the ISC and Kea paths in dhcp.pm,
xnba.pm, mknb.pm, and the Kea xNBA client classes in BootPolicy.pm.

dhcp_boot_policy.t and mknb_xcatd_address.t follow the new URLs and gain cases
for a non-default and an unset port. The floating-address guard in
mknb_xcatd_address.t also drops :80 so that it keeps matching.

Recovered from the unmerged lenovobuild branch (cd61fd9d, a2f77ea9, 1035841b,
b7db0e2, 792fe6d).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-26 03:14:50 -03:00
Vinícius Ferrão 4d8d5539b4 fix(pasu): filter more OneCLI status banner lines from command output
pasu strips OneCLI's banner and status lines so only the requested settings are
shown, but OneCLI has grown several status lines over the years that were not
filtered and leaked into the output. Add the missing patterns.

Recovered from the unmerged lenovobuild branch (229533cb, a6932bb4), which added
"Connected to BMC at IP address" (master only matched "by"), "Succeed in running
the command:" and "start to convert cmd.". Extended after testing a current
OneCLI 5.3.0 on a Lenovo ThinkSystem SR635, which also emits "Start to connect
...", "Connected to the node(N) by KCS" and a trailing "Succeed." -- now
filtered too.

Validated by running a real OneCLI 5.3.0 "config show" through the filter:
every banner/footer line is removed and all 756 setting lines pass unchanged.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-25 21:41:23 -03:00
Vinícius Ferrão 3684d900ef fix(replaycons): print full usage on missing argument, document confluent log rotation
When invoked with no node name, replaycons printed a terse "Please specify a
node name."  Print the full usage statement instead, consistent with -h.

Also document, in the man page, that confluent log rotation renames older logs
and how to replay one by appending the date suffix seen in
/var/log/confluent/consoles/.

Recovered from the unmerged lenovobuild branch (originals 1c1b23fac, 48a92b7d4).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-25 21:41:19 -03:00
Vinícius Ferrão 854babe0c5 fix(rspconfig): clearer error when no option is given
Running rspconfig against an mgt=ipmi node with no option fell through to the
generic "Unsupported command: rspconfig " message (with an empty option),
which does not tell the user what is wrong. Detect the empty option in
preprocess_request and report that options are required.

Recovered from the unmerged lenovobuild branch (original 08ae94bd).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-25 21:41:11 -03:00
Vinícius Ferrão 10945e7fee fix(nodestat): report a clear error when fping is missing
nodestat -f runs fping to reach the nodes; if the fping package is not
installed the pipe yielded no output and nodestat silently returned an empty
result. Check that an fping binary exists before running it and emit an
explicit "must install fping" error otherwise.

Recovered from the unmerged lenovobuild branch (original f0c88182), reworked
to test for the binary directly: the original inferred fping's presence from
whether the pipe produced output, which false-positived (reporting fping
missing) when fping was present but every node was unresolvable -- caught in
lab validation.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-25 21:41:07 -03:00
Vinícius Ferrão d08a264e9d fix(rinv): sort FRU output deterministically
The FRU key sort used only `$a <=> $b`, a numeric comparison that returns 0
for the non-numeric FRU field names, leaving them in hash-iteration order.
That order is randomized per process, so `rinv <node> all` printed its fields
in a different order on each run. Add `$a cmp $b` as a tiebreaker so the
output is stable.

Recovered from the unmerged lenovobuild branch (original 9cd3fac6).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-25 21:41:03 -03:00
Vinícius Ferrão 415ed2cb76 fix(xcatserver): keep the server-provided cfgloc before rewriting host=
The postscript rewrites host= in the freshly fetched /etc/xcat/cfgloc to point
at MASTER, discarding the database location the credentials came with. That is
the only record of it when the database does not live on the management node.

Keep it as cfgloc.orig; the existing chmod 600 /etc/xcat/cfgloc* covers it.

Recovered from the unmerged lenovobuild branch (10090a9d). The original also
replaced the atomic write with mv-then-sed, which leaves cfgloc truncated if
sed fails, so the write itself is left alone.

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-25 21:30:38 -03:00
Vinícius Ferrão 62ed60a4f0 fix(genimage): explain the harmless bus messages from the image chroot
systemd tooling run inside the image chroot has no bus to talk to and prints
"Failed to connect to bus: No such file or directory". The image builds
correctly, so say so at the end of the run instead of leaving it to be guessed.

Recovered from the unmerged lenovobuild branch (e372fb5b).

Co-authored-by: Jarrod Johnson <10814490+jjohnson42@users.noreply.github.com>
2026-07-25 21:30:35 -03:00
Vinícius Ferrão cb6a139286 fix(grub2): anchor the netboot protocol validation regex
noderes.netboot is parsed as grub2-<protocol> and validated with
/^http|tftp$/, which reads as (^http)|(tftp$) and so also accepts values
such as https, httpx and xtftp.

A value that passes but is not exactly "http" then falls through to
set root=$grub2protocol,$serverip, which drops site.httpport, so the mistake
surfaces as a confusing grub2 failure at boot instead of the "Invalid netboot
method" error this check exists to give. grub2-https cannot work in any case,
since only "insmod http" is emitted.

Supported values are unchanged: grub2, grub2-http and grub2-tftp.
2026-07-25 17:28:27 -03:00
Vinícius Ferrão 1034752080 test(kea): harden live Control Agent smoke 2026-07-25 01:26:46 -03:00
Vinícius Ferrão d155509345 test(kea): preserve named configuration group selection 2026-07-25 01:26:46 -03:00
Vinícius Ferrão a44e9fd819 refactor(kea): centralize service account lookup 2026-07-25 01:26:45 -03:00
Vinícius Ferrão 5c3bb1d9fa test(dhcp): cover Kea control socket paths 2026-07-25 01:26:45 -03:00
Vinícius Ferrão 543eab3bdc fix(dhcp): reuse Kea control socket paths 2026-07-25 01:26:45 -03:00
Daniel Hilst 3191b874a3 Merge pull request #7629 from VersatusHPC/harvest/template-xcatroot-fallback
fix(template): fall back to $::XCATROOT when XCATROOT is not in %ENV
2026-07-24 18:45:55 -03:00
Daniel Hilst 929aa3292e Merge pull request #7630 from VersatusHPC/harvest/networks-exclude-all-linklocal
fix(networks): make IPv6 route filtering in donets() robust
2026-07-24 18:44:17 -03:00
Daniel Hilst 137508bc06 Merge pull request #7632 from VersatusHPC/harvest/nodech-comma-groups
fix(nodech): support comma-delimited values in the ,= and ^= operators
2026-07-24 18:41:53 -03:00
Vinícius Ferrão 3aff408657 fix(test): load the installed networks plugin 2026-07-24 13:35:35 -03:00
Vinícius Ferrão a64b6c647e fix(template): preserve explicit XCATROOT values 2026-07-24 13:07:51 -03:00