#%PAM-1.0# This file is being managed by Ansible. Please make any desired changes to the template. Any changes made here will be likely overwritten.auth required pam_env.soauth sufficient pam_fprintd.so{% if login_failures_interval_audit is defined or logon_attempts_audit is defined %}auth required pam_faillock.so preauth silent deny=3 unlock_time=604800 fail_interval=900{% endif %}auth sufficient pam_unix.so nullok try_first_pass{% if login_failures_interval_audit is defined or logon_attempts_audit is defined %}auth [default=die] pam_faillock.so authfail deny=3 unlock_time=604800 fail_interval=900{% endif %}auth requisite pam_succeed_if.so uid >= 500 quietauth required pam_deny.so
{% if login_failures_interval_audit is defined or logon_attempts_audit is defined %}account required pam_faillock.so{% endif %}account required pam_unix.soaccount sufficient pam_localuser.soaccount sufficient pam_succeed_if.so uid < 500 quietaccount required pam_permit.so
password requisite pam_cracklib.so try_first_pass retry=3 type=password sufficient pam_unix.so {% if pam_pwd_hash_audit is defined %}sha512{% else %}md5{% endif %} shadow nullok try_first_pass use_authtokpassword required pam_deny.so
session optional pam_keyinit.so revokesession required pam_limits.sosession [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uidsession required pam_unix.so
--
You received this message because you are subscribed to the Google Groups "Ansible Lockdown" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-lockdo...@googlegroups.com.
To post to this group, send email to ansible-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-lockdown/f01be42b-1c1c-42a4-8afb-01db8f86cb43%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I think that LineInFile is the right option here, with a modularized option as a close second. Understanding that creating a pam management module would likely be a longer effort, it seems as though lineinfile is the correct route for now.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-lockdown+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-lockdown@googlegroups.com.
The biggest problem with lineinfile, apart from the inherent inscrutability of regexes, is providing granularity in the tasks when the settings that need to be changed are all on the same lines. Currently there are five lineinfile tasks that cover three finding IDs. The last two of the five tasks overwrite each other, causing both to make changes each time. Trying to debug this the other night drove me nuts. This complexity is, I believe, counter to the spirit of Ansible.
I think the long term fix for this is a module. That abstracts the complexity away into an appropriate place.
Short term, I think an option to deploy a template with appropriate settings OR several lineinfile tasks will work. This can be toggled via a variable.
I could be wrong in my thinking, but most places do not deviate too much from the default configure in this file. It's even overwritten by running authconfig. So installing a full template is not entirely inappropriate if the end user of the roles feels that appropriate for their environment.
If someone knows they have custom settings they would like preserved, then the lineinfile tasks could be used. The current ones need some work so they stop stepping on each other, though. Also, this is a case where multiple findings have to be corrected by a single task, unless we get really crazy with the regexes and try to find/replace a particular key=value pair on one line. I did this years ago with sed. Maybe I can look at for some inspiration.
--
You received this message because you are subscribed to the Google Groups "Ansible Lockdown" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-lockdo...@googlegroups.com.
To post to this group, send email to ansible-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-lockdown/98d1b69c-4f4d-4873-89b1-ab308d30cfdd%40googlegroups.com.
Just FYI, we have an actual patch module that might work exactly as you want, can make changed idempotently and still respect other changes not in the same section.
--
You received this message because you are subscribed to the Google Groups "Ansible Lockdown" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-lockdo...@googlegroups.com.
To post to this group, send email to ansible-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-lockdown/8eeac17e-30f3-4776-a2e0-9d77357a793a%40googlegroups.com.
That's not a bad idea, though my only gripe would be that it may appear slightly less readable. I'll tinker for a bit and report back here. I definitely still want to crank out a pam module.
On Fri, Oct 23, 2015 at 9:37 AM, Brian Coca <bc...@ansible.com> wrote:
Just FYI, we have an actual patch module that might work exactly as you want, can make changed idempotently and still respect other changes not in the same section.
--
You received this message because you are subscribed to the Google Groups "Ansible Lockdown" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-lockdown+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-lockdown@googlegroups.com.