2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-05 04:27:55 +00:00
Commit Graph

810 Commits

Author SHA1 Message Date
Vinícius Ferrão b7aa8eaa0f refactor(xcatd): keep command response state in CmdLog
Own collection, sensitivity, finalization, and reset as one request-scoped state object so xcatd only forwards callbacks and appends the finalized text.
2026-08-29 17:41:03 -03:00
Vinícius Ferrão 916091bfec refactor(xcatd): expose command log response handling 2026-08-29 17:15:23 -03:00
Vinícius Ferrão 999f18eacd Merge pull request #7737 from VersatusHPC/fix/cmdlog-response-classifier
fix(xcatd): classify secret responses by the shared secret set
2026-08-28 17:34:56 -03:00
Daniel Hilst a9a2c1f74e Merge pull request #7732 from VersatusHPC/fix/noderange-preauth
fix(xcatd): refuse the noderange ^file operator on unauthenticated requests
2026-08-28 17:32:33 -03:00
Daniel Hilst ff06b9f9ae Merge pull request #7731 from VersatusHPC/fix/xcatver-mismatch
fix(xcatd): only call a same-release build difference a build difference
2026-08-28 17:28:30 -03:00
Vinícius Ferrão 031ad68a41 fix(xcatd): classify secret responses by the shared secret set
The commands.log response classifier used a "passw" text match on the
request arguments. A secret whose name has no such text passed the
check, so a read of an authentication key, a privacy key or the snmpc
site value logged its bare value in the response. A command that
expands an argument also passed the check: nodels with a table name
returns every column of the table, and lsdef returns attributes that
the request never names. The daemon also ran redact_password over the
whole connection log on each request, so the redactor split at the
first request of the connection and the change signal swept the text of
earlier requests and responses.

Add secret_in_request. The routine reports a request that names a
secret attribute, selects a secret site key, or dumps a table that owns
a secret column through tabdump or nodels, from the same secret set
that the argument redaction uses. The response classifier calls it, so
the response of such a request logs as redacted.

Add secret_in_response. The routine reports response text that holds
"passw" or a secret attribute name in assignment or column form. The
response finalizer calls it in place of the bare text match, so an
expanded listing that carries an authentication key or a product key
logs as redacted even when the request never names it. The lsvm
response is the directory entry, whose passwords are positional, so
the classifier marks the command itself.

Build each request segment alone, redact the segment, and then append
it to the connection log. The redactor now always sees the current
command, and the change signal covers only the current request.
2026-08-26 12:14:21 -03:00
Vinícius Ferrão 719e5aecab fix(genesis): close consumer review gaps 2026-08-25 11:26:46 -03:00
Vinícius Ferrão f5d1bd8e73 fix(genesis): complete boot consumer wiring 2026-08-25 11:26:45 -03:00
Vinícius Ferrão 4457efbd1b feat(genesis): activate installed OpenEmbedded images 2026-08-25 11:26:44 -03:00
Vinícius Ferrão 109f587a7f fix(credentials): delegate node certificates through service nodes 2026-08-20 16:50:27 -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
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
Vinícius Ferrão b62c52b597 fix(xcatd): refuse the ^ file operator on an unauthenticated request
xcatd expands the request noderange before it authorizes the caller: once to
count the nodes, and once in validate() to match the policy rules. The ^
operator makes xcatd open a caller-named file at that point. A client can
connect without a certificate, because the listener does not require one, and
such a client has no peername.

Expand these two pre-authorization noderanges with nofile when the caller has
no peername (checked with defined, so the identity "0" still counts as
authenticated). If validate() finds a rejected ^file atom on such a request,
deny it. An authenticated caller expands ^file as before.
2026-08-18 14:12:12 -03:00
Vinícius Ferrão 7ad7293b71 fix(xcatd): only call a same-release build difference a build difference
xcatd warns "xCAT Version mismatch!" when a node's xCAT version differs
from the server's. It compared the full version strings, which include a
build-specific suffix such as " (git commit <hash>)". Two nodes at the
same release built from different snapshots then reported a version
mismatch on every request, even though the same release is ABI
compatible.

Keep warning when the versions differ, but tell the two cases apart. A
different release is still "xCAT Version mismatch!". The same release
built from a different commit now reports "xCAT build level differs (same
release):" instead, so the build difference is still visible without
being called a mismatch. Both messages show the full version strings.

Add xCAT::Version->Release, which returns the version without the
build-specific suffix, to make that distinction.

This was recovered from the lenovobuild branch, which stripped the older
"built <date>" suffix and dropped the same-release warning entirely; this
reimplements it for the current version format and keeps the build
difference visible.
2026-08-17 16:30:31 -03:00
Vinícius Ferrão 6e4cffddc3 feat(dhcp): default new Ubuntu sites to HMAC-SHA256
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-07-16 17:19:19 -03:00
Vinícius Ferrão 424b2e3e9b feat(dhcp): default new EL sites to HMAC-SHA256
Signed-off-by: Vinícius Ferrão <2031761+viniciusferrao@users.noreply.github.com>
2026-07-16 17:18:13 -03:00
Daniel Hilst 638f0d75c4 Fix xCAT 2.18 EL10 x86_64 package build issues
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
2026-06-20 18:48:14 -03:00
Markus Hilger ca6bafd723 Merge pull request #7553 from VersatusHPC/fix/tls-policy
feat: add xCAT TLS policy selection
2026-05-06 19:39:19 +02:00
Vinícius Ferrão 2915e9be0e Add xCAT TLS policy selection 2026-05-05 23:20:18 -03:00
Vinícius Ferrão 9f33b19214 fix: restore legacy SLES provisioning paths 2026-05-05 17:09:37 -03:00
Vinícius Ferrão 4165b26a04 fix: remove Docker container lifecycle management (dead code since 2016)
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
2026-05-03 12:11:33 -03:00
Vinícius Ferrão d455b82b1a fix: silent failure with no site master attribute (#7537)
* Fix silent failure when site.master is not set (#6157)

Hardware control commands (rpower, rinv, etc.) silently return no output
and exit 0 when site.master is empty. The original fix (#6074) was
reverted (#6158) because it warned per-node with the wrong hostname.

Check once in plugin_command before dispatching to plugins, so the error
appears exactly once with the correct command name.

* Also reject empty site.master, not only undef
2026-05-03 02:39:04 +02:00
Markus Hilger b1b0ca0396 Merge pull request #7535 from VersatusHPC/fix/plugin-error-message
fix: misleading plugin error message
2026-05-03 02:35:33 +02:00
Vinícius Ferrão b10865c5d4 Keep plugin bug label for XS crashes without $@
The else branch handles a rare case where XS libraries (Sys::Virt,
Net::SNMP) crash without setting $@. This IS a plugin bug, so keep
that label and the debug hint. Only the common case (die with $@)
gets the clean passthrough.
2026-05-02 17:09:54 -03:00
Vinícius Ferrão 34406828b9 Pass through actual error instead of generic "plugin bug" message
When a plugin dies during request processing, xcatd wrapped the error
in a misleading "plugin bug" message that hid the real cause (e.g.
"No space left on device"). Now passes through the actual error from
the eval, making the output useful for any failure, not just disk full.

Fixes #2719
2026-05-02 17:06:18 -03:00
Vinícius Ferrão 1babd7b0e4 fix: improve Ubuntu LTS provisioning support 2026-04-29 18:19:12 -03:00
Vinícius Ferrão 6f3d9bb9d1 Add Kea DHCP backend 2026-04-23 02:01:33 -03:00
Daniel Hilst Selli fccdc3ec64 fix: Fix genesis-base package build
Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
2026-03-30 20:46:42 -03:00
Daniel Hilst Selli 0e0ead786f fix: Fix genesis & sequential node discovery in x86_64
Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
2026-02-25 14:08:40 -03:00
Daniel Hilst Selli 83f6b74302 fix!: Skip settunnables if running inside a container
This commit adds an early return to xcatconfig settunnables function.
This function set parameters at

    /proc/sys/net/ipv4/neigh/default/gc_thresh1
    /proc/sys/net/ipv4/neigh/default/gc_thresh2
    /proc/sys/net/ipv4/neigh/default/gc_thresh3

And set sysctl attributes by writing to /etc/sysctl.d/ and
/etc/sysctl.conf

These are tunning network parameters for running on production
and should not affect the overall function for testing purposes.

Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
2025-12-05 13:33:57 -03:00
Daniel Hilst Selli b5e35483a2 fix: Fix certificate and hostkey generation for EL10
Signed-off-by: Daniel Hilst Selli <392820+dhilst@users.noreply.github.com>
2025-11-27 17:51:34 -03:00
Kilian Cavalotti 62522bc29f Support /etc/sysctl.d/ for Debian-based systems (#7509)
On Debian-based systems, /etc/sysctl.conf doesn't exist and
/etc/sysctl.d/ directory is used instead. Modified xcatconfig
to prefer /etc/sysctl.d/99-xcat.conf when the directory exists,
falling back to /etc/sysctl.conf for backward compatibility.
2025-11-14 01:50:10 +01:00
Markus Hilger f42011a493 Unify shebang lines 2024-05-07 16:43:07 +02:00
Mark Gurevich 60dfa47f37 Strip out extra text from version string 2023-03-01 11:45:42 -05:00
Mark Gurevich 1098e6943b Fix bind version comparison 2023-03-01 10:25:20 -05:00
Mark Gurevich a798d43019 Better module failure message 2022-05-19 16:28:01 -04:00
besawn 67ac4dd202 Added missing curly bracket to xcatconfig. 2022-05-06 15:11:16 -04:00
Kurt H Maier 8256685f86 xcatconfig: add ed25519 host key support 2022-03-25 10:24:44 -07:00
Mark Gurevich 3a0e2fe832 Turn off DNSSEC on Service Node for bind 9.16.6 2022-03-09 16:20:49 -05:00
Mark Gurevich 50f5c9040d Add cleanupdiskfullxcatpost attribute to site table 2021-08-12 16:11:17 -04:00
Mark Gurevich 85951981bb Redact passwords in log files 2021-06-29 13:48:33 -04:00
besawn 5b67d116f2 Merge pull request #6952 from peterwywong/xcatsnap
Update xcatsnap by collecting more files and improving its code
2021-04-23 17:52:20 -04:00
Wai Yee Wong 5430fde3a3 Update xcatsnap by collecting more files and improving its code 2021-04-23 11:19:43 -04:00
Mark Gurevich 3b65b2d89e Extend XML Simple to pass parser options 2021-03-11 09:26:18 -05:00
Mark Gurevich fa86dd4fbb Use XML::LibXML::Simple instead of XML::Simple 2020-05-01 17:06:22 -04:00
Markus Hilger 36dd1d14db SLE15: Fix makenamed.conf 2020-01-15 18:29:29 +01:00
Mark Gurevich 2c5e727be7 Use . instead of source to source xcat.sh file 2019-06-17 11:25:03 -04:00
zet809 e960063253 Revert "Fix issue that site.master is not set" 2019-03-22 18:18:12 +08:00
yangsong e56f768361 Merge pull request #6074 from zet809/fix_issue_miss_sitemaster
Fix issue that site.master is not set
2019-03-22 14:51:38 +08:00
Gᴏɴɢ Jie 8662b4925b Revert "[RH8] Revise xcatconfig, show warning message if `TLSv1' is used" 2019-03-15 00:01:27 +08:00