Nareshkumar Rao
3 years ago
8 changed files with 76 additions and 3 deletions
@ -0,0 +1,3 @@ |
|||
[sshd] |
|||
enabled=true |
|||
|
@ -0,0 +1,4 @@ |
|||
ChallengeResponseAuthentication no |
|||
PasswordAuthentication no |
|||
UsePAM no |
|||
|
@ -0,0 +1,17 @@ |
|||
- name: Restart FirewallD |
|||
service: |
|||
name: firewalld |
|||
state: restarted |
|||
enabled: yes |
|||
|
|||
- name: Restart Fail2Ban |
|||
service: |
|||
name: fail2ban |
|||
state: restarted |
|||
enabled: yes |
|||
|
|||
- name: Restart SSHD |
|||
service: |
|||
name: sshd |
|||
state: restarted |
|||
enabled: yes |
@ -0,0 +1,32 @@ |
|||
- name: Install FirewallD and Fail2Ban |
|||
apt: |
|||
name: firewalld, fail2ban |
|||
state: present |
|||
|
|||
- name: Copy FirewallD public.conf |
|||
notify: Restart FirewallD |
|||
template: |
|||
src: firewalld-public.conf |
|||
dest: /etc/firewalld/zones/public.xml |
|||
owner: root |
|||
group: root |
|||
mode: u=rw,g=r,o=r |
|||
|
|||
- name: Copy Fail2Ban conf |
|||
notify: Restart Fail2Ban |
|||
copy: |
|||
src: fail2ban.conf |
|||
dest: /etc/fail2ban/jail.d/server.conf |
|||
owner: root |
|||
group: root |
|||
mode: u=rw,g=r,o=r |
|||
|
|||
- name: Copy SSHD conf |
|||
notify: Restart SSHD |
|||
copy: |
|||
src: sshd.conf |
|||
dest: /etc/ssh/sshd_config.d/10-security.conf |
|||
owner: root |
|||
group: root |
|||
mode: u=rw,g=r,o=r |
|||
|
@ -0,0 +1,11 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<zone> |
|||
<short>Public</short> |
|||
<description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description> |
|||
<service name="ssh"/> |
|||
<service name="dhcpv6-client"/> |
|||
{% for service in firewalld_public_services %} |
|||
<service name="{{ service }}"/> |
|||
{% endfor %} |
|||
</zone> |
|||
|
Loading…
Reference in new issue