sapcc / asr1k-neutron-l3

Cisco ASR 1000 Neutron L3 driver
Apache License 2.0
4 stars 1 forks source link

Implement public-key authentication for netconf over ssh #109

Open swagner-de opened 7 months ago

swagner-de commented 7 months ago

Rotating credentials can be easier using key authentication for two reasons.

  1. We read the key from disk on each authentication, allowing us to exchange the secret without having to restart the driver.
  2. The device allows us to populate multiple keys for the same user.

With credential rotation in mind, we implement the ability to use multiple keys and also report if authentication with those keys have been successful, allowing third party tooling to verify that it is safe to rotate a key.

The _connect has also been moved from the YangConnection class to the ASR1KContext class. This has been done, as it was only using attributes of ASR1KContext, it was using none of the YangConnection attributes and could have been static. I also feel that is tightly coupled with the ASR1KContext.