access_control.rst 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. .. _acl:
  2. =====================
  3. Access Control System
  4. =====================
  5. .. versionadded:: 0.10.4
  6. Salt maintains a standard system used to open granular control to non
  7. administrative users to execute Salt commands. The access control system
  8. has been applied to all systems used to configure access to non administrative
  9. control interfaces in Salt.
  10. These interfaces include, the ``peer`` system, the
  11. ``external auth`` system and the ``publisher acl`` system.
  12. The access control system mandated a standard configuration syntax used in
  13. all of the three aforementioned systems. While this adds functionality to the
  14. configuration in 0.10.4, it does not negate the old configuration.
  15. Now specific functions can be opened up to specific minions from specific users
  16. in the case of external auth and publisher ACLs, and for specific minions in the
  17. case of the peer system.
  18. .. toctree::
  19. ../../ref/publisheracl
  20. index
  21. ../../ref/peer
  22. When to Use Each Authentication System
  23. ======================================
  24. ``publisher_acl`` is useful for allowing local system users to run Salt
  25. commands without giving them root access. If you can log into the Salt
  26. master directly, then ``publisher_acl`` allows you to use Salt without
  27. root privileges. If the local system is configured to authenticate against
  28. a remote system, like LDAP or Active Directory, then ``publisher_acl`` will
  29. interact with the remote system transparently.
  30. ``external_auth`` is useful for ``salt-api`` or for making your own scripts
  31. that use Salt's Python API. It can be used at the CLI (with the ``-a``
  32. flag) but it is more cumbersome as there are more steps involved. The only
  33. time it is useful at the CLI is when the local system is *not* configured
  34. to authenticate against an external service *but* you still want Salt to
  35. authenticate against an external service.
  36. Examples
  37. ========
  38. The access controls are manifested using matchers in these configurations:
  39. .. code-block:: yaml
  40. publisher_acl:
  41. fred:
  42. - web\*:
  43. - pkg.list_pkgs
  44. - test.*
  45. - apache.*
  46. In the above example, fred is able to send commands only to minions which match
  47. the specified glob target. This can be expanded to include other functions for
  48. other minions based on standard targets (all matchers are supported except the compound one).
  49. .. code-block:: yaml
  50. external_auth:
  51. pam:
  52. dave:
  53. - test.version
  54. - mongo\*:
  55. - network.*
  56. - log\*:
  57. - network.*
  58. - pkg.*
  59. - 'G@os:RedHat':
  60. - kmod.*
  61. steve:
  62. - .*
  63. The above allows for all minions to be hit by test.version by dave, and adds a
  64. few functions that dave can execute on other minions. It also allows steve
  65. unrestricted access to salt commands.
  66. .. note::
  67. Functions are matched using regular expressions.