Skip to content

docs: security, threat model, key lifecycle, and ACL rewrite - #69554

Closed
dwoz wants to merge 6 commits into
saltstack:3008.xfrom
dwoz:dwoz/docs/security-auth-3006x
Closed

dwoz wants to merge 6 commits into
saltstack:3008.xfrom
dwoz:dwoz/docs/security-auth-3006x

Conversation

@dwoz

@dwoz dwoz commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

NEEDS MAINTAINER REVIEW

This PR contains security guidance. Wrong security guidance is
actively dangerous and the docs claims should be reviewed by the
security WG before this leaves draft. The full list is in
agents/reports/docs-pr7-security/evidence.md; the highlights
that need explicit eyes:

  1. The new doc/security/threat-model.rst describes what Salt's
    wire protocol does not guarantee (e.g. minion ID is not bound
    to a host; rejected keys do not protect against replay; encrypted
    pillar does not protect against a compromised master). Each
    claim is cited to the source file, but please confirm the
    wording does not imply more or less than the code does.
  2. The "Granting @runner to a non-root user can invoke
    salt.cmd to re-publish as the master and bypass other ACL
    rules" warning in both the publisher_acl page and the threat
    model. This is true in code but is a strong claim; please
    confirm we want it phrased as a warning.
  3. The sign_pub_messages triple — master, minion, and
    require_minion_sign_messages + drop_messages_signature_fail
    — is documented in the RST reference for the first time. Please
    confirm the master-side option names are stable.
  4. The aws_kms walkthrough's encryption step in
    doc/topics/tutorials/aws_kms_pillar.rst calls aws kms decrypt --output text to get the plaintext data key for
    re-encryption. Depending on AWS CLI v1 vs v2 the form may need
    an extra base64.urlsafe_b64encode(). The docs note this; the
    maintainer should confirm which form Salt's release engineering
    uses today.

This PR stays in draft until a maintainer signs off on the
items above.


Summary

Security, auth, key-lifecycle, and ACL documentation rewrite. The
PR introduces two new reference pages
(doc/security/threat-model.rst, doc/security/key-lifecycle.rst),
a new aws_kms walkthrough
(doc/topics/tutorials/aws_kms_pillar.rst), parser-pinned ACL
example tests under tests/pytests/unit/test_acl_examples.py, and
a pre-commit helper (tools/check_new_config_opts.py) that gates
new config options against the doc + sample config triple. It also
clarifies several long-standing surprise behaviours in
rejected_retry, saltutil.regen_keys, sign_pub_messages, the
master_job_cache figure, and the non-root master grain set.

This lands on 3006.x (Sulphur). The auth, key, ACL and config
syntax has not changed in any of these areas between 3006.x and
master, so a bulk merge-forward to 3007.x → 3008.x → master after
this is merged should apply cleanly.

Linked issues

Closes:

Skipped per spec (already handled by docs-pr1-links):

What's in this PR

Reference pages (new):

  • doc/security/threat-model.rst — trust boundaries (minion ↔ master,
    master-side ACL, pillar/renderers, external sources, filesystem/process),
    onedir packaging implications.
  • doc/security/key-lifecycle.rst — accept / reject / rotate / regen /
    denied flows, rejected_retry, the sign_pub_messages trio.
  • doc/topics/tutorials/aws_kms_pillar.rst — end-to-end recipe.

Reference docs touched:

  • doc/ref/publisheracl.rst — quoted glob targets, regex-vs-glob warning,
    cmd.* warning, @wheel/@runner/@jobs section.
  • doc/topics/eauth/access_control.rst, doc/topics/eauth/index.rst —
    same fixes; @<modname> and function-list forms.
  • doc/ref/configuration/master.rst — sign_pub_messages,
    require_minion_sign_messages, drop_messages_signature_fail (first
    time in the RST).
  • doc/ref/configuration/minion.rst — sign_pub_messages (minion side,
    with naming-collision note); rejected_retry extended to cover denied
    keys.
  • doc/ref/configuration/nonroot.rst — grains affected when the master
    is non-root.
  • doc/topics/jobs/external_cache.rst — caption note for the
    master_job_cache figure.
  • doc/topics/tutorials/intro_scale.rst — AES rotation triggered by
    salt-key -r as well as salt-key -d.
  • doc/topics/hardening.rst — cross-link to the new pages.

