packagemainimport("golang.org/x/crypto/ssh")funcmain(){// Use a more secure approach instead of InsecureIgnoreHostKey
hostKeyCallback,_:=ssh.NewKnownHostsCallback("/path/to/known_hosts")}
packagemainimport("golang.org/x/crypto/ssh")funcmain(){// not valid in tests
_=ssh.InsecureIgnoreHostKey()}
Seamless integrations. Try Datadog Code Security
Datadog Code Security
Try this rule and analyze your code with Datadog Code Security
How to use this rule
1
2
rulesets:- go-security # Rules to enforce Go security.
Create a static-analysis.datadog.yml with the content above at the root of your repository
Use our free IDE Plugins or add Code Security scans to your CI pipelines