Skip to content

server FEATURE hash a clear-text NETCONF user password before storing it - #1823

Open
niklas-moser wants to merge 1 commit into
CESNET:develfrom
niklas-moser:hash-user-passwords
Open

server FEATURE hash a clear-text NETCONF user password before storing it#1823
niklas-moser wants to merge 1 commit into
CESNET:develfrom
niklas-moser:hash-user-passwords

Conversation

@niklas-moser

Copy link
Copy Markdown

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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant