-
Notifications
You must be signed in to change notification settings - Fork 13
v2025.11.01 release #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…a' and (1) matching existing interfaces and (2) making sure to also collect vmbr* interfaces
Site add works Device role add works Device type add works Add interface(s) to device type works Adding devices does *not* work. Need to investigate.
Adds mac addresses to discovered interfaces Needs to add support for vmbr* interfaces (and their physical mappings) Needs to map IP addresses to network interfaces Needs to add cluster and type to Proxmox Needs to associate devices with Proxmox cluster
…s on all devices.
…dress information
Tons of refactoring around how network configuration is discovered on Proxmox node(s)
Adds rudimentary (buggy!) branching support -- DO NOT USE
… interface object. Adds hasattr and findByMulti to give us a single object. Fixes class naming to that it is consistent in terms of case, i.e. Netbox -> NetBox
Adds Platforms creation for Devices
…ts in netbox_object.py
Reworks order of creation (of cluster type, group, cluster) and adds cluster creation to device creation rather than as a separate step
| client = paramiko.SSHClient() | ||
|
|
||
| # Set policy for handling unknown host keys (AutoAddPolicy for convenience, RejectPolicy for security in production) | ||
| client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) |
Check failure
Code scanning / CodeQL
Accepting unknown SSH host keys when using Paramiko High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 22 days ago
The most robust and direct fix is to remove the explicit AutoAddPolicy assignment and ensure that a secure policy is used. By default, Paramiko uses RejectPolicy, which will cause the connection to fail if the host key is unknown. If needed, you can load known hosts from the user's ~/.ssh/known_hosts file using client.load_system_host_keys(), which is standard SSH behavior. This ensures that only known, trusted hosts are accepted.
To apply this fix:
- Remove or replace the line that sets the host key policy to
paramiko.AutoAddPolicy(). - Optionally, add
client.load_system_host_keys()after creating the client, so that host keys are checked against the system's list of known hosts. - Do not add
AutoAddPolicyorWarningPolicyanywhere in the function. - No extra imports are required, as everything is already present.
-
Copy modified lines R84-R85
| @@ -81,10 +81,9 @@ | ||
|
|
||
| # Create an SSH client instance | ||
| client = paramiko.SSHClient() | ||
| client.load_system_host_keys() | ||
| # By default, SSHClient uses RejectPolicy, which is secure and will raise an exception if the host is not known. | ||
|
|
||
| # Set policy for handling unknown host keys (AutoAddPolicy for convenience, RejectPolicy for security in production) | ||
| client.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | ||
|
|
||
| # Connect to the server | ||
| try: | ||
| if not 'login' in proxmox_node_info: |
| if device_interface.name.startswith('vmbr'): | ||
| continue | ||
|
|
||
| print(f"device: {proxmox_node}, interface: {device_interface} {device_interface.type} {device_interface.mac_address}") |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
sensitive data (private)
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 22 days ago
To fix the problem, we should avoid logging sensitive data such as the MAC address.
- The best solution is to remove
device_interface.mac_addressfrom log outputs. - Optionally, if logging is truly needed for operational reasons, one may consider redacting part of the MAC address or only logging non-sensitive attributes (like name, type), but never the full MAC.
- Specifically, in file
setup/netbox-discover-proxmox-cluster-and-nodes.py, line 211, modify the print statement to excludedevice_interface.mac_address. - No extra imports or methods are needed; simply alter the print statement accordingly.
-
Copy modified line R211
| @@ -208,7 +208,7 @@ | ||
| if device_interface.name.startswith('vmbr'): | ||
| continue | ||
|
|
||
| print(f"device: {proxmox_node}, interface: {device_interface} {device_interface.type} {device_interface.mac_address}") | ||
| print(f"device: {proxmox_node}, interface: {device_interface} {device_interface.type}") | ||
|
|
||
| try: | ||
| NetBoxDeviceInterfaceMacAddressMapping(nb_url, app_config['netbox_api_config']['api_token'], netbox_device_id, device_interface, nb_pxmx_cluster.discovered_proxmox_nodes_information[proxmox_node]['system']['network_interfaces'][device_interface.name]) |
No description provided.