You've already forked ansible-role-auth-duo
Compare commits
4 Commits
dff4a97aa4
...
v1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
| e22ae689df | |||
| b668b705c3 | |||
| 73b9c52474 | |||
| cf9255038d |
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.venv
|
||||||
|
.vagrant
|
||||||
|
|
||||||
|
# ACT variable files should never be committed.
|
||||||
|
.secrets
|
||||||
|
.vars
|
||||||
@@ -1,12 +1,10 @@
|
|||||||
#%PAM-1.0
|
#%PAM-1.0
|
||||||
auth required pam_sepermit.so
|
|
||||||
auth substack password-auth
|
auth substack password-auth
|
||||||
auth required pam_env.so
|
auth required pam_env.so
|
||||||
auth sufficient pam_duo.so
|
auth sufficient pam_duo.so
|
||||||
auth required pam_deny.so
|
auth required pam_deny.so
|
||||||
auth include postlogin
|
auth include postlogin
|
||||||
# Used with polkit to reauthorize users in remote sessions
|
account required pam_sepermit.so
|
||||||
-auth optional pam_reauthorize.so prepare
|
|
||||||
account required pam_nologin.so
|
account required pam_nologin.so
|
||||||
account include password-auth
|
account include password-auth
|
||||||
password 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_selinux.so open env_params
|
||||||
session required pam_namespace.so
|
session required pam_namespace.so
|
||||||
session optional pam_keyinit.so force revoke
|
session optional pam_keyinit.so force revoke
|
||||||
|
session optional pam_motd.so
|
||||||
session include password-auth
|
session include password-auth
|
||||||
session include postlogin
|
session include postlogin
|
||||||
# Used with polkit to reauthorize users in remote sessions
|
|
||||||
-session optional pam_reauthorize.so prepare
|
|
||||||
@@ -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
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
yum:
|
yum:
|
||||||
name: >
|
name: >
|
||||||
openssh-server, openssh-clients,
|
openssh-server, openssh-clients,
|
||||||
sshpass, passwd
|
sshpass, passwd, rsyslog
|
||||||
state: installed
|
state: installed
|
||||||
|
|
||||||
- name: Ensure sshd is running
|
- name: Ensure sshd is running
|
||||||
@@ -15,6 +15,12 @@
|
|||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
- name: Ensure rsyslog is running
|
||||||
|
service:
|
||||||
|
name: rsyslog
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
|
||||||
- name: Ensure nologin files are absent
|
- name: Ensure nologin files are absent
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
|
|||||||
@@ -26,3 +26,7 @@
|
|||||||
- name: Did duo prompt show?
|
- name: Did duo prompt show?
|
||||||
assert:
|
assert:
|
||||||
that: "'Duo two-factor login for' in slurpfile['content'] | b64decode"
|
that: "'Duo two-factor login for' in slurpfile['content'] | b64decode"
|
||||||
|
|
||||||
|
# - name: Actual output
|
||||||
|
# debug:
|
||||||
|
# msg: "{{ slurpfile['content'] | b64decode }}"
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
yum:
|
yum:
|
||||||
name: >
|
name: >
|
||||||
openssh-server, openssh-clients,
|
openssh-server, openssh-clients,
|
||||||
sshpass, passwd
|
sshpass, passwd, rsyslog
|
||||||
state: installed
|
state: installed
|
||||||
|
|
||||||
- name: Ensure sshd is running
|
- name: Ensure sshd is running
|
||||||
@@ -14,7 +14,13 @@
|
|||||||
name: sshd
|
name: sshd
|
||||||
state: started
|
state: started
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
- name: Ensure rsyslog is running
|
||||||
|
service:
|
||||||
|
name: rsyslog
|
||||||
|
state: started
|
||||||
|
enabled: true
|
||||||
|
|
||||||
- name: Ensure nologin files are absent
|
- name: Ensure nologin files are absent
|
||||||
file:
|
file:
|
||||||
path: "{{ item }}"
|
path: "{{ item }}"
|
||||||
|
|||||||
@@ -26,3 +26,7 @@
|
|||||||
- name: Did duo prompt show?
|
- name: Did duo prompt show?
|
||||||
assert:
|
assert:
|
||||||
that: "'Duo two-factor login for' in slurpfile['content'] | b64decode"
|
that: "'Duo two-factor login for' in slurpfile['content'] | b64decode"
|
||||||
|
|
||||||
|
# - name: Actual output
|
||||||
|
# debug:
|
||||||
|
# msg: "{{ slurpfile['content'] | b64decode }}"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
copy:
|
copy:
|
||||||
dest: /tmp/DUO-GPG-PUBLIC-KEY.asc
|
dest: /tmp/DUO-GPG-PUBLIC-KEY.asc
|
||||||
src: DUO-GPG-PUBLIC-KEY.asc
|
src: DUO-GPG-PUBLIC-KEY.asc
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Ensure Duo GPG Key is installed
|
- name: Ensure Duo GPG Key is installed
|
||||||
rpm_key:
|
rpm_key:
|
||||||
@@ -13,6 +14,7 @@
|
|||||||
file:
|
file:
|
||||||
path: /tmp/DUO-GPG-PUBLIC-KEY.asc
|
path: /tmp/DUO-GPG-PUBLIC-KEY.asc
|
||||||
state: absent
|
state: absent
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
- name: Ensure duo repository is present
|
- name: Ensure duo repository is present
|
||||||
template:
|
template:
|
||||||
|
|||||||
@@ -42,6 +42,14 @@
|
|||||||
line: 'ChallengeResponseAuthentication yes'
|
line: 'ChallengeResponseAuthentication yes'
|
||||||
notify: Restart sshd
|
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
|
- name: Flush Handlers
|
||||||
meta: flush_handlers
|
meta: flush_handlers
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user