mirror of
https://github.com/github/codeql.git
synced 2025-12-18 09:43:15 +01:00
21 lines
602 B
Python
21 lines
602 B
Python
from paramiko.client import AutoAddPolicy, WarningPolicy, RejectPolicy, SSHClient
|
|
|
|
client = SSHClient()
|
|
|
|
client.set_missing_host_key_policy(AutoAddPolicy) # bad
|
|
client.set_missing_host_key_policy(RejectPolicy) # good
|
|
client.set_missing_host_key_policy(WarningPolicy) # bad
|
|
|
|
# Using instances
|
|
|
|
client.set_missing_host_key_policy(AutoAddPolicy()) # bad
|
|
client.set_missing_host_key_policy(RejectPolicy()) # good
|
|
client.set_missing_host_key_policy(WarningPolicy()) # bad
|
|
|
|
# different import
|
|
|
|
import paramiko
|
|
|
|
client = paramiko.SSHClient()
|
|
client.set_missing_host_key_policy(paramiko.AutoAddPolicy) # bad
|