Skip to content

Commit f7af8d5

Browse files
committed
Note security concerns with grains for targeting
Given that Vault is used for managing secrets, it seems useful to remind people that grains are generally minion-controlled when talking about using them to assign policies (and consequently give access to secrets). This is related to saltstack#43287, though only warns people of the issue, rather than resolving it by adding (eg) Pillar-based targeting. This change also cleans up some nearby style and formatting issues with the docs.
1 parent 89b815a commit f7af8d5

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

salt/modules/vault.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,16 @@
116116
.. versionchanged:: 3001
117117
118118
policies
119-
Policies that are assigned to minions when requesting a token. These can
120-
either be static, eg saltstack/minions, or templated with grain values,
121-
eg, ``my-policies/{grains[os]}``. ``{minion}`` is shorthand for grains[id],
122-
``saltstack/minion/{minion}``. .
119+
Policies that are assigned to minions when requesting a token. These
120+
can either be static, eg ``saltstack/minions``, or templated with grain
121+
values, eg ``my-policies/{grains[os]}``. ``{minion}`` is shorthand for
122+
``grains[id]``, eg ``saltstack/minion/{minion}``.
123+
124+
.. important::
125+
126+
See :ref:`Is Targeting using Grain Data Secure?
127+
<faq-grain-security>` for important security information. In short,
128+
everything except ``grains[id]`` is minion-controlled.
123129
124130
If a template contains a grain which evaluates to a list, it will be
125131
expanded into multiple policies. For example, given the template
@@ -135,16 +141,16 @@
135141
The minion will have the policies ``saltstack/by-role/web`` and
136142
``saltstack/by-role/database``.
137143
138-
Optional. If policies is not configured, ``saltstack/minions`` and
139-
``saltstack/{minion}`` are used as defaults.
140-
141144
.. note::
142145
143-
list members which do not have simple string representations,
146+
List members which do not have simple string representations,
144147
such as dictionaries or objects, do not work and will
145148
throw an exception. Strings and numbers are examples of
146149
types which work well.
147150
151+
Optional. If policies is not configured, ``saltstack/minions`` and
152+
``saltstack/{minion}`` are used as defaults.
153+
148154
keys
149155
List of keys to use to unseal vault server with the vault.unseal runner.
150156

0 commit comments

Comments
 (0)