You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
disable_modules is documented as a way to prevent specific execution
modules from loading on a minion. It appears in:
doc/topics/hardening.rst:78 — literally suggests disable_modules: [cmd]
as a hardening measure
doc/ref/configuration/minion.rst:1845 — full documentation with a YAML
example
doc/topics/development/modules/configuration.rst:10 — cross-referenced
from developer docs
The setting is declared in salt/config/__init__.py:334 (schema) and
initialised to [] at line 1275. No code anywhere in salt/ reads it.
Grep the tree — only the schema declaration and default appear; no consumer.
Consequence
disable_modules accepts any value, prints no warning, and does nothing.
Users following the hardening docs believe they have disabled a module when
they haven't.
Reproduction
# /etc/salt/miniondisable_modules:
- cmd
Restart minion.
salt '*' cmd.run 'id'
# still returns normally — cmd is loaded and callable
History
Disabling CMD module on minion #25854 (2015) — user reported disable_modules: cmd didn't work; in
comments they discovered disable_modules: cmdmod (the filename, not the
virtualname) did — but that variant then broke the minion because
internals require cmd.
At some point between then and now, whatever enforcement code existed was
removed. The docs weren't updated.
Fix options
Pick one:
Restore the feature. Make the loader honour disable_modules again.
Note: this reintroduces the "many parts of salt use cmd" problem that
killed the original implementation. Combining it with whitelist_modules on the minion blocks internal module composition, forcing all-or-nothing security #69983 (which
expands whitelist_modules to only apply to the wire) would give a
coherent story: disable_modules blocks from the wire only, internals
keep working.
Problem
disable_modulesis documented as a way to prevent specific executionmodules from loading on a minion. It appears in:
doc/topics/hardening.rst:78— literally suggestsdisable_modules: [cmd]as a hardening measure
doc/ref/configuration/minion.rst:1845— full documentation with a YAMLexample
doc/topics/development/modules/configuration.rst:10— cross-referencedfrom developer docs
The setting is declared in
salt/config/__init__.py:334(schema) andinitialised to
[]at line 1275. No code anywhere insalt/reads it.Grep the tree — only the schema declaration and default appear; no consumer.
Consequence
disable_modulesaccepts any value, prints no warning, and does nothing.Users following the hardening docs believe they have disabled a module when
they haven't.
Reproduction
Restart minion.
History
disable_modules: cmddidn't work; incomments they discovered
disable_modules: cmdmod(the filename, not thevirtualname) did — but that variant then broke the minion because
internals require
cmd.publisher_acl_blacklistasworkaround.
At some point between then and now, whatever enforcement code existed was
removed. The docs weren't updated.
Fix options
Pick one:
disable_modulesagain.Note: this reintroduces the "many parts of salt use cmd" problem that
killed the original implementation. Combining it with whitelist_modules on the minion blocks internal module composition, forcing all-or-nothing security #69983 (which
expands
whitelist_modulesto only apply to the wire) would give acoherent story:
disable_modulesblocks from the wire only, internalskeep working.
if it appears in config, and drop it in a future release. Direct users
to
whitelist_modules(once whitelist_modules on the minion blocks internal module composition, forcing all-or-nothing security #69983 lands) plus master-sidepublisher_acl_blacklist.Related: #69983, PR #69974.