Change directory structure. Fix #43
This commit is contained in:
1 parent
4997baafa2
commit
ea213d636c
11 files changed
+1
-1
No files matched your search
@@ -1,76 +0,0 @@
|
||||
# true if IPv6 is needed
|
||||
network_ipv6_enable: false # sshd + ssh
|
||||
|
||||
# For which components (client and server) to generate the configuration for. Can be useful when running against a client without an SSH server.
|
||||
ssh_client_hardening: true # ssh
|
||||
ssh_server_hardening: true # sshd
|
||||
|
||||
# true if CBC for ciphers is required. This is usually only necessary, if older M2M mechanism need to communicate with SSH, that don't have any of the configured secure ciphers enabled. CBC is a weak alternative. Anything weaker should be avoided and is thus not available.
|
||||
ssh_client_cbc_required: false # ssh
|
||||
ssh_server_cbc_required: false # sshd
|
||||
|
||||
# true if weaker HMAC mechanisms are required. This is usually only necessary, if older M2M mechanism need to communicate with SSH, that don't have any of the configured secure HMACs enabled.
|
||||
ssh_client_weak_hmac: false # ssh
|
||||
ssh_server_weak_hmac: false # sshd
|
||||
|
||||
# true if weaker Key-Exchange (KEX) mechanisms are required. This is usually only necessary, if older M2M mechanism need to communicate with SSH, that don't have any of the configured secure KEXs enabled.
|
||||
ssh_client_weak_kex: false # ssh
|
||||
ssh_server_weak_kex: false # sshd
|
||||
|
||||
# If true, password login is allowed. For sshd, it is always set to no password login.
|
||||
ssh_client_password_login: false # ssh
|
||||
|
||||
# ports to which ssh-server should listen to
|
||||
ssh_server_ports: ['22'] # sshd
|
||||
|
||||
# ports to which ssh-client should connect to
|
||||
ssh_client_ports: ['22'] # ssh
|
||||
|
||||
# one or more ip addresses, to which ssh-server should listen to. Default is empty, but should be configured for security reasons!
|
||||
ssh_listen_to: ['0.0.0.0'] # sshd
|
||||
|
||||
# Host keys to look for when starting sshd.
|
||||
ssh_host_key_files: ['/etc/ssh/ssh_host_rsa_key', '/etc/ssh/ssh_host_dsa_key', '/etc/ssh/ssh_host_ecdsa_key'] # sshd
|
||||
|
||||
# Specifies the maximum number of authentication attempts permitted per connection. Once the number of failures reaches half this value, additional failures are logged.
|
||||
ssh_max_auth_retries: 2
|
||||
|
||||
ssh_client_alive_interval: 600 # sshd
|
||||
ssh_client_alive_count: 3 # sshd
|
||||
# one or more hosts, to which ssh-client can connect to. Default is empty, but should be configured for security reasons!
|
||||
ssh_remote_hosts: [] # ssh
|
||||
# false to disable root login altogether. Set to true to allow root to login via key-based mechanism.
|
||||
ssh_allow_root_with_key: false # sshd
|
||||
|
||||
# false to disable TCP Forwarding. Set to true to allow TCP Forwarding.
|
||||
ssh_allow_tcp_forwarding: false # sshd
|
||||
|
||||
# false to disable Agent Forwarding. Set to true to allow Agent Forwarding.
|
||||
ssh_allow_agent_forwarding: false # sshd
|
||||
|
||||
# false to disable pam authentication.
|
||||
ssh_use_pam: false # sshd
|
||||
|
||||
# if specified, login is disallowed for user names that match one of the patterns.
|
||||
ssh_deny_users: '' # sshd
|
||||
|
||||
# if specified, login is allowed only for user names that match one of the patterns.
|
||||
ssh_allow_users: '' # sshd
|
||||
|
||||
# if specified, login is disallowed for users whose primary group or supplementary group list matches one of the patterns.
|
||||
ssh_deny_groups: '' # sshd
|
||||
|
||||
# if specified, login is allowed only for users whose primary group or supplementary group list matches one of the patterns.
|
||||
ssh_allow_groups: '' # sshd
|
||||
|
||||
# false to disable printing of the MOTD
|
||||
ssh_print_motd: false # sshd
|
||||
|
||||
# false to disable display of last login information
|
||||
ssh_print_last_log: false # sshd
|
||||
|
||||
# true to enable sftp configuration
|
||||
sftp_enabled: false
|
||||
|
||||
# change default sftp chroot location
|
||||
sftp_chroot_dir: /home/%u
|
||||
@@ -1,10 +0,0 @@
|
||||
module ssh_password 1.0;
|
||||
|
||||
require {
|
||||
type sshd_t;
|
||||
type shadow_t;
|
||||
class file { read open };
|
||||
}
|
||||
|
||||
#============= sshd_t ==============
|
||||
allow sshd_t shadow_t:file { read open };
|
||||
@@ -1,2 +0,0 @@
|
||||
- name: restart sshd
|
||||
service: name={{ sshd_service_name }} state=restarted
|
||||
@@ -1,52 +0,0 @@
|
||||
---
|
||||
- name: add the OS specific variables
|
||||
include_vars: "{{ ansible_os_family }}.yml"
|
||||
|
||||
- name: test to see if selinux is running
|
||||
command: getenforce
|
||||
register: sestatus
|
||||
changed_when: false
|
||||
ignore_errors: true
|
||||
|
||||
- name: check the ssh_password policy state
|
||||
shell: semodule -l | grep "ssh_password" | awk '{print $3}'
|
||||
register: selinux_policy_state
|
||||
when: sestatus.rc == 0 and sestatus.stdout != 'Disabled'
|
||||
changed_when: false
|
||||
|
||||
- name: create sshd_config and set permissions to root/600
|
||||
template: src='opensshd.conf.j2' dest='/etc/ssh/sshd_config' mode=0600 owner=root group=root validate="/usr/sbin/sshd -T -f %s"
|
||||
notify: restart sshd
|
||||
when: ssh_server_hardening
|
||||
|
||||
- name: create ssh_config and set permissions to root/644
|
||||
template: src='openssh.conf.j2' dest='/etc/ssh/ssh_config' mode=0644 owner=root group=root
|
||||
when: ssh_client_hardening
|
||||
|
||||
- name: Create selinux custom policy drop folder
|
||||
file: path={{ custom_selinux_dir }} state=directory owner=root group=root mode=0750
|
||||
when: not ssh_use_pam and sestatus.rc == 0 and sestatus.stdout != 'Disabled'
|
||||
|
||||
# The following tasks only get executed when selinux is in state enforcing and UsePam is "no".
|
||||
# See this issue for more info: https://github.com/hardening-io/ansible-ssh-hardening/issues/23
|
||||
|
||||
- name: Distributing custom selinux policies
|
||||
copy: src='ssh_password' dest='{{ custom_selinux_dir }}'
|
||||
register: custom_policies_output
|
||||
when: not ssh_use_pam and sestatus.rc == 0 and sestatus.stdout != 'Disabled'
|
||||
|
||||
- name: check and compile policy
|
||||
shell: checkmodule -M -m -o {{ custom_selinux_dir }}/ssh_password.mod {{ custom_selinux_dir }}/ssh_password
|
||||
when: not ssh_use_pam and sestatus.rc == 0 and sestatus.stdout != 'Disabled'
|
||||
|
||||
- name: create selinux policy module package
|
||||
shell: semodule_package -o {{ custom_selinux_dir }}/ssh_password.pp -m {{ custom_selinux_dir }}/ssh_password.mod
|
||||
when: not ssh_use_pam and sestatus.rc == 0 and sestatus.stdout != 'Disabled'
|
||||
|
||||
- name: install selinux policy
|
||||
shell: semodule -i {{ custom_selinux_dir }}/ssh_password.pp
|
||||
when: not ssh_use_pam and sestatus.rc == 0 and sestatus.stdout != 'Disabled'
|
||||
|
||||
- name: remove selinux-policy when Pam is used, because Allowing sshd to read the shadow file directly is considered a potential security risk (http://danwalsh.livejournal.com/12333.html)
|
||||
shell: semodule -r ssh_password
|
||||
when: sestatus.rc == 0 and ssh_use_pam
|
||||
@@ -1,147 +0,0 @@
|
||||
# {{ansible_managed}}
|
||||
|
||||
# This is the ssh client system-wide configuration file.
|
||||
# See ssh_config(5) for more information on any settings used. Comments will be added only to clarify why a configuration was chosen.
|
||||
#
|
||||
# Created for OpenSSH v5.9
|
||||
|
||||
# Basic configuration
|
||||
# ===================
|
||||
|
||||
# Address family should always be limited to the active network configuration.
|
||||
AddressFamily {{ 'any' if network_ipv6_enable else 'inet' }}
|
||||
# Restrict the following configuration to be limited to this Host.
|
||||
{% for host in ssh_remote_hosts -%}
|
||||
Host {{host}}
|
||||
{% endfor %}
|
||||
|
||||
# The port at the destination should be defined
|
||||
{% for port in ssh_client_ports -%}
|
||||
Port {{port}}
|
||||
{% endfor %}
|
||||
|
||||
# Identity file configuration. You may restrict available identity files. Otherwise ssh will search for a pattern and use any that matches.
|
||||
#IdentityFile ~/.ssh/identity
|
||||
#IdentityFile ~/.ssh/id_rsa
|
||||
#IdentityFile ~/.ssh/id_dsa
|
||||
|
||||
|
||||
# Security configuration
|
||||
# ======================
|
||||
|
||||
# Set the protocol version to 2 for security reasons. Disables legacy support.
|
||||
Protocol 2
|
||||
|
||||
# Make sure passphrase querying is enabled
|
||||
BatchMode no
|
||||
|
||||
# Prevent IP spoofing by checking to host IP against the `known_hosts` file.
|
||||
CheckHostIP yes
|
||||
|
||||
# Always ask before adding keys to the `known_hosts` file. Do not set to `yes`.
|
||||
StrictHostKeyChecking ask
|
||||
|
||||
# **Ciphers** -- If your clients don't support CTR (eg older versions), cbc will be added
|
||||
# CBC: is true if you want to connect with OpenSSL-base libraries
|
||||
# eg ruby Net::SSH::Transport::CipherFactory requires cbc-versions of the given openssh ciphers to work
|
||||
# -- see: (http://net-ssh.github.com/net-ssh/classes/Net/SSH/Transport/CipherFactory.html)
|
||||
#
|
||||
{% if ssh_client_cbc_required -%}
|
||||
{% if ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' -%}
|
||||
Ciphers {{ciphers_66_weak}}
|
||||
{% else -%}
|
||||
Ciphers {{ciphers_53_weak}}
|
||||
{% endif %}
|
||||
{% else -%}
|
||||
{% if ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' -%}
|
||||
Ciphers {{ciphers_66_default}}
|
||||
{% else -%}
|
||||
Ciphers {{ciphers_53_default}}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
# **Hash algorithms** -- Make sure not to use SHA1 for hashing, unless it is really necessary.
|
||||
# Weak HMAC is sometimes required if older package versions are used
|
||||
# eg Ruby's Net::SSH at around 2.2.* doesn't support sha2 for hmac, so this will have to be set true in this case.
|
||||
#
|
||||
{% if ssh_client_weak_hmac -%}
|
||||
{% if ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' -%}
|
||||
MACs {{macs_66_weak}}
|
||||
{% elif ansible_os_family in ['Oracle Linux', 'RedHat'] and ansible_distribution_major_version <= '6' -%}
|
||||
MACs {{macs_53_default}}
|
||||
{% elif ansible_distribution == 'Debian' and ansible_distribution_major_version <= '6' -%}
|
||||
MACs {{macs_53_default}}
|
||||
{% else -%}
|
||||
MACs {{macs_59_weak}}
|
||||
{% endif %}
|
||||
{% else -%}
|
||||
{% if ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' -%}
|
||||
MACs {{macs_66_default}}
|
||||
{% elif ansible_os_family in ['Oracle Linux', 'RedHat'] and ansible_distribution_major_version <= '6' -%}
|
||||
MACs {{macs_53_default}}
|
||||
{% elif ansible_distribution == 'Debian' and ansible_distribution_major_version <= '6' -%}
|
||||
MACs {{macs_53_default}}
|
||||
{% else -%}
|
||||
MACs {{macs_59_default}}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
# Alternative setting, if OpenSSH version is below v5.9
|
||||
#MACs hmac-ripemd160
|
||||
|
||||
# **Key Exchange Algorithms** -- Make sure not to use SHA1 for kex, unless it is really necessary
|
||||
# Weak kex is sometimes required if older package versions are used
|
||||
# eg ruby's Net::SSH at around 2.2.* doesn't support sha2 for kex, so this will have to be set true in this case.
|
||||
#
|
||||
{% if ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' -%}
|
||||
{% if ssh_client_weak_kex -%}
|
||||
KexAlgorithms {{kex_66_weak}}
|
||||
{% else -%}
|
||||
KexAlgorithms {{kex_66_default}}
|
||||
{% endif %}
|
||||
{% else -%}
|
||||
{% if ansible_os_family in ['Oracle Linux', 'RedHat'] or (ansible_distribution == 'Debian' and ansible_distribution_major_version <= '6') -%}
|
||||
#KexAlgorithms
|
||||
{% elif ssh_client_weak_kex -%}
|
||||
KexAlgorithms {{kex_59_weak}}
|
||||
{% else -%}
|
||||
KexAlgorithms {{kex_59_default}}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
|
||||
# Disable agent forwarding, since local agent could be accessed through forwarded connection.
|
||||
ForwardAgent no
|
||||
|
||||
# Disable X11 forwarding, since local X11 display could be accessed through forwarded connection.
|
||||
ForwardX11 no
|
||||
|
||||
# Never use host-based authentication. It can be exploited.
|
||||
HostbasedAuthentication no
|
||||
RhostsRSAAuthentication no
|
||||
|
||||
# Enable RSA authentication via identity files.
|
||||
RSAAuthentication yes
|
||||
|
||||
# Disable password-based authentication, it can allow for potentially easier brute-force attacks.
|
||||
PasswordAuthentication {{ 'yes' if ssh_client_password_login else 'no' }}
|
||||
|
||||
# Only use GSSAPIAuthentication if implemented on the network.
|
||||
GSSAPIAuthentication no
|
||||
GSSAPIDelegateCredentials no
|
||||
|
||||
# Disable tunneling
|
||||
Tunnel no
|
||||
|
||||
# Disable local command execution.
|
||||
PermitLocalCommand no
|
||||
|
||||
|
||||
# Misc. configuration
|
||||
# ===================
|
||||
|
||||
# Enable compression. More pressure on the CPU, less on the network.
|
||||
Compression yes
|
||||
|
||||
#EscapeChar ~
|
||||
#VisualHostKey yes
|
||||
@@ -1,227 +0,0 @@
|
||||
# {{ansible_managed}}
|
||||
|
||||
# This is the ssh client system-wide configuration file.
|
||||
# See sshd_config(5) for more information on any settings used. Comments will be added only to clarify why a configuration was chosen.
|
||||
#
|
||||
# Created for OpenSSH v5.9
|
||||
|
||||
# Basic configuration
|
||||
# ===================
|
||||
|
||||
# Either disable or only allow root login via certificates.
|
||||
PermitRootLogin {{ 'without-password' if ssh_allow_root_with_key else 'no' }}
|
||||
|
||||
# Define which port sshd should listen to. Default to `22`.
|
||||
{% for port in ssh_server_ports -%}
|
||||
Port {{port}}
|
||||
{% endfor %}
|
||||
|
||||
# Address family should always be limited to the active network configuration.
|
||||
AddressFamily {{ 'any' if network_ipv6_enable else 'inet' }}
|
||||
|
||||
# Define which addresses sshd should listen to. Default to `0.0.0.0`, ie make sure you put your desired address in here, since otherwise sshd will listen to everyone.
|
||||
{% for address in ssh_listen_to -%}
|
||||
ListenAddress {{address}}
|
||||
{% endfor %}
|
||||
|
||||
# List HostKeys here.
|
||||
{% for key in ssh_host_key_files -%}
|
||||
HostKey {{key}} # Req 20
|
||||
{% endfor %}
|
||||
|
||||
# Security configuration
|
||||
# ======================
|
||||
|
||||
# Set the protocol version to 2 for security reasons. Disables legacy support.
|
||||
Protocol 2
|
||||
|
||||
# Make sure sshd checks file modes and ownership before accepting logins. This prevents accidental misconfiguration.
|
||||
StrictModes yes
|
||||
|
||||
# Logging, obsoletes QuietMode and FascistLogging
|
||||
SyslogFacility AUTH
|
||||
LogLevel VERBOSE
|
||||
|
||||
# Cryptography
|
||||
# ------------
|
||||
|
||||
# **Ciphers** -- If your clients don't support CTR (eg older versions), cbc will be added
|
||||
# CBC: is true if you want to connect with OpenSSL-base libraries
|
||||
# eg ruby Net::SSH::Transport::CipherFactory requires cbc-versions of the given openssh ciphers to work
|
||||
# -- see: (http://net-ssh.github.com/net-ssh/classes/Net/SSH/Transport/CipherFactory.html)
|
||||
#
|
||||
{% if ssh_server_cbc_required -%}
|
||||
{% if ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' -%}
|
||||
Ciphers {{ciphers_66_weak}}
|
||||
{% else %}
|
||||
Ciphers {{ciphers_53_weak}}
|
||||
{% endif %}
|
||||
{% else -%}
|
||||
{% if ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' -%}
|
||||
Ciphers {{ciphers_66_default}}
|
||||
{% else -%}
|
||||
Ciphers {{ciphers_53_default}}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
# **Hash algorithms** -- Make sure not to use SHA1 for hashing, unless it is really necessary.
|
||||
# Weak HMAC is sometimes required if older package versions are used
|
||||
# eg Ruby's Net::SSH at around 2.2.* doesn't support sha2 for hmac, so this will have to be set true in this case.
|
||||
#
|
||||
|
||||
{% if ssh_server_weak_hmac -%}
|
||||
{% if ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' -%}
|
||||
MACs {{macs_66_weak}}
|
||||
{% elif ansible_os_family in ['Oracle Linux', 'RedHat'] and ansible_distribution_major_version <= '6' -%}
|
||||
MACs {{macs_53_default}}
|
||||
{% elif ansible_distribution == 'Debian' and ansible_distribution_major_version <= '6' -%}
|
||||
MACs {{macs_53_default}}
|
||||
{% else -%}
|
||||
MACs {{macs_59_weak}}
|
||||
{% endif %}
|
||||
{% else -%}
|
||||
{% if ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' -%}
|
||||
MACs {{macs_66_default}}
|
||||
{% elif ansible_os_family in ['Oracle Linux', 'RedHat'] and ansible_distribution_major_version <= '6' -%}
|
||||
MACs {{macs_53_default}}
|
||||
{% elif ansible_distribution == 'Debian' and ansible_distribution_major_version <= '6' -%}
|
||||
MACs {{macs_53_default}}
|
||||
{% else -%}
|
||||
MACs {{macs_59_default}}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
# Alternative setting, if OpenSSH version is below v5.9
|
||||
#MACs hmac-ripemd160
|
||||
|
||||
# **Key Exchange Algorithms** -- Make sure not to use SHA1 for kex, unless it is really necessary
|
||||
# Weak kex is sometimes required if older package versions are used
|
||||
# eg ruby's Net::SSH at around 2.2.* doesn't support sha2 for kex, so this will have to be set true in this case.
|
||||
# based on: https://bettercrypto.org/static/applied-crypto-hardening.pdf
|
||||
{% if ansible_distribution == 'Ubuntu' and ansible_distribution_version >= '14.04' -%}
|
||||
{% if ssh_client_weak_kex -%}
|
||||
KexAlgorithms {{kex_66_weak}}
|
||||
{% else -%}
|
||||
KexAlgorithms {{kex_66_default}}
|
||||
{% endif %}
|
||||
{% else -%}
|
||||
{% if ansible_os_family in ['Oracle Linux', 'RedHat'] or (ansible_distribution == 'Debian' and ansible_distribution_major_version <= '6') -%}
|
||||
#KexAlgorithms
|
||||
{% else -%}
|
||||
KexAlgorithms {{kex_59_default}}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
# Authentication
|
||||
# --------------
|
||||
|
||||
# Secure Login directives.
|
||||
UseLogin no
|
||||
UsePrivilegeSeparation {% if (ansible_distribution == 'Debian' and ansible_distribution_major_version <= '6') or ansible_os_family in ['Oracle Linux', 'RedHat'] -%}{{ssh_ps53}}{% else %}{{ssh_ps59}}{% endif %}
|
||||
|
||||
PermitUserEnvironment no
|
||||
LoginGraceTime 30s
|
||||
MaxAuthTries {{ssh_max_auth_retries}}
|
||||
MaxSessions 10
|
||||
MaxStartups 10:30:100
|
||||
|
||||
# Enable public key authentication
|
||||
PubkeyAuthentication yes
|
||||
|
||||
# Never use host-based authentication. It can be exploited.
|
||||
IgnoreRhosts yes
|
||||
IgnoreUserKnownHosts yes
|
||||
HostbasedAuthentication no
|
||||
|
||||
# Enable PAM to enforce system wide rules
|
||||
UsePAM {{ 'yes' if ssh_use_pam else 'no' }}
|
||||
|
||||
# Disable password-based authentication, it can allow for potentially easier brute-force attacks.
|
||||
PasswordAuthentication no
|
||||
PermitEmptyPasswords no
|
||||
ChallengeResponseAuthentication no
|
||||
|
||||
# Only enable Kerberos authentication if it is configured.
|
||||
KerberosAuthentication no
|
||||
KerberosOrLocalPasswd no
|
||||
KerberosTicketCleanup yes
|
||||
#KerberosGetAFSToken no
|
||||
|
||||
# Only enable GSSAPI authentication if it is configured.
|
||||
GSSAPIAuthentication no
|
||||
GSSAPICleanupCredentials yes
|
||||
|
||||
# In case you don't use PAM (`UsePAM no`), you can alternatively restrict users and groups here. For key-based authentication this is not necessary, since all keys must be explicitely enabled.
|
||||
{% if ssh_deny_users -%}
|
||||
DenyUsers {{ssh_deny_users}}
|
||||
{% endif %}
|
||||
|
||||
{% if ssh_allow_users -%}
|
||||
AllowUsers {{ssh_allow_users}}
|
||||
{% endif %}
|
||||
|
||||
{% if ssh_deny_groups -%}
|
||||
DenyGroups {{ssh_deny_groups}}
|
||||
{% endif %}
|
||||
|
||||
{% if ssh_allow_groups -%}
|
||||
AllowGroups {{ssh_allow_groups}}
|
||||
{% endif %}
|
||||
|
||||
# Network
|
||||
# -------
|
||||
|
||||
# Disable TCP keep alive since it is spoofable. Use ClientAlive messages instead, they use the encrypted channel
|
||||
TCPKeepAlive no
|
||||
|
||||
# Manage `ClientAlive..` signals via interval and maximum count. This will periodically check up to a `..CountMax` number of times within `..Interval` timeframe, and abort the connection once these fail.
|
||||
ClientAliveInterval {{ssh_client_alive_interval}}
|
||||
ClientAliveCountMax {{ssh_client_alive_count}}
|
||||
|
||||
# Disable tunneling
|
||||
PermitTunnel no
|
||||
|
||||
# Disable forwarding tcp connections.
|
||||
# no real advantage without denied shell access
|
||||
AllowTcpForwarding {{ 'yes' if ssh_allow_tcp_forwarding else 'no' }}
|
||||
|
||||
# Disable agent formwarding, since local agent could be accessed through forwarded connection.
|
||||
# no real advantage without denied shell access
|
||||
AllowAgentForwarding {{ 'yes' if ssh_allow_agent_forwarding else 'no' }}
|
||||
|
||||
# Do not allow remote port forwardings to bind to non-loopback addresses.
|
||||
GatewayPorts no
|
||||
|
||||
# Disable X11 forwarding, since local X11 display could be accessed through forwarded connection.
|
||||
X11Forwarding no
|
||||
X11UseLocalhost yes
|
||||
|
||||
|
||||
# Misc. configuration
|
||||
# ===================
|
||||
|
||||
PrintMotd {{ 'yes' if ssh_print_motd else 'no' }}
|
||||
|
||||
PrintLastLog {{ 'yes' if ssh_print_last_log else 'no' }}
|
||||
|
||||
#Banner /etc/ssh/banner.txt
|
||||
#UseDNS yes
|
||||
#PidFile /var/run/sshd.pid
|
||||
#MaxStartups 10
|
||||
|
||||
{% if sftp_enabled %}
|
||||
# Configuration, in case SFTP is used
|
||||
## override default of no subsystems
|
||||
## Subsystem sftp /opt/app/openssh5/libexec/sftp-server
|
||||
Subsystem sftp internal-sftp -l INFO -f LOCAL6
|
||||
#
|
||||
## These lines must appear at the *end* of sshd_config
|
||||
Match Group sftponly
|
||||
ForceCommand internal-sftp -l INFO -f LOCAL6
|
||||
ChrootDirectory {{ sftp_chroot_dir }}
|
||||
AllowTcpForwarding no
|
||||
AllowAgentForwarding no
|
||||
PasswordAuthentication no
|
||||
PermitRootLogin no
|
||||
X11Forwarding no
|
||||
{% endif %}
|
||||
@@ -1 +0,0 @@
|
||||
sshd_service_name: ssh
|
||||
@@ -1 +0,0 @@
|
||||
sshd_service_name: sshd
|
||||
@@ -1 +0,0 @@
|
||||
sshd_service_name: sshd
|
||||
@@ -1,22 +0,0 @@
|
||||
ssh_ps53: 'yes'
|
||||
ssh_ps59: 'sandbox'
|
||||
|
||||
macs_53_default: 'hmac-ripemd160,hmac-sha1'
|
||||
macs_59_default: 'hmac-sha2-512,hmac-sha2-256,hmac-ripemd160'
|
||||
macs_59_weak: '{{macs_59_default + ",hmac-sha1"}}'
|
||||
macs_66_default: '[email protected],[email protected],[email protected],[email protected],hmac-sha2-512,hmac-sha2-256,hmac-ripemd160'
|
||||
macs_66_weak: '{{macs_66_default + ",hmac-sha1"}}'
|
||||
|
||||
ciphers_53_default: 'aes256-ctr,aes192-ctr,aes128-ctr'
|
||||
ciphers_53_weak: '{{ciphers_53_default + ",aes256-cbc,aes192-cbc,aes128-cbc"}}'
|
||||
|
||||
ciphers_66_default: '[email protected],[email protected],[email protected],aes256-ctr,aes192-ctr,aes128-ctr'
|
||||
ciphers_66_weak: '{{ciphers_66_default + ",aes256-cbc,aes192-cbc,aes128-cbc"}}'
|
||||
|
||||
kex_59_default: 'diffie-hellman-group-exchange-sha256'
|
||||
kex_59_weak: '{{kex_59_default + ",diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1"}}'
|
||||
kex_66_default: '[email protected],diffie-hellman-group-exchange-sha256'
|
||||
kex_66_weak: '{{kex_66_default + ",diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1"}}'
|
||||
|
||||
# directory where to store ssh_password policy
|
||||
custom_selinux_dir: '/etc/selinux/local-policies'
|
||||
Reference in new issue
Block a user