-
Notifications
You must be signed in to change notification settings - Fork 62
enable pam-plugin-faillock when it's installed with custom settings #724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,62 @@ | ||
| # Configuration for locking the user after multiple failed | ||
| # authentication attempts. | ||
| # | ||
| # The directory where the user files with the failure records are kept. | ||
| # The default is /var/run/faillock. | ||
| # dir = /var/run/faillock | ||
| # | ||
| # Will log the user name into the system log if the user is not found. | ||
| # Enabled if option is present. | ||
| audit | ||
| # | ||
| # Don't print informative messages. | ||
| # Enabled if option is present. | ||
| silent | ||
| # | ||
| # Don't log informative messages via syslog. | ||
| # Enabled if option is present. | ||
| # no_log_info | ||
| # | ||
| # Only track failed user authentications attempts for local users | ||
| # in /etc/passwd and ignore centralized (AD, IdM, LDAP, etc.) users. | ||
| # The `faillock` command will also no longer track user failed | ||
| # authentication attempts. Enabling this option will prevent a | ||
| # double-lockout scenario where a user is locked out locally and | ||
| # in the centralized mechanism. | ||
| # Enabled if option is present. | ||
| # local_users_only | ||
| # | ||
| # Deny access if the number of consecutive authentication failures | ||
| # for this user during the recent interval exceeds n tries. | ||
| # The default is 3. | ||
| deny = 3 | ||
| # | ||
| # The length of the interval during which the consecutive | ||
| # authentication failures must happen for the user account | ||
| # lock out is <replaceable>n</replaceable> seconds. | ||
| # The default is 900 (15 minutes). | ||
| fail_interval = 900 | ||
| # | ||
| # The access will be re-enabled after n seconds after the lock out. | ||
| # The value 0 has the same meaning as value `never` - the access | ||
| # will not be re-enabled without resetting the faillock | ||
| # entries by the `faillock` command. | ||
| # The default is 600 (10 minutes). | ||
| unlock_time = 0 | ||
| # | ||
| # Root account can become locked as well as regular accounts. | ||
| # Enabled if option is present. | ||
| # even_deny_root | ||
| # | ||
| # This option implies the `even_deny_root` option. | ||
| # Allow access after n seconds to root account after the | ||
| # account is locked. In case the option is not specified | ||
| # the value is the same as of the `unlock_time` option. | ||
| # root_unlock_time = 900 | ||
| # | ||
| # If a group name is specified with this option, members | ||
| # of the group will be handled by this module the same as | ||
| # the root account (the options `even_deny_root>` and | ||
| # `root_unlock_time` will apply to them. | ||
| # By default, the option is not set. | ||
| # admin_group = <admin_group_name> |
This file contains hidden or 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 |
|---|---|---|
| @@ -1 +1,23 @@ | ||
| FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" | ||
|
|
||
| SRC_URI += "\ | ||
| file://security/faillock.conf \ | ||
| " | ||
|
|
||
| do_install:append() { | ||
| install -m 644 ${WORKDIR}/security/faillock.conf ${D}${sysconfdir}/security/faillock.conf | ||
| } | ||
|
|
||
| pkg_postinst:pam-plugin-faillock:append() { | ||
| # enable faillock | ||
| sed -E -i 's/^(.+)success=1(.+)$/auth requisite pam_faillock.so preauth\n\1success=2\2\nauth [default=die] pam_faillock.so authfail/' "${sysconfdir}/pam.d/common-auth" | ||
| echo "auth sufficient pam_faillock.so authsucc" >> "${sysconfdir}/pam.d/common-auth" | ||
| } | ||
|
|
||
| pkg_prerm:pam-plugin-faillock:append() { | ||
| # disable faillock | ||
| sed -E -i '/pam_faillock.so/d' "${sysconfdir}/pam.d/common-auth" | ||
| sed -E -i 's/^(.+)success=2(.+)$/\1success=1\2/' "${sysconfdir}/pam.d/common-auth" | ||
| } | ||
|
|
||
| RCONFLICTS:pam-plugin-faillock:append = " ni-auth" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.