-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #270 from treydock/faillock
Support managing faillock.conf and pwquality.conf
- Loading branch information
Showing
11 changed files
with
639 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# @summary Manage faillock.conf | ||
# | ||
# @param config_file | ||
# The faillock config path | ||
# @param config_file_owner | ||
# The faillock config owner | ||
# @param config_file_group | ||
# The faillock config group | ||
# @param config_file_mode | ||
# The faillock config mode | ||
# @param config_file_template | ||
# The faillock config template | ||
# @param config_file_source | ||
# The faillock config source | ||
# @param dir | ||
# The faillock 'dir' config option | ||
# @param audit_enabled | ||
# The faillock 'audit' config option | ||
# @param silent | ||
# The faillock 'silent' config option | ||
# @param no_log_info | ||
# The faillock 'no_log_info' config option | ||
# @param local_users_only | ||
# The faillock 'local_users_only' config option | ||
# @param deny | ||
# The faillock 'deny' config option | ||
# @param fail_interval | ||
# The faillock 'fail_interval' config option | ||
# @param unlock_time | ||
# The faillock 'unlock_time' config option | ||
# @param even_deny_root | ||
# The faillock 'even_deny_root' config option | ||
# @param root_unlock_time | ||
# The faillock 'root_unlock_time' config option | ||
# @param admin_group | ||
# The faillock 'admin_group' config option | ||
# | ||
class pam::faillock ( | ||
Stdlib::Absolutepath $config_file = '/etc/security/faillock.conf', | ||
String[1] $config_file_owner = 'root', | ||
String[1] $config_file_group = 'root', | ||
Stdlib::Filemode $config_file_mode = '0644', | ||
String[1] $config_file_template = 'pam/faillock.conf.erb', | ||
Optional[Stdlib::Filesource] $config_file_source = undef, | ||
Stdlib::Absolutepath $dir = '/var/run/faillock', | ||
Optional[Boolean] $audit_enabled = undef, | ||
Optional[Boolean] $silent = undef, | ||
Optional[Boolean] $no_log_info = undef, | ||
Optional[Boolean] $local_users_only = undef, | ||
Integer[0] $deny = 3, | ||
Integer[0] $fail_interval = 900, | ||
Integer[0] $unlock_time = 600, | ||
Optional[Boolean] $even_deny_root = undef, | ||
Integer[0] $root_unlock_time = $unlock_time, | ||
Optional[String[1]] $admin_group = undef, | ||
) { | ||
include pam | ||
|
||
if $config_file_source { | ||
$_config_file_content = undef | ||
} else { | ||
$_config_file_content = template($config_file_template) | ||
} | ||
|
||
file { 'faillock.conf': | ||
ensure => 'file', | ||
path => $config_file, | ||
owner => $config_file_owner, | ||
group => $config_file_group, | ||
mode => $config_file_mode, | ||
content => $_config_file_content, | ||
source => $config_file_source, | ||
require => Package[$pam::package_name], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
# @summary Manage pwquality.conf | ||
# | ||
# @example | ||
# This class is included by the pam class for platforms which use it. | ||
# | ||
# @param config_file | ||
# Path to pwquality.conf. | ||
# @param config_file_owner | ||
# Owner for pwquality.conf | ||
# @param config_file_group | ||
# Group for pwquality.conf | ||
# @param config_file_mode | ||
# Mode for config_file. | ||
# @param config_file_source | ||
# String with source path to a pwquality.conf | ||
# @param config_file_template | ||
# Template to render pwquality.conf | ||
# @param config_d_dir | ||
# Path to pwquality.conf.d directory. | ||
# @param config_d_dir_owner | ||
# Owner for pwquality.conf.d | ||
# @param config_d_dir_group | ||
# Group for pwquality.conf.d | ||
# @param config_d_dir_mode | ||
# Mode for pwquality.conf.d | ||
# @param purge_config_d_dir | ||
# Boolean to purge the pwquality.conf.d directory. | ||
# @param purge_config_d_dir_ignore | ||
# A glob or array of file names to ignore when purging pwquality.conf.d | ||
# | ||
# @param difok | ||
# The pwquality.conf 'difok' option | ||
# @param minlen | ||
# The pwquality.conf 'minlen' option | ||
# @param dcredit | ||
# The pwquality.conf 'dcredit' option | ||
# @param ucredit | ||
# The pwquality.conf 'ucredit' option | ||
# @param lcredit | ||
# The pwquality.conf 'lcredit' option | ||
# @param ocredit | ||
# The pwquality.conf 'ocredit' option | ||
# @param minclass | ||
# The pwquality.conf 'minclass' option | ||
# @param maxrepeat | ||
# The pwquality.conf 'maxrepeat' option | ||
# @param maxsequence | ||
# The pwquality.conf 'maxsequence' option | ||
# @param maxclassrepeat | ||
# The pwquality.conf 'maxclassrepeat' option | ||
# @param gecoscheck | ||
# The pwquality.conf 'gecoscheck' option | ||
# @param dictcheck | ||
# The pwquality.conf 'dictcheck' option | ||
# @param usercheck | ||
# The pwquality.conf 'usercheck' option | ||
# @param usersubstr | ||
# The pwquality.conf 'usersubstr' option | ||
# @param enforcing | ||
# The pwquality.conf 'enforcing' option | ||
# @param badwords | ||
# The pwquality.conf 'badwords' option | ||
# @param dictpath | ||
# The pwquality.conf 'dictpath' option | ||
# @param retry | ||
# The pwquality.conf 'retry' option | ||
# @param enforce_for_root | ||
# The pwquality.conf 'enforce_for_root' option | ||
# @param local_users_only | ||
# The pwquality.conf 'local_users_only' option | ||
# | ||
class pam::pwquality ( | ||
Stdlib::Absolutepath $config_file = '/etc/security/pwquality.conf', | ||
String[1] $config_file_owner = 'root', | ||
String[1] $config_file_group = 'root', | ||
Stdlib::Filemode $config_file_mode = '0644', | ||
Optional[Stdlib::Filesource] $config_file_source = undef, | ||
String[1] $config_file_template = 'pam/pwquality.conf.erb', | ||
Stdlib::Absolutepath $config_d_dir = '/etc/security/pwquality.conf.d', | ||
String[1] $config_d_dir_owner = 'root', | ||
String[1] $config_d_dir_group = 'root', | ||
Stdlib::Filemode $config_d_dir_mode = '0755', | ||
Boolean $purge_config_d_dir = true, | ||
Optional[Variant[String[1], Array[String[1]]]] $purge_config_d_dir_ignore = undef, | ||
Integer[0] $difok = 1, | ||
Integer[6] $minlen = 8, | ||
Integer $dcredit = 0, | ||
Integer $ucredit = 0, | ||
Integer $lcredit = 0, | ||
Integer $ocredit = 0, | ||
Integer[0] $minclass = 0, | ||
Integer[0] $maxrepeat = 0, | ||
Integer[0] $maxsequence = 0, | ||
Integer[0] $maxclassrepeat = 0, | ||
Integer[0] $gecoscheck = 0, | ||
Integer[0] $dictcheck = 1, | ||
Integer[0] $usercheck = 1, | ||
Integer[0] $usersubstr = 0, | ||
Integer[0] $enforcing = 1, | ||
Optional[Array[String[1]]] $badwords = undef, | ||
Optional[Stdlib::Absolutepath] $dictpath = undef, | ||
Integer[0] $retry = 1, | ||
Optional[Boolean] $enforce_for_root = undef, | ||
Optional[Boolean] $local_users_only = undef, | ||
) { | ||
include pam | ||
|
||
if $config_file_source { | ||
$_config_file_content = undef | ||
} else { | ||
$_config_file_content = template($config_file_template) | ||
} | ||
|
||
file { 'pwquality.conf': | ||
ensure => 'file', | ||
path => $config_file, | ||
owner => $config_file_owner, | ||
group => $config_file_group, | ||
mode => $config_file_mode, | ||
source => $config_file_source, | ||
content => $_config_file_content, | ||
require => Package[$pam::package_name], | ||
} | ||
|
||
file { 'pwquality.conf.d': | ||
ensure => 'directory', | ||
path => $config_d_dir, | ||
owner => $config_d_dir_owner, | ||
group => $config_d_dir_group, | ||
mode => $config_d_dir_mode, | ||
purge => $purge_config_d_dir, | ||
recurse => $purge_config_d_dir, | ||
ignore => $purge_config_d_dir_ignore, | ||
require => Package[$pam::package_name], | ||
} | ||
} |
Oops, something went wrong.