2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-08-28 09:36:40 +00:00
Commit Graph

799 Commits

Author SHA1 Message Date
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 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
GONG Jie 05385f643c Show warning message if `TLSv1' is used 2019-03-14 14:03:31 +08:00
GONG Jie 240841483d Revise the warning messages 2019-03-13 18:09:57 +08:00
GONG Jie cc5068b683 Show warning message when site.xcatsslversion has an value during upgrade 2019-03-13 17:24:52 +08:00
ertaozh a56305ebeb Update warning message based on Victor's comments 2019-03-12 21:35:06 -04:00
ertaozh d6b418bfb0 Fix issue that site.master is not set 2019-03-12 05:35:35 -04:00
Gᴏɴɢ Jie 59bc53f573 Set the default value of site.xcatsslversion to SSLv23:!SSLv2:!SSLv3:!TLSv1 (#6061)
* Set $extrasslargs{SSL_version} as "SSLv23:!SSLv2:!SSLv3:!TLSv1" by default

* Remove xcatsslversion related part in script xcatconfig
2019-03-11 17:40:53 +08:00
zet809 b53100a59f Merge pull request #5929 from xcat2/master
Merge master branch to rhels8 branch
2019-01-08 13:40:21 +08:00
bxuxa cc6cb0f217 Clear key words for install status update log message (#5618)
- detect provisioning when updateing status to installing/netbooting
- consistent message format "xcat.updatestatus - ($node): changing status=($status)" (no need to log the time as syslog has the timestamp)
2018-11-27 15:19:21 +08:00
Gᴏɴɢ Jie fc49f012e6 For the newly installed xCAT-core, set site.xcatsslversion to TLSv1_2 as the default setting (#5798) 2018-11-23 11:29:13 +08:00
yangsong 92c019bdb3 set default value for $::XCATSITEVALS{httpport} if site.httpport is not specified (#5780) 2018-11-09 15:28:17 +08:00
cxhong fe33d7d98f Log Number of Nodes for xCAT command to command.log (#5729)
* Log Number of Nodes for chdef/mkdef/rmdef/lsdef/nodels command to
command.log

* Create a new tag for reponse object
2018-10-29 17:12:20 +08:00