highstate.cache contains secrets #67569
Replies: 10 comments
-
There is not a way to do this. as you can see from the docs here: https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.state.html#state-caching note:
so its expected behavior to write to this highstate cache file each time. |
Beta Was this translation helpful? Give feedback.
-
I get that it's expected behavior, but I think that should be revisited. There are cases where you might want salt to do something on a minion (like unlock drives) and NOT leave that data lying around on a boot drive in case someone physically stole the minion box. |
Beta Was this translation helpful? Give feedback.
-
We could possibly gate it around a config option. Ill approve as a feature. |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Beta Was this translation helpful? Give feedback.
-
I think this is still relevant. |
Beta Was this translation helpful? Give feedback.
-
Thank you for updating this issue. It is no longer marked as stale. |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Beta Was this translation helpful? Give feedback.
-
Is there a way to turn off stalebot for feature requests? I've had to open ~8 tickets over the past 24 hours to tell stalebot to go to hell... Obviously the developers are unpaid volunteers who are busy...but bugging users to see if the feature they requested is still a feature they requested is a bit annoying. If anything stalebot should say "hey devs, have you implemented this yet?" ;) |
Beta Was this translation helpful? Give feedback.
-
Thank you for updating this issue. It is no longer marked as stale. |
Beta Was this translation helpful? Give feedback.
-
Hi, I totally agree with @darkpixel We are considering using salt for our managed servers, but the fact that the secrets could be visible by anyone who has sudo right is a big no no for us. For now, as a workaround, I created a state file that remove the file on the minions: clear_highstate_cache:
file.absent:
- name: "/var/cache/salt/minion/highstate.cache.p" Not ideal, but it seems like it does the job. However, i'm wondering about the load of the salt master, as there's no cache on the minions anymore. I tested this solution with 3-4 minions and haven't noticed big load on the master, at least, not yet. Another way is to clear the cache using this formula: clear_highstate_cache:
cmd.run:
- name: "salt-call --local saltutil.clear_cache" It works as well, but not sure which one is the best between the two. Though, if we can have a better and cleaner solution from the devs, that be great. I'm really surprise that after 5 years, there's still no option to either disable the cache or encrypting the file |
Beta Was this translation helpful? Give feedback.
-
Description of Issue/Question
The highstate.cache.p file contains secret data.
Related to #28455
After reading through the documentation, I don't see a clear way to prevent strings in states or pillar data from being cached.
I played around with SDB using Hashicorp Vault as one suggested work-around. The secret data still ends up in the highstate.cache.p file.
Setup
Create a very simple luks.sls state like while changing 'xyz' to the ID of a drive you don't mind being destroyed:
will cause 'secret-password-123' to be cached.
Same with using Hashicorp Vault:
echo -n {{ salt['vault'].read_secret('secret/luks', 'passphrase') }}
...or in the pillar data.
Am I missing something? Is there a way to keep secret data from remaining on the minion?
I would like to use salt to automate unlocking a bunch of encrypted drives, but I don't want a passphrase hanging around on the boot drive in case someone breaks in and steals the machine.
As a side note, salt-ssh doesn't appear to leave behind a cache, although I'm guessing it probably writes the secrets to the drive at some point.
Versions Report
Beta Was this translation helpful? Give feedback.
All reactions