Saltstack Official OpenSSH Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

247 lines
9.8KB

  1. sshd_config:
  2. # This keyword is totally optional
  3. ConfigBanner: |
  4. # Alternative banner for the config file
  5. # (Indented) hash signs lose their special meaning here
  6. # and the lines will be written as-is.
  7. Port: 22
  8. Protocol: 2
  9. HostKey:
  10. - /etc/ssh/ssh_host_rsa_key
  11. - /etc/ssh/ssh_host_dsa_key
  12. - /etc/ssh/ssh_host_ecdsa_key
  13. - /etc/ssh/ssh_host_ed25519_key
  14. UsePrivilegeSeparation: 'yes'
  15. KeyRegenerationInterval: 3600
  16. ServerKeyBits: 1024
  17. SyslogFacility: AUTH
  18. LogLevel: INFO
  19. ClientAliveInterval: 0
  20. ClientAliveCountMax: 3
  21. LoginGraceTime: 120
  22. PermitRootLogin: 'yes'
  23. PasswordAuthentication: 'no'
  24. StrictModes: 'yes'
  25. MaxAuthTries: 6
  26. MaxSessions: 10
  27. RSAAuthentication: 'yes'
  28. PubkeyAuthentication: 'yes'
  29. AuthorizedKeysCommand: '/usr/bin/sss_ssh_authorizedkeys'
  30. AuthorizedKeysCommandUser: 'nobody'
  31. IgnoreRhosts: 'yes'
  32. RhostsRSAAuthentication: 'no'
  33. HostbasedAuthentication: 'no'
  34. PermitEmptyPasswords: 'no'
  35. ChallengeResponseAuthentication: 'no'
  36. AuthenticationMethods: 'publickey,keyboard-interactive'
  37. AuthorizedKeysFile: '%h/.ssh/authorized_keys'
  38. X11Forwarding: 'no'
  39. X11DisplayOffset: 10
  40. PrintMotd: 'yes'
  41. PrintLastLog: 'yes'
  42. TCPKeepAlive: 'yes'
  43. AcceptEnv: "LANG LC_*"
  44. Subsystem: "sftp /usr/lib/openssh/sftp-server"
  45. UsePAM: 'yes'
  46. UseDNS: 'yes'
  47. AllowUsers: 'vader@10.0.0.1 maul@evil.com sidious luke'
  48. DenyUsers: 'yoda chewbaca@112.10.21.1'
  49. AllowGroups: 'wheel staff imperial'
  50. DenyGroups: 'rebel'
  51. matches:
  52. sftp_chroot:
  53. type:
  54. Group: sftpusers
  55. options:
  56. ChrootDirectory: /sftp-chroot/%u
  57. X11Forwarding: no
  58. AllowTcpForwarding: no
  59. ForceCommand: internal-sftp
  60. # Check `man sshd_config` for supported KexAlgorithms, Ciphers and MACs first.
  61. # You can specify KexAlgorithms, Ciphers and MACs as both key or a list.
  62. # The configuration given in the example below is based on:
  63. # https://stribika.github.io/2015/01/04/secure-secure-shell.html
  64. #KexAlgorithms: 'curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256'
  65. #Ciphers: 'chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr'
  66. #MACs: 'hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com'
  67. KexAlgorithms:
  68. - 'curve25519-sha256@libssh.org'
  69. - 'diffie-hellman-group-exchange-sha256'
  70. Ciphers:
  71. - 'chacha20-poly1305@openssh.com'
  72. - 'aes256-gcm@openssh.com'
  73. - 'aes128-gcm@openssh.com'
  74. - 'aes256-ctr'
  75. - 'aes192-ctr'
  76. - 'aes128-ctr'
  77. MACs:
  78. - 'hmac-sha2-512-etm@openssh.com'
  79. - 'hmac-sha2-256-etm@openssh.com'
  80. - 'hmac-ripemd160-etm@openssh.com'
  81. - 'umac-128-etm@openssh.com'
  82. - 'hmac-sha2-512'
  83. - 'hmac-sha2-256'
  84. - 'hmac-ripemd160'
  85. - 'umac-128@openssh.com'
  86. ssh_config:
  87. StrictHostKeyChecking: no
  88. ForwardAgent: no
  89. ForwardX11: no
  90. RhostsRSAAuthentication: no
  91. RSAAuthentication: yes
  92. PasswordAuthentication: yes
  93. HostbasedAuthentication: no
  94. GSSAPIAuthentication: no
  95. GSSAPIDelegateCredentials: no
  96. BatchMode: 'yes'
  97. CheckHostIP: 'yes'
  98. AddressFamily: 'any'
  99. ConnectTimeout: 0
  100. IdentityFile: '~/.ssh/id_rsa'
  101. Port: 22
  102. Protocol: 2
  103. Cipher: '3des'
  104. Tunnel: 'no'
  105. TunnelDevice: 'any:any'
  106. PermitLocalCommand: 'no'
  107. VisualHostKey: 'no'
  108. # Check `man ssh_config` for supported KexAlgorithms, Ciphers and MACs first.
  109. # You can specify KexAlgorithms, Ciphers and MACs as both key or a list.
  110. # The configuration given in the example below is based on:
  111. # https://stribika.github.io/2015/01/04/secure-secure-shell.html
  112. #KexAlgorithms: 'curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1'
  113. #Ciphers: 'chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr'
  114. #MACs: 'hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-ripemd160,umac-128@openssh.com'
  115. KexAlgorithms:
  116. - 'curve25519-sha256@libssh.org'
  117. - 'diffie-hellman-group-exchange-sha256'
  118. - 'diffie-hellman-group-exchange-sha1'
  119. - 'diffie-hellman-group14-sha1'
  120. Ciphers:
  121. - 'chacha20-poly1305@openssh.com'
  122. - 'aes256-gcm@openssh.com'
  123. - 'aes128-gcm@openssh.com'
  124. - 'aes256-ctr'
  125. - 'aes192-ctr'
  126. - 'aes128-ctr'
  127. MACs:
  128. - 'hmac-sha2-512-etm@openssh.com'
  129. - 'hmac-sha2-256-etm@openssh.com'
  130. - 'hmac-ripemd160-etm@openssh.com'
  131. - 'umac-128-etm@openssh.com'
  132. - 'hmac-sha2-512'
  133. - 'hmac-sha2-256'
  134. - 'hmac-ripemd160'
  135. - 'umac-128@openssh.com'
  136. openssh:
  137. # Controls if SSHD should be enabled/started
  138. sshd_enable: true
  139. auth:
  140. joe-valid-ssh-key-desktop:
  141. - user: joe
  142. present: True
  143. enc: ssh-rsa
  144. comment: main key - desktop
  145. source: salt://ssh_keys/joe.desktop.pub
  146. joe-valid-ssh-key-notebook:
  147. - user: joe
  148. present: True
  149. enc: ssh-rsa
  150. comment: main key - notebook
  151. source: salt://ssh_keys/joe.netbook.pub
  152. joe-non-valid-ssh-key:
  153. - user: joe
  154. present: False
  155. enc: ssh-rsa
  156. comment: obsolete key - removed
  157. source: salt://ssh_keys/joe.no-valid.pub
  158. generate_dsa_keys: False
  159. absent_dsa_keys: False
  160. provide_dsa_keys: False
  161. dsa:
  162. private_key: |
  163. -----BEGIN DSA PRIVATE KEY-----
  164. NOT_DEFINED
  165. -----END DSA PRIVATE KEY-----
  166. public_key: |
  167. ssh-dss NOT_DEFINED
  168. generate_ecdsa_keys: False
  169. absent_ecdsa_keys: False
  170. provide_ecdsa_keys: False
  171. ecdsa:
  172. private_key: |
  173. -----BEGIN EC PRIVATE KEY-----
  174. NOT_DEFINED
  175. -----END EC PRIVATE KEY-----
  176. public_key: |
  177. ecdsa-sha2-nistp256 NOT_DEFINED
  178. generate_rsa_keys: False
  179. generate_rsa_size: 4096
  180. absent_rsa_keys: False
  181. provide_rsa_keys: False
  182. rsa:
  183. private_key: |
  184. -----BEGIN RSA PRIVATE KEY-----
  185. NOT_DEFINED
  186. -----END RSA PRIVATE KEY-----
  187. public_key: |
  188. ssh-rsa NOT_DEFINED
  189. generate_ed25519_keys: False
  190. absent_ed25519_keys: False
  191. provide_ed25519_keys: False
  192. ed25519:
  193. private_key: |
  194. -----BEGIN OPENSSH PRIVATE KEY-----
  195. NOT_DEFINED
  196. -----END OPENSSH PRIVATE KEY-----
  197. public_key: |
  198. ssh-ed25519 NOT_DEFINED
  199. known_hosts:
  200. # The next 2 settings restrict the set of minions that will be added in
  201. # the generated ssh_known_hosts files (the default is to match all minions)
  202. target: '*'
  203. expr_form: 'glob'
  204. # Name of mining functions used to gather public keys and hostnames
  205. # (the default values are shown here)
  206. mine_keys_function: public_ssh_host_keys
  207. mine_hostname_function: public_ssh_hostname
  208. # List of DNS entries also pointing to our managed machines and that we want
  209. # to inject in our generated ssh_known_hosts file
  210. aliases:
  211. - cname-to-minion.example.org
  212. - alias.example.org
  213. # specify DH parameters (see /etc/ssh/moduli)
  214. moduli: |
  215. # Time Type Tests Tries Size Generator Modulus
  216. 20120821045639 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C604293680B09D63
  217. 20120821045830 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C6042936814C2FFB
  218. 20120821050046 2 6 100 2047 2 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368214FC53
  219. 20120821050054 2 6 100 2047 5 DD2047CBDBB6F8E919BC63DE885B34D0FD6E3DB2887D8B46FE249886ACED6B46DFCD5553168185FD376122171CD8927E60120FA8D01F01D03E58281FEA9A1ABE97631C828E41815F34FDCDF787419FE13A3137649AA93D2584230DF5F24B5C00C88B7D7DE4367693428C730376F218A53E853B0851BAB7C53C15DA7839CBE1285DB63F6FA45C1BB59FE1C5BB918F0F8459D7EF60ACFF5C0FA0F3FCAD1C5F4CE4416D4F4B36B05CDCEBE4FB879E95847EFBC6449CD190248843BC7EDB145FBFC4EDBB1A3C959298F08F3BA2CFBE231BBE204BE6F906209D28BD4820AB3E7BE96C26AE8A809ADD8D1A5A0B008E9570FA4C4697E116B8119892C60429368218E83F
  220. # ALTERNATIVELY, specify the location of the moduli file. Examples:
  221. #moduli_source: http://some.server.somewhere/salt/moduli
  222. #moduli_source: salt://files/ssh/moduli
  223. # If moduli is specified, moduli_source will be ignored.
  224. # Also, a proper hash file *must* be included in the same path. E.g.:
  225. # http://some.server.somewhere/salt/moduli.hash
  226. # salt://files/ssh/moduli.hash
  227. # These will be automatically referenced to by the ssh_moduli state.
  228. # Required for openssh.known_hosts
  229. mine_functions:
  230. public_ssh_host_keys:
  231. mine_function: cmd.run
  232. cmd: cat /etc/ssh/ssh_host_*_key.pub
  233. python_shell: True
  234. public_ssh_hostname:
  235. mine_function: grains.get
  236. key: id