Code docstrings:

  • salt/renderers/aws_kms.py — fixed YAML example, link to walkthrough.
  • salt/modules/saltutil.py — regen_keys requires restart.
  • salt/modules/haproxyconn.py — upstream-bug note.

Tests (new):

  • tests/pytests/unit/test_acl_examples.py (9 tests) — every documented
    publisher_acl / external_auth YAML is loaded with yaml.safe_load and
    then driven through CkMinions.auth_check / wheel_check /
    runner_check / spec_check. Drift between docs and parser fails
    the test.
  • tests/pytests/unit/tools/test_check_new_config_opts.py (9 tests) —
    unit tests for the new pre-commit helper.

Tools (new):

  • tools/check_new_config_opts.py — AST-scans salt/config/__init__.py
    for DEFAULT_*_OPTS keys and verifies they appear in both the
    matching conf/<daemon> sample and the matching
    doc/ref/configuration/<daemon>.rst reference. Supports
    --baseline so the hook only gates new drift, not the historical
    undocumented backlog. The pre-commit wiring (.pre-commit-config.yaml
    entry) is intentionally not added in this PR — a maintainer
    should decide which baseline file to start the gate from. The script
    is callable today and the test suite pins its behaviour.

Process:

  • CONTRIBUTING.rst — "New configuration options" section documenting
    the three-place rule and the helper.

Test plan

  • cd doc && sphinx-build -b html -W --keep-going — clean (the
    only output is two pre-existing paramiko TripleDES
    CryptographyDeprecationWarnings and the
    "Unable to load range library" log line on 3006.x; both predate
    this PR).
  • pytest tests/pytests/unit/test_acl_examples.py tests/pytests/unit/tools/test_check_new_config_opts.py tests/pytests/unit/test_acl.py tests/pytests/unit/renderers/test_aws_kms.py -v — 36 passed.
  • pre-commit run --files <every staged file> — every hook
    passes.
  • Sphinx linkcheck against the new pages (the existing make linkcheck is informational on 3006.x; verifier-agent will run
    this).

Branch matrix

Strategy is oldest-first on 3006.x with a bulk merge-forward. Every
file touched here exists on 3006.x, 3007.x, 3008.x, and master;
auth, key, and ACL syntax has not changed between branches in the
affected areas. The full file-by-file matrix is in
agents/reports/docs-pr7-security/branch-matrix.md (out of tree).

Notes for reviewers

  • The master_sign_pubkey tutorial link in
    doc/ref/configuration/master.rst still points at the public
    docs.saltproject.io URL because there is no in-tree equivalent;
    out of scope for this PR.
  • tools/check_new_config_opts.py is not wired into
    .pre-commit-config.yaml. Wiring it in this PR would either
    (a) need to ship a baseline file containing every currently
    undocumented opt (which we have not generated) or (b) fail every
    commit until that backlog is paid down. Both are out of scope.
    The script + tests are in place so a follow-up PR can flip the
    switch by generating a baseline and adding the hook entry.
  • The PR will not be marked ready for review until the
    second-pass verifier passes and a maintainer signs off on the
    HUMAN-REVIEW items at the top.

@dwoz dwoz added the test:full Run the full test suite label Jun 25, 2026
@dwoz dwoz added this to the Sulphur v3006.27 milestone Jun 25, 2026
@twangboy

twangboy commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

We are no longer accepting bug fixes on the 3006.x branch. Please rebase against the 3008.x branch.

@twangboy twangboy removed this from the Argon v3008.3 milestone Oct 1, 2026
@dwoz

dwoz commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

@dwoz 3006.x has entered security only. Please rebase these changes on 3008.x

@dwoz

dwoz commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Closing — 3006.x has entered security-only and this change doesn't apply or port cleanly to 3008.x. Reopen a fresh PR against 3008.x if you'd like to continue.

@dwoz dwoz closed this Oct 22, 2026
@dwoz dwoz mentioned this pull request Nov 1, 2026
2 of 3 tasks

This branch was previously deployed

1 inactive deployment
ci — 951917f0 Deployed Jun 26, 2026 by dwoz via Build Onedir Packages / RPM (x86_64) #24670
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants