Compare commits

...

2 Commits

Author SHA1 Message Date
e22ae689df fix: Updated with default configs from RHEL 9
Some checks failed
CI / lint (push) Successful in 1m50s
CI / Molecule Test (almalinux8) (push) Successful in 2m54s
CI / Molecule Test (almalinux9) (push) Successful in 2m32s
CI / release (push) Successful in 35s
CI / notify (push) Failing after 5s
2024-12-30 08:25:51 +13:00
b668b705c3 fix: Duo-prompt on RHEL 8 and RHEL 9 2024-12-30 08:25:21 +13:00
7 changed files with 34 additions and 15 deletions

View File

@@ -1,12 +1,10 @@
#%PAM-1.0
auth required pam_sepermit.so
auth substack password-auth
auth required pam_env.so
auth sufficient pam_duo.so
auth required pam_deny.so
auth include postlogin
# Used with polkit to reauthorize users in remote sessions
-auth optional pam_reauthorize.so prepare
account required pam_sepermit.so
account required pam_nologin.so
account include password-auth
password include password-auth
@@ -17,7 +15,6 @@ session required pam_loginuid.so
session required pam_selinux.so open env_params
session required pam_namespace.so
session optional pam_keyinit.so force revoke
session optional pam_motd.so
session include password-auth
session include postlogin
# Used with polkit to reauthorize users in remote sessions
-session optional pam_reauthorize.so prepare
session include postlogin

View File

@@ -1,6 +0,0 @@
## Managed by Ansible ##
[duosecurity]
name=Duo Security Repository
baseurl=https://pkg.duosecurity.com/RedHat/"$releasever"Server/$basearch
enabled=1
gpgcheck=1

View File

@@ -6,7 +6,7 @@
yum:
name: >
openssh-server, openssh-clients,
sshpass, passwd
sshpass, passwd, rsyslog
state: installed
- name: Ensure sshd is running
@@ -15,6 +15,12 @@
state: started
enabled: true
- name: Ensure rsyslog is running
service:
name: rsyslog
state: started
enabled: true
- name: Ensure nologin files are absent
file:
path: "{{ item }}"

View File

@@ -26,3 +26,7 @@
- name: Did duo prompt show?
assert:
that: "'Duo two-factor login for' in slurpfile['content'] | b64decode"
# - name: Actual output
# debug:
# msg: "{{ slurpfile['content'] | b64decode }}"

View File

@@ -6,7 +6,7 @@
yum:
name: >
openssh-server, openssh-clients,
sshpass, passwd
sshpass, passwd, rsyslog
state: installed
- name: Ensure sshd is running
@@ -14,7 +14,13 @@
name: sshd
state: started
enabled: true
- name: Ensure rsyslog is running
service:
name: rsyslog
state: started
enabled: true
- name: Ensure nologin files are absent
file:
path: "{{ item }}"

View File

@@ -26,3 +26,7 @@
- name: Did duo prompt show?
assert:
that: "'Duo two-factor login for' in slurpfile['content'] | b64decode"
# - name: Actual output
# debug:
# msg: "{{ slurpfile['content'] | b64decode }}"

View File

@@ -42,6 +42,14 @@
line: 'ChallengeResponseAuthentication yes'
notify: Restart sshd
- name: RHEL9 - Ensure ChallengeResponseAuthentication is enabled
lineinfile:
path: /etc/ssh/sshd_config.d/50-redhat.conf
regex: '^ChallengeResponseAuthentication '
line: 'ChallengeResponseAuthentication yes'
notify: Restart sshd
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >= 9
- name: Flush Handlers
meta: flush_handlers