ssh_validator
drunc.apps.ssh_validator
Perform a security and connectivity audit of NP0x cluster hosts via SSH. This script checks for host key mismatches (MITM), new host keys, authentication failures, and connectivity issues. It uses the Rich library to display a live-updating table of results in the terminal.
Functions:
check_host_ssh(host)
Audit the SSH connection.
Executes a native SSH connection to test host key, auth, and MITM status. Uses BatchMode to avoid password prompt hangups.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
host
|
str
|
The hostname or IP address of the target SSH server. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
A dictionary containing the audit results for the host, including status, |
dict
|
MITM detection, new key detection, authentication failure, timeout, and details. |
Source code in drunc/apps/ssh_validator.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | |
generate_table(results_map)
Generate the Rich Table based on the current state of results_map.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results_map
|
dict
|
A dictionary mapping hostnames to their SSH check results. |
required |
Returns:
| Type | Description |
|---|---|
Table
|
A Rich Table object ready for display. |
Source code in drunc/apps/ssh_validator.py
main()
Run the SSH audit and display the results in a live-updating table.
Returns:
| Type | Description |
|---|---|
|
None |