publisheracl.rst 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. .. _publisher-acl:
  2. ====================
  3. Publisher ACL system
  4. ====================
  5. The salt publisher ACL system is a means to allow system users other than root
  6. to have access to execute select salt commands on minions from the master.
  7. .. note::
  8. ``publisher_acl`` is useful for allowing local system users to run Salt
  9. commands without giving them root access. If you can log into the Salt
  10. master directly, then ``publisher_acl`` allows you to use Salt without
  11. root privileges. If the local system is configured to authenticate against
  12. a remote system, like LDAP or Active Directory, then ``publisher_acl`` will
  13. interact with the remote system transparently.
  14. ``external_auth`` is useful for ``salt-api`` or for making your own scripts
  15. that use Salt's Python API. It can be used at the CLI (with the ``-a``
  16. flag) but it is more cumbersome as there are more steps involved. The only
  17. time it is useful at the CLI is when the local system is *not* configured
  18. to authenticate against an external service *but* you still want Salt to
  19. authenticate against an external service.
  20. For more information and examples, see :ref:`this Access Control System
  21. <acl_types>` section.
  22. The publisher ACL system is configured in the master configuration file via the
  23. ``publisher_acl`` configuration option. Under the ``publisher_acl``
  24. configuration option the users open to send commands are specified and then a
  25. list of the minion functions which will be made available to specified user.
  26. Both users and functions could be specified by exact match, shell glob or
  27. regular expression. This configuration is much like the :ref:`external_auth
  28. <acl-eauth>` configuration:
  29. .. code-block:: yaml
  30. publisher_acl:
  31. # Allow thatch to execute anything.
  32. thatch:
  33. - .*
  34. # Allow fred to use test and pkg, but only on "web*" minions.
  35. fred:
  36. - web*:
  37. - test.*
  38. - pkg.*
  39. # Allow admin and managers to use saltutil module functions
  40. admin|manager_.*:
  41. - saltutil.*
  42. # Allow users to use only my_mod functions on "web*" minions with specific arguments.
  43. user_.*:
  44. - web*:
  45. - 'my_mod.*':
  46. args:
  47. - 'a.*'
  48. - 'b.*'
  49. kwargs:
  50. 'kwa': 'kwa.*'
  51. 'kwb': 'kwb'
  52. Permission Issues
  53. -----------------
  54. Directories required for ``publisher_acl`` must be modified to be readable by
  55. the users specified:
  56. .. code-block:: bash
  57. chmod 755 /var/cache/salt /var/cache/salt/master /var/cache/salt/master/jobs /var/run/salt /var/run/salt/master
  58. .. note::
  59. In addition to the changes above you will also need to modify the
  60. permissions of /var/log/salt and the existing log file to be writable by
  61. the user(s) which will be running the commands. If you do not wish to do
  62. this then you must disable logging or Salt will generate errors as it
  63. cannot write to the logs as the system users.
  64. If you are upgrading from earlier versions of salt you must also remove any
  65. existing user keys and re-start the Salt master:
  66. .. code-block:: bash
  67. rm /var/cache/salt/.*key
  68. service salt-master restart
  69. Whitelist and Blacklist
  70. -----------------------
  71. Salt's authentication systems can be configured by specifying what is allowed
  72. using a whitelist, or by specifying what is disallowed using a blacklist. If
  73. you specify a whitelist, only specified operations are allowed. If you specify
  74. a blacklist, all operations are allowed except those that are blacklisted.
  75. See :conf_master:`publisher_acl` and :conf_master:`publisher_acl_blacklist`.