ClusterLabs / anvil

The Anvil! Intelligent Availability™ Platform, mark 3
5 stars 6 forks source link

Update how bad SSH keys are handled in the UI #706

Open digimer opened 2 months ago

digimer commented 2 months ago

The old way was to look up state_uuids that contained the bad_file=X,bad_line=Y. This needs to be updated so that the job_data is just bad_key=X.

We need to coordinate this so that we update Remote.pm calls that record the bad key directly, instead of the file/line.

digimer commented 2 months ago

The back-end is updated now to support the old way and the new way.

The front end needs to now show bad keys, and not worry about which host noticed first. That is to say, pull the host with the changed key from states -> state_name by pull the name or IP from host_key_changed::X. The offending key is recorded in state_note as key=Y. If multiple entries exist with the same key (ie: one with the short host name, one with the full domain name, one with the IP), use the one that matches a hosts -> host_name. If none match, show the first match that isn't an IP address. If only IP addresses exist, show the first one you see.

In any case, when the user requests a bad key to be deleted, create a job for each host with the job_data being bad_key=Y. The back end now looks for any entry with that key and deletes them all, so the offending file/line mechanism is no longer needed.

When the front end is ready, there is legacy code to remove from the back end before this issue closes.

ylei-tsubame commented 2 months ago

Additional notes:

ylei-tsubame commented 2 months ago

Refer to #703 for previous records of this issue.