Saltstack Official OpenSSH Formula
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

230 lines
9.1KB

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=yaml
  3. ---
  4. # yamllint disable rule:line-length
  5. # Using a stripped down version of both `sshd_config` and `ssh_config` here
  6. # The values introduced by the initial commit are taken from the Travis
  7. # instances themselves
  8. # Care must be taken when modifying this, not to lock out Travis before the
  9. # `kitchen verify` stage takes place, resulting in:
  10. # ```
  11. # $$$$$$ [SSH] connection failed, terminating (#<Net::SSH::AuthenticationFailed: Authentication failed for user kitchen@localhost>)
  12. # >>>>>> ------Exception-------
  13. # >>>>>> Class: Kitchen::ActionFailed
  14. # >>>>>> Message: 1 actions failed.
  15. # >>>>>> Failed to complete #verify action: [Transport error, can't connect to 'ssh' backend: SSH session could not be established] on ...
  16. # ```
  17. # yamllint enable rule:line-length
  18. sshd_config:
  19. ChallengeResponseAuthentication: 'no'
  20. X11Forwarding: 'yes'
  21. PrintMotd: 'no'
  22. AcceptEnv: "LANG LC_*"
  23. Subsystem: "sftp /usr/lib/openssh/sftp-server"
  24. UsePAM: 'yes'
  25. ssh_config:
  26. Hosts:
  27. '*':
  28. GSSAPIAuthentication: 'yes'
  29. HashKnownHosts: 'yes'
  30. SendEnv: 'LANG LC_*'
  31. openssh:
  32. # Instead of adding a custom banner file you can set it in pillar
  33. banner_string: |
  34. Welcome to {{ grains['id'] }}!
  35. # Set installed package version
  36. server_version: latest
  37. client_version: latest
  38. # Controls if SSHD should be enabled/started
  39. sshd_enable: true
  40. auth:
  41. joe-valid-ssh-key-desktop:
  42. - user: joe
  43. present: true
  44. enc: ssh-rsa
  45. comment: main key - desktop
  46. source: salt://ssh_keys/joe.desktop.pub
  47. joe-valid-ssh-key-notebook:
  48. - user: joe
  49. present: true
  50. enc: ssh-rsa
  51. comment: main key - notebook
  52. source: salt://ssh_keys/joe.netbook.pub
  53. joe-non-valid-ssh-key:
  54. - user: joe
  55. present: false
  56. enc: ssh-rsa
  57. comment: obsolete key - removed
  58. source: salt://ssh_keys/joe.no-valid.pub
  59. # Maps users to source files
  60. # Designed to play nice with ext_pillar
  61. # salt.states.ssh_auth: If source is set, comment and enc will be ignored
  62. auth_map:
  63. personal_keys: # store name
  64. source: salt://ssh_keys
  65. users:
  66. joe:
  67. joe.desktop: {}
  68. joe.netbook:
  69. options: [] # see salt.states.ssh_auth.present
  70. joe.no-valid:
  71. present: false
  72. generate_dsa_keys: false
  73. absent_dsa_keys: false
  74. provide_dsa_keys: false
  75. dsa:
  76. private_key: |
  77. -----BEGIN DSA PRIVATE KEY-----
  78. NOT_DEFINED
  79. -----END DSA PRIVATE KEY-----
  80. public_key: |
  81. ssh-dss NOT_DEFINED
  82. generate_ecdsa_keys: false
  83. absent_ecdsa_keys: false
  84. provide_ecdsa_keys: false
  85. ecdsa:
  86. private_key: |
  87. -----BEGIN EC PRIVATE KEY-----
  88. NOT_DEFINED
  89. -----END EC PRIVATE KEY-----
  90. public_key: |
  91. ecdsa-sha2-nistp256 NOT_DEFINED
  92. generate_rsa_keys: false
  93. generate_rsa_size: 4096
  94. # Will remove the old key if it is to short and generate a new one.
  95. enforce_rsa_size: false
  96. absent_rsa_keys: false
  97. provide_rsa_keys: false
  98. rsa:
  99. private_key: |
  100. -----BEGIN RSA PRIVATE KEY-----
  101. NOT_DEFINED
  102. -----END RSA PRIVATE KEY-----
  103. public_key: |
  104. ssh-rsa NOT_DEFINED
  105. generate_ed25519_keys: false
  106. absent_ed25519_keys: false
  107. provide_ed25519_keys: false
  108. ed25519:
  109. private_key: |
  110. -----BEGIN OPENSSH PRIVATE KEY-----
  111. NOT_DEFINED
  112. -----END OPENSSH PRIVATE KEY-----
  113. public_key: |
  114. ssh-ed25519 NOT_DEFINED
  115. known_hosts:
  116. # The next 2 settings restrict the set of minions that will be added in
  117. # the generated ssh_known_hosts files (the default is to match all minions)
  118. target: '*'
  119. tgt_type: 'glob'
  120. # Name of mining functions used to gather public keys and hostnames
  121. # (the default values are shown here)
  122. mine_keys_function: public_ssh_host_keys
  123. mine_hostname_function: public_ssh_hostname
  124. # List of DNS entries also pointing to our managed machines and that we want
  125. # to inject in our generated ssh_known_hosts file
  126. aliases:
  127. - cname-to-minion.example.org
  128. - alias.example.org
  129. # Includes short hostnames derived from the FQDN
  130. # (host.example.test -> host)
  131. # (Deactivated by default, because there can be collisions!)
  132. hostnames: false
  133. # hostnames:
  134. # Restrict wich hosts you want to use via their hostname
  135. # (i.e. ssh user@host instead of ssh user@host.example.com)
  136. # target: '*' # Defaults to "*.{{ grains['domain']}}"
  137. # tgt_type: 'glob'
  138. # To activate the defaults you can just set an empty dict.
  139. # hostnames: {}
  140. # Include localhost, 127.0.0.1 and ::1 (default: false)
  141. include_localhost: false
  142. # Host keys fetched via salt-ssh
  143. salt_ssh:
  144. # The salt-ssh user
  145. user: salt-master
  146. # specify public host names of a minion
  147. public_ssh_host_names:
  148. minion.id:
  149. - minion.id
  150. - alias.of.minion.id
  151. # specify public host keys of a minion
  152. public_ssh_host_keys:
  153. minion.id: |
  154. ssh-rsa [...]
  155. ssh-ed25519 [...]
  156. # Here you can list keys for hosts which are not among your minions:
  157. static:
  158. github.com: 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGm[...]'
  159. gitlab.com: 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsj2bN[...]'
  160. omit_ip_address:
  161. - github.com
  162. # specify DH parameters (see /etc/ssh/moduli)
  163. # yamllint disable rule:line-length
  164. moduli: |
  165. # Time Type Tests Tries Size Generator Modulus
  166. 20120821045639 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293680B09D63
  167. 20120821045830 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C6042936814C2FFB
  168. 20120821050046 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368214FC53
  169. 20120821050054 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368218E83F
  170. # yamllint enable rule:line-length
  171. # ALTERNATIVELY, specify the location of the moduli file. Examples:
  172. # moduli_source: http://some.server.somewhere/salt/moduli
  173. # moduli_source: salt://files/ssh/moduli
  174. # If moduli is specified, moduli_source will be ignored.
  175. # Also, a proper hash file *must* be included in the same path. E.g.:
  176. # http://some.server.somewhere/salt/moduli.hash
  177. # salt://files/ssh/moduli.hash
  178. # These will be automatically referenced to by the ssh_moduli state.
  179. tofs:
  180. # The files_switch key serves as a selector for alternative
  181. # directories under the formula files directory. See TOFS pattern
  182. # doc for more info.
  183. # Note: Any value not evaluated by `config.get` will be used literally.
  184. # This can be used to set custom paths, as many levels deep as required.
  185. # files_switch:
  186. # - any/path/can/be/used/here
  187. # - id
  188. # - role
  189. # - osfinger
  190. # - os
  191. # - os_family
  192. # All aspects of path/file resolution are customisable using the options below.
  193. # This is unnecessary in most cases; there are sensible defaults.
  194. # path_prefix: template_alt
  195. # dirs:
  196. # files: files_alt
  197. # default: default_alt
  198. source_files:
  199. manage ssh_known_hosts file:
  200. - alt_ssh_known_hosts
  201. sshd_config:
  202. - alt_sshd_config
  203. ssh_config:
  204. - alt_ssh_config
  205. sshd_banner:
  206. - fire_banner
  207. # Required for openssh.known_hosts
  208. mine_functions:
  209. public_ssh_host_keys:
  210. mine_function: cmd.run
  211. cmd: cat /etc/ssh/ssh_host_*_key.pub
  212. python_shell: true
  213. public_ssh_hostname:
  214. mine_function: grains.get
  215. key: id