Skip to content

Commit

Permalink
Updated ansible ssh hardening role
Browse files Browse the repository at this point in the history
  • Loading branch information
stephandooper committed Sep 23, 2023
1 parent 77da689 commit 8bd5fb1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ host_key_checking = False
gathering = smart
fact_caching = jsonfile
fact_caching_connection = /var/tmp/ansible_cache
fact_caching_timeout = 8640
fact_caching_timeout = 86400
deprecation_warnings = False
#vault_password_file = ./config/.vault-pass
timeout=120
timeout=60
stdout_callback = yaml
bin_ansible_callbacks = True
local_tmp=/tmp
Expand Down
8 changes: 7 additions & 1 deletion playbooks/generic/users.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Create user with password (defined in config/group_vars/all.yml)
- hosts: all
become: true
collections:
- devsec.hardening
tasks:

- name: Set backward compatible values for ssh-hardening if not defined
Expand All @@ -11,6 +13,7 @@
when: ssh_client_hardening is undefined
- set_fact:
ssh_server_password_login: true
sshd_authenticationmethods: publickey password
when: ssh_server_password_login is undefined
- set_fact:
ssh_use_pam: true
Expand All @@ -21,7 +24,10 @@

- name: Configure SSH to allow login with password
include_role:
name: dev-sec.ssh-hardening
name: ssh_hardening
vars:
ssh_server_password_login: true
sshd_authenticationmethods: password publickey

- name: Set user password
include_role:
Expand Down

0 comments on commit 8bd5fb1

Please sign in to comment.