Skip to content

disable_modules is a documented, promoted config option that has no effect #69984

Description

@dwoz

Problem

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/minion
disable_modules:
  - cmd

Restart minion.

salt '*' cmd.run 'id'
# still returns normally — cmd is loaded and callable

History

At some point between then and now, whatever enforcement code existed was
removed. The docs weren't updated.

Fix options

Pick one:

  1. 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.
  2. Officially deprecate. Remove the setting from docs, emit a warning
    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-side
    publisher_acl_blacklist.

Related: #69983, PR #69974.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions