Skip to content

Commit

Permalink
(#158) Fixed mangled auth files if cracklib is used as pwbackend (#159)
Browse files Browse the repository at this point in the history
* (#158) Fixed cracklib password backend application

Fixes #158

* (#158) Fixed mangled auth files if cracklib is used as pwbackend

Fixes #158
  • Loading branch information
michael-riddle authored Oct 29, 2024
1 parent 65e3612 commit 220716b
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 147 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Tue Oct 29 2024 Mike Riddle <[email protected]> - 7.2.2
- Fixed pam auth files getting mangled when using cracklib as the pwbackend

* Tue Oct 22 2024 Steven Pritchard <[email protected]> - 7.2.1
- Fix trailing whitespace in filenames and content

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simp-pam",
"version": "7.2.1",
"version": "7.2.2",
"author": "SIMP Team",
"summary": "A SIMP puppet module for managing pam",
"license": "Apache-2.0",
Expand Down
13 changes: 0 additions & 13 deletions spec/acceptance/nodesets/default.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
---
HOSTS:
el7:
roles:
- default
platform: el-7-x86_64
box: centos/7
hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
yum_repos:
chef-current:
baseurl: https://packages.chef.io/repos/yum/current/el/$releasever/$basearch
gpgkeys:
- https://packages.chef.io/chef.asc
family: centos-cloud/centos-7
gce_machine_type: n1-standard-2
el8:
platform: el-8-x86_64
box: generic/centos8
Expand Down
8 changes: 8 additions & 0 deletions spec/acceptance/nodesets/oel.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
---
HOSTS:
oel9:
roles:
- client
platform: el-9-x86_64
box: generic/oracle9
hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
family: sicura-image-build/oracle-linux-9
gce_machine_type: n1-standard-2
oel8:
roles:
- client
Expand Down
49 changes: 0 additions & 49 deletions spec/acceptance/suites/compliance/00_default_spec.rb

This file was deleted.

66 changes: 0 additions & 66 deletions spec/acceptance/suites/compliance/10_inspec_spec.rb

This file was deleted.

2 changes: 0 additions & 2 deletions spec/acceptance/suites/compliance/metadata.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
stdin = "Tst0$uPerFo0B@rB@z%\n"*repeat_when_failure
result = on(host, "passwd #{test_user}", {:stdin => stdin, :acceptable_exit_codes => [1]})
expect(result.stderr).to match(/password contains words from the real name of the user in some form/)
pending('gecoscheck does not work') if Integer(facts[:os]['release']['major']) > 7
end
end
end
Expand Down
28 changes: 14 additions & 14 deletions spec/acceptance/suites/security_modules/nodesets/default.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
HOSTS:
el7-server:
roles:
- default
platform: el-7-x86_64
box: centos/7
hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
family: centos-cloud/centos-7
gce_machine_type: n1-standard-2
el7-client:
platform: el-7-x86_64
box: centos/7
hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
family: centos-cloud/centos-7
gce_machine_type: n1-standard-2
# el7-server:
# roles:
# - default
# platform: el-7-x86_64
# box: centos/7
# hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
# family: centos-cloud/centos-7
# gce_machine_type: n1-standard-2
# el7-client:
# platform: el-7-x86_64
# box: centos/7
# hypervisor: "<%= ENV.fetch('BEAKER_HYPERVISOR', 'vagrant') %>"
# family: centos-cloud/centos-7
# gce_machine_type: n1-standard-2
el8-server:
platform: el-8-x86_64
box: generic/centos8
Expand Down
7 changes: 5 additions & 2 deletions templates/etc/pam.d/auth.epp
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ account required pam_permit.so

$_pam_password_check = "password requisite pam_${password_check_backend}.so${_cracklib_retry}${_cracklib_enforce_for_root}${_cracklib_reject_username}"
-%>
<%= $_pam_password_check %>
<% if ($password_check_backend == 'cracklib') { -%>
<%= $_pam_password_check -%>
<% if $cracklib_minlen { %> minlen=<%= $cracklib_minlen %><% } -%>
<% if $cracklib_minclass { %> minclass=<%= $cracklib_minclass %><% } -%>
<% if $cracklib_maxrepeat { %> maxrepeat=<%= $cracklib_maxrepeat %><% } -%>
Expand All @@ -254,7 +254,10 @@ account required pam_permit.so
<% if $cracklib_lcredit { %> lcredit=<%= $cracklib_lcredit %><% } -%>
<% if $cracklib_ocredit { %> ocredit=<%= $cracklib_ocredit %><% } -%>
<% if $cracklib_gecoscheck { %> gecoscheck<% } -%>
<% } -%>
<% %>
<% } else {-%>
<%= $_pam_password_check %>
<% }-%>
<%
if $manage_pwhistory_conf {
$_pam_pwhistory = 'password required pam_pwhistory.so use_authtok'
Expand Down

0 comments on commit 220716b

Please sign in to comment.