server FEATURE hash a clear-text NETCONF user password before storing it - #1823
Open
niklas-moser wants to merge 1 commit into
Open
server FEATURE hash a clear-text NETCONF user password before storing it#1823niklas-moser wants to merge 1 commit into
niklas-moser wants to merge 1 commit into
Conversation
iana-crypt-hash, and RFC 9645 with it, define "$0$<cleartext>" as a value the server is expected to replace with a hash before storing. It is stored verbatim, leaving the clear text in the running datastore and in every export of it. The ietf-netconf-server subscription is DONE_ONLY, which sysrepo runs only after the commit, so add a second one with SR_SUBSCR_UPDATE and rewrite every created or modified "$0$" hashed-password under listen/ and call-home/ into a "$6$" digest. Values that arrive already hashed are left alone, as are older datastores still holding a "$0$" one. Needs nc_server_config_hash_password() from libnetconf2.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
iana-crypt-hash, and RFC 9645 with it, define "$0$" as a value the server is expected to replace with a hash before storing. Netopeer2 stores it verbatim, leaving the clear text in the running datastore and in every export
of it. O-RAN WG11 R004, and 3GPP TS 33.117 clause 4.2.3.4.3.1 behind it, rule that out for a deployment that has to pass security conformance.
libnetconf2 can't fix this on its side: it gets the ietf-netconf-server data through a DONE_ONLY subscription, which sysrepo runs only after the commit. So this adds a second subscription with SR_SUBSCR_UPDATE — the one phase in
which a subscriber may still edit the data — and rewrites every created or modified "$0$" hashed-password under listen/ and call-home/ into a "$6$" digest, via nc_server_config_hash_password() from CESNET/libnetconf2#.
Already hashed values are untouched, and so are older datastores still holding a "$0$" one, which the SSH auth path keeps accepting — no datastore migration, only a change to what gets stored from now on.
Depends on CESNET/libnetconf2#639