hardening.rst 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. .. _hardening-salt:
  2. ==============
  3. Hardening Salt
  4. ==============
  5. This topic contains tips you can use to secure and harden your Salt
  6. environment. How you best secure and harden your Salt environment depends
  7. heavily on how you use Salt, where you use Salt, how your team is structured,
  8. where you get data from, and what kinds of access (internal and external) you
  9. require.
  10. General hardening tips
  11. ======================
  12. - Restrict who can directly log into your Salt master system.
  13. - Use SSH keys secured with a passphrase to gain access to the Salt master system.
  14. - Track and secure SSH keys and any other login credentials you and your team
  15. need to gain access to the Salt master system.
  16. - Use a hardened bastion server or a VPN to restrict direct access to the Salt
  17. master from the internet.
  18. - Don't expose the Salt master any more than what is required.
  19. - Harden the system as you would with any high-priority target.
  20. - Keep the system patched and up-to-date.
  21. - Use tight firewall rules.
  22. Salt hardening tips
  23. ===================
  24. - Subscribe to `salt-users`_ or `salt-announce`_ so you know when new Salt
  25. releases are available. Keep your systems up-to-date with the latest patches.
  26. - Use Salt's Client :ref:`ACL system <acl>` to avoid having to give out root
  27. access in order to run Salt commands.
  28. - Use Salt's Client :ref:`ACL system <acl>` to restrict which users can run what commands.
  29. - Use :ref:`external Pillar <all-salt.pillars>` to pull data into Salt from
  30. external sources so that non-sysadmins (other teams, junior admins,
  31. developers, etc) can provide configuration data without needing access to the
  32. Salt master.
  33. - Make heavy use of SLS files that are version-controlled and go through
  34. a peer-review/code-review process before they're deployed and run in
  35. production. This is good advice even for "one-off" CLI commands because it
  36. helps mitigate typos and mistakes.
  37. - Use salt-api, SSL, and restrict authentication with the :ref:`external auth
  38. <acl-eauth>` system if you need to expose your Salt master to external
  39. services.
  40. - Make use of Salt's event system and :ref:`reactor <reactor>` to allow minions
  41. to signal the Salt master without requiring direct access.
  42. - Run the ``salt-master`` daemon as non-root.
  43. - Disable which modules are loaded onto minions with the
  44. :conf_minion:`disable_modules` setting. (for example, disable the ``cmd``
  45. module if it makes sense in your environment.)
  46. - Look through the fully-commented sample :ref:`master
  47. <configuration-examples-master>` and :ref:`minion
  48. <configuration-examples-minion>` config files. There are many options for
  49. securing an installation.
  50. - Run :ref:`masterless-mode <tutorial-standalone-minion>` minions on
  51. particularly sensitive minions. There is also :ref:`salt-ssh` or the
  52. :mod:`modules.sudo <salt.modules.sudo>` if you need to further restrict
  53. a minion.
  54. .. _salt-users: https://groups.google.com/forum/#!forum/salt-users
  55. .. _salt-announce: https://groups.google.com/forum/#!forum/salt-announce