-
Notifications
You must be signed in to change notification settings - Fork 164
session server ssh FEATURE lock an account out after repeated failed password authentication #640
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
Open
niklas-moser
wants to merge
3
commits into
CESNET:devel
Choose a base branch
from
niklas-moser:ssh-auth-lockout
base: devel
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
dccb1e7
session server ssh FEATURE lock an account out after repeated failed …
niklas-moser 0b9de6a
session server BUGFIX free the lockout tally after threads are joined
niklas-moser 5e38d57
session server ssh UPDATE make the password authentication lockout op…
niklas-moser 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
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 |
|---|---|---|
|
|
@@ -31,6 +31,10 @@ module libnetconf2-netconf-server { | |
| prefix tlss; | ||
| } | ||
|
|
||
| revision "2026-09-18" { | ||
| description "Added password authentication lockout configuration."; | ||
| } | ||
|
|
||
| revision "2026-04-17" { | ||
| description "Change SSH banner description, reference and string length to reflect its correct purpose."; | ||
| } | ||
|
|
@@ -159,6 +163,67 @@ module libnetconf2-netconf-server { | |
| description | ||
| "Represents the maximum amount of seconds an authentication can go on for."; | ||
| } | ||
|
|
||
| leaf max-auth-attempts { | ||
| type uint16; | ||
| default 0; | ||
| description | ||
| "Maximum number of failed authentication attempts allowed within a single SSH session, | ||
| after which the session is disconnected. Every rejected credential counts, including | ||
| every public key a client offers that the server does not accept, so this must be set | ||
| high enough for clients whose SSH agent holds several keys. | ||
|
|
||
| The value 0 means no limit, in which case only auth-timeout bounds a single session."; | ||
| } | ||
|
|
||
| container lockout { | ||
| presence | ||
| "Enables locking an account out of password authentication after repeated failures."; | ||
|
|
||
| description | ||
| "Locks an account out of password authentication once it fails too many times in a row. | ||
| Failures are counted per (username, client address) pair across connections, so that a | ||
| client that cannot reach the account from its own address cannot lock the account out for | ||
| anyone else. The tally is shared by every password-based method the server offers, which | ||
| are the configured password, keyboard-interactive and PAM. Public key authentication is | ||
| not counted and never refused, so a locked out deployment stays reachable. | ||
|
|
||
| The policy configured here is the one of the endpoint the connection arrived on; it is not | ||
| re-evaluated when authentication falls through to a referenced endpoint. | ||
|
|
||
| The tally is kept in memory. It additionally survives a server restart if the server was | ||
| built with the AUTHLOCK_FILE option or the application set a path with the | ||
| nc_server_ssh_set_authlock_path() API call."; | ||
|
|
||
| reference | ||
| "3GPP TS 33.117: Catalogue of general security assurance requirements, section 4.2.3.4.3.1"; | ||
|
|
||
| leaf max-fails { | ||
| type uint16 { | ||
| range "1..max"; | ||
| } | ||
| default 5; | ||
| description | ||
| "Number of consecutive failed password authentications that lock the account out."; | ||
| } | ||
|
|
||
| leaf lock-time { | ||
| type uint16; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should also add |
||
| default 300; | ||
| units "seconds"; | ||
| description | ||
| "How long the account stays locked out of password authentication."; | ||
| } | ||
|
|
||
| leaf fail-window { | ||
| type uint16; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should also add |
||
| default 900; | ||
| units "seconds"; | ||
| description | ||
| "Two consecutive failures further apart than this do not count towards the same tally, | ||
| so that occasional typos spread over a long time never lock an account out."; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| grouping ssh-server-banner-grouping { | ||
|
|
||
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall pretty long. No need to mention implementation details in the YANG description, so the last paragraph + (username, client address) part can be dropped. Other parts possibly too.
It should plainly metion something along: "it's an account-lockout control for 3GPP 33.117 compliance, that the brute-force rate limit is
max-auth-attempts+auth-timeout, and that enablinglockoutwithoutmax-auth-attemptsstill enables one connection to make an unlimited amount of attempts".