2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-08-26 16:46:41 +00:00
Commit Graph

27425 Commits

Author SHA1 Message Date
Vinícius Ferrão e1c5d1565c test(genesis): cover provisioning runtime 2026-08-20 22:29:56 -03:00
Vinícius Ferrão b632a6a94f feat(genesis): add provisioning runtime 2026-08-20 22:29:55 -03:00
Vinícius Ferrão 260a3a7079 build(genesis): add OpenEmbedded platform layer 2026-08-20 22:29:55 -03:00
Vinícius Ferrão a34576a3e6 Merge pull request #7738 from VersatusHPC/fix/genesis-service-node-certificates
fix(credentials): delegate node certificates through service nodes
2026-08-20 19:33:23 -03:00
Vinícius Ferrão 48e8a3b57d docs(hierarchy): document delegated signer addresses 2026-08-20 17:37:23 -03:00
Vinícius Ferrão bae92ffc47 fix(credentials): audit delegated certificate signing 2026-08-20 17:37:19 -03:00
Vinícius Ferrão 1f68e97f9e test(credentials): cover service node certificate delegation 2026-08-20 16:50:31 -03:00
Vinícius Ferrão 109f587a7f fix(credentials): delegate node certificates through service nodes 2026-08-20 16:50:27 -03:00
Daniel Hilst c6549352b9 Merge pull request #7724 from VersatusHPC/feat/mknb-exported-genesis
feat(mknb): install exported Genesis images
2026-08-20 13:00:24 -03:00
Vinícius Ferrão be020834f4 Merge pull request #7736 from VersatusHPC/fix/ci-apt-network-timeout
fix(ci): bound the apt network steps with timeouts and retries
2026-08-19 16:35:50 -03:00
Vinícius Ferrão 32b99b9d64 test(ci): require the bounded noninteractive apt install form
The guard held the exact unbounded apt-get install text, so the new
timeout wrapper failed it. Require the timeout command and allow the
apt transfer options, so an unbounded install now fails the guard.
2026-08-19 16:04:05 -03:00
Vinícius Ferrão b73a7ca1d3 fix(ci): bound the apt network steps with timeouts and retries
The PR test job ran apt-get against the xcat.org repository with no
time limit of its own. When the repository stalled, the job hung on the
update step until the sixty minute workflow limit canceled the run, and
the log gave no reason.

Wrap the apt-get update and install steps in a timeout command and give
apt a transfer timeout with retries. A stalled repository now fails the
step in minutes, the driver prints its install error report, and a
rerun is possible at once.
2026-08-19 15:46:28 -03:00
Daniel Hilst d7d71b2c5e Merge pull request #7735 from VersatusHPC/fix/redact-command-log-arguments
fix(xcatd): redact command-log arguments per element
2026-08-19 15:44:02 -03:00
Vinícius Ferrão 0d8d1e60ff test(xcatd): cover per-element command-log redaction
Extract the secret set, the command maps and the redaction routines from
xcatd.pm. Drive the real routines, because the module needs daemon
dependencies that the test host does not have.

Cover a multi-word value, a quoted value, spaces around the operator,
the "+=", ",=", "^=", "!=", "=~" and "!~" operators, the community
strings, a secret embedded in a compound argument with and without
quotes, each Getopt::Long password option form with bundles, the "?"
help letter, abbreviations, "+" prefixes and two-dash letters, values
that hold another secret letter, non-secret compact values that a value
option absorbs, long names that start with a secret letter, the mkvm
case forms and compact values, the chvm positional passwords, the mkvm
clone pw= operand, the vCenter cluster passwords, the snmpc site value
through chdef and tabch with compound selectors, the authentication
tokens, and the product keys. Assert that validate() redacts the
argument vector, that the joined result runs through redact_password,
and that the dispatch trace builds its text from redacted arguments.
Keep every attribute and column pair from Schema.pm, so a removed
table-qualified mapping fails the test.
2026-08-19 13:43:24 -03:00
Vinícius Ferrão 7fa755719a fix(xcatd): redact command-log arguments per element
The daemon redacted secret attributes on the joined command string. The
match failed when a value held a space. The match also failed for a "+="
splice assignment. The validate() path did not quote the arguments, so a
multi-word secret value kept its later words in syslog and in the
auditlog table. A password that a command receives through an option or
a positional operand was not redacted at all. The debug dispatch trace
wrote the raw arguments to syslog when site.xcatdebugmode was set.

Redact the argument vector before the daemon joins it. Add
redact_password_args for this task. The routine masks the value of a
secret attribute in any argument, at the start or embedded after another
token. An embedded secret assignment masks to the end of the argument,
because a shell value may hold quotes and spaces. The routine allows
spaces around the operator. It accepts the "=", "+=", ",=", "^=", "!=",
"=~" and "!~" operators that chdef, nodech and node selection use. It
masks a password option value in each form that Getopt::Long accepts: a
separate argument, a compact short option, a bundle of short options
with the "?" help letter, a "+" option prefix, a single-letter option
with two dashes, a long option, a long option with an equals sign, and
an abbreviated long option. The long-name match runs first, so a long
option keeps its name and masks its value. A walk over each bundle then
finds the first secret letter, so the mask always starts at the option
and the result does not depend on hash order. The walk knows which
other letters of a command take a value, so a secret letter inside such
a value does not redact and the audit text stays correct. The walk also
knows which letters take an integer, because the z/VM cpu option
consumes only its signed digits and the parser then continues the
bundle into the password option. The value stops match letter case,
because a bundle keeps short options case sensitive and an unknown
capital letter does not absorb the rest. The mkvm secret match ignores
letter case, because the z/VM parser keeps the Getopt::Long default for
long names. The mkhwconn match keeps letter case, because -p
is the hardware control point and -P is the password. The routine knows
the password options of bmcdiscover, switchdiscover, mkhwconn, mkvm,
createvcluster, lsvcluster and rmvcluster, the rspconfig password
assignments, the mkvm clone pw= operand, and the positional password
operands of chvm. It masks the site.value argument of tabch and chtab
when a selector or a site.key assignment names snmpc. An exact short
option that takes a non-secret value stays visible, so the PPC mkvm -p
profile is not an abbreviation of --password. The dispatch trace builds
its text from the redacted vector.

Add snmpc, productkey, prodkey.key, tokenid and token.tokenid to the
secret list, with community and pdu.community. The secret list holds
only attributes that map to a secret column, so key and sshkeydir stay
visible.

redact_password keeps a second pass over the joined string. This pass
masks an embedded secret assignment to the end of the line, because the
argument boundaries are gone after the join.

The commands.log response classifier marks a response sensitive when the
request was redacted. The argument vector pass sets that signal, so a
secret whose name has no "passw" text still marks its response.
2026-08-19 13:43:23 -03:00
Daniel Hilst 73fbf10e6b Merge pull request #7716 from VersatusHPC/fix/syncfiles-explicit-root-identity
fix(syncfiles): name root explicitly on the xdcp subrequest
2026-08-19 07:19:11 -03:00
Daniel Hilst 0330224009 Merge pull request #7718 from VersatusHPC/fix/mknb-upgrade-failure-visibility
build(packaging): report a failed mknb at the end of an upgrade
2026-08-19 07:08:17 -03:00
Daniel Hilst 11c55ae8ad Merge pull request #7717 from VersatusHPC/fix/makedhcp-restrict-sn-dispatch
fix(dhcp): only dispatch makedhcp to the service nodes serving the nodes
2026-08-19 07:05:03 -03:00
Daniel Hilst 33a400d37d Merge pull request #7715 from VersatusHPC/cleanup/deprecated-provisioning-deadcode
fix(xcat-server): remove the unreachable deprecated provisioning paths
2026-08-19 06:58:48 -03:00
Daniel Hilst 4e0c0f384c Merge pull request #7714 from VersatusHPC/fix/confluent-explicit-nodes
fix(confluent): configure nodes named explicitly without a console method
2026-08-19 06:52:16 -03:00
Daniel Hilst a5953cbc3d Merge pull request #7713 from VersatusHPC/fix/destiny-boot-sticky
fix(destiny): keep a node on boot when its destiny is advanced again
2026-08-19 06:49:26 -03:00
Daniel Hilst c913af608f Merge pull request #7711 from VersatusHPC/fix/otherpkgs-upgrade-scope
fix(otherpkgs): restrict the package upgrade to the xCAT repositories
2026-08-19 06:47:33 -03:00
Daniel Hilst d40f7cec71 Merge pull request #7734 from VersatusHPC/fix/commands-log-response-redact
fix(xcatd): redact secrets in the commands.log response
2026-08-18 17:52:07 -03:00
Vinícius Ferrão e9c8aaefbb test(xcatd): cover commands.log response redaction
Extracts the three command-log response subs and drives them. It checks the
request classification, the redaction of a bare passwd value, a secret split
across callbacks in either order, the password-content fallback, that a benign
response is kept, and that the finalizer preserves an earlier command's response
on a shared connection. It fails hard if a sub cannot be extracted.
2026-08-18 17:01:26 -03:00
Vinícius Ferrão eda5c35bba fix(xcatd): redact secrets in the commands.log response
xcatd redacts the request in commands.log but appends the command response
verbatim. A command whose output holds a secret writes it in clear text.
Examples are tabdump passwd, gettab of a passwd column, and getcredentials.

Collect the response into a per-command buffer. Set a sensitive flag when the
command is getcredentials, an argument names a password, or the request was
redacted. When the command finishes, replace the whole buffer if the flag is
set or the buffer still holds password content, then append the buffer. A
connection can carry more than one command, so the buffer is finalized at the
next command's start and at the end of the connection.

The buffer holds the full response, so a secret split across several callbacks
is also redacted. A per-callback check cannot do this.

The word-content check is a fallback. The request classification is the main
signal. A secret with no password marker, such as the output of an xdsh cat of
a shadow file, is a pre-existing leak of the root-only log. It is out of scope.

Recovered from the lenovobuild branch. Reimplemented against master.
2026-08-18 17:01:26 -03:00
Daniel Hilst 91505a2141 Merge pull request #7719 from VersatusHPC/fix/redact-password-attributes
fix(xcatd): redact node passwords from the command logs
2026-08-18 16:35:46 -03:00
Vinícius Ferrão 8a47a02762 Merge pull request #7729 from VersatusHPC/fix/noderange-file-load
fix(xcatd): stop a noderange from running a command through the ^ operator
2026-08-18 13:14:18 -03:00
Vinícius Ferrão dd930681a5 test(xcatd): cover the noderange ^ file operator
The test runs the real NodeRange code. It sends a ^ range that a
two-argument open would run as a command and checks the command does not
run. It also reads a real comment-only file to show the operator still
works.

The command assertion fails against the previous behavior.
2026-08-17 12:24:20 -03:00
Vinícius Ferrão e3e132967c fix(xcatd): stop a noderange from running a command through the ^ operator
The ^ noderange operator reads node names from a file. NodeRange opened
that file with a two-argument open. A two-argument open reads shell
metacharacters in the path, so a noderange such as ^"id|" ran a command.
xcatd expands a noderange while it processes a request, so the command
ran on the management node.

Use a three-argument open with an explicit read mode. The value is then
only ever a file name. The ^ operator keeps working: ^/tmp/nodes still
reads the file.

This fix was recovered from the lenovobuild branch. The original there
(commit for "Remove load from file in noderange support") removed the ^
operator. This keeps the documented operator and closes the command path
instead.
2026-08-17 12:24:20 -03:00
Vinícius Ferrão bdfe7a4a2c build(server): cover s390x Digest::SHA 2026-08-11 20:45:20 -03:00
Vinícius Ferrão 8f2c508950 fix(mknb): reject incomplete exports 2026-08-11 20:18:27 -03:00
Vinícius Ferrão 8f837f2839 docs(mknb): define exported image manifest 2026-08-11 20:13:44 -03:00
Vinícius Ferrão 9f64387291 test(mknb): cover export manifest validation 2026-08-11 20:13:26 -03:00
Vinícius Ferrão 05e35a12e8 fix(mknb): identify exported Genesis images 2026-08-11 20:12:51 -03:00
Vinícius Ferrão bc12f78a77 test(mknb): prepare export manifest fixture 2026-08-11 20:12:45 -03:00
Vinícius Ferrão c0de6337da test(server): check Digest::SHA dependencies 2026-08-11 20:11:01 -03:00
Vinícius Ferrão 2ba1048f24 build(server): require Digest::SHA 2026-08-11 20:10:40 -03:00
Vinícius Ferrão d0830e57b8 docs(mknb): describe exported Genesis images 2026-08-11 20:10:23 -03:00
Vinícius Ferrão 57360b89ff test(mknb): cover exported Genesis images 2026-08-11 20:10:22 -03:00
Vinícius Ferrão 26b4aec340 feat(mknb): install exported Genesis images 2026-08-11 20:10:22 -03:00
Vinícius Ferrão 875a6ef40d Merge pull request #7723 from VersatusHPC/fix/kea-xnba-network-fallback 2026-08-11 12:49:44 -03:00
Vinícius Ferrão be51b428a3 Merge pull request #7720 from VersatusHPC/fix/ci-noninteractive-install
fix(ci): make package validation noninteractive
2026-08-11 03:27:56 -03:00
Vinícius Ferrão d8464db7ac Merge pull request #7712 from VersatusHPC/fix/52-ubunturepo-builddir
fix(build-ubunturepo): scope the build lock + scratch under an option…
2026-08-11 03:25:48 -03:00
Vinícius Ferrão c211fdb3bb test(dhcp): cover Kea xNBA network fallback 2026-08-10 17:12:37 -03:00
Vinícius Ferrão caa4e838eb fix(dhcp): boot unknown xNBA clients with Kea 2026-08-10 17:12:17 -03:00
Vinícius Ferrão ff20a0041d Merge pull request #7722 from VersatusHPC/fix/mknb-genesis-boot-paths 2026-08-10 16:43:53 -03:00
Vinícius Ferrão 0b8c44b283 test(mknb): cover Genesis boot paths 2026-08-10 15:08:28 -03:00
Vinícius Ferrão aeb07dce85 fix(mknb): render Genesis boot paths correctly 2026-08-10 15:07:49 -03:00
Daniel Hilst edfe6a8840 fix(build-ubunturepo): scope the build lock per checkout so parallel-lane builds don't fail
build-ubunturepo guarded builds with a single host-global, fail-fast lock at
/var/lock/xcatbld.lock (`flock -n`). Two builds on one host -- e.g. the devel and
stable Ubuntu CD lanes on xcat-master-ub -- therefore collided on that one lock and
the loser exited 1 with "Can't get lock ...", failing the whole pipeline, even though
each lane builds from its own checkout into its own DEST and they share nothing.

build-ubunturepo builds its packages in-place in its own source checkout (it rewrites
debian/changelog and debian/control, drops *.orig.tar.gz at the checkout root and runs
dpkg-buildpackage inside the package dirs), so the resource two concurrent builds
actually contend for is the checkout, not the host. Key the lock on the checkout path
($curdir): builds of the SAME checkout still fail-fast (they would corrupt each other
in-place), while builds of DISTINCT checkouts get distinct locks and run in parallel.
The lock file stays on the local /var/lock (reliable flock, unlike the NFS/virtiofs
checkout) and the source tree is left byte-pristine.

Add xCAT-test/unit/build_ubunturepo_lock.t, which extracts the lock block from the
script verbatim and asserts: the lock path is /var/lock/xcatbld-<hash-of-checkout>.lock
and deterministic per checkout; a second build of the same checkout fails fast; two
distinct checkouts acquire their locks concurrently.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-08-10 10:26:03 -03:00
Vinícius Ferrão fca07665fe test(xcatd): cover password redaction in the logged commands
Run redact_password rather than inspecting its source, so that a secret which
survives is a failure here rather than something the shape of the code hides.
Each supported way of writing an assignment is exercised, including the table
qualified form and spaces around the equals sign, together with the positional
flag that the per-command table handles.

The expected set is derived from Schema.pm rather than repeated, so an attribute
added there with a secret column fails this test instead of quietly reaching the
logs, and the test bails if that mapping cannot be parsed so it cannot pass
vacuously. Detail that is not secret is asserted to survive, since redacting it
would cost the log its usefulness without protecting anything.
2026-08-09 14:01:11 -03:00