1
0
mirror of https://github.com/securego/gosec.git synced 2025-07-09 00:45:40 +02:00

Add a rule to detect the usage of ssh InsecureIgnoreHostKey function

This commit is contained in:
Cosmin Cojocar
2018-02-06 16:56:26 +01:00
parent 8b87505d97
commit d3c3cd6419
4 changed files with 61 additions and 0 deletions

View File

@ -183,6 +183,15 @@ func main() {
z = z.Exp(x, y, m)
}`, 1}}
// SampleCodeG106 - ssh InsecureIgnoreHostKey
SampleCodeG106 = []CodeSample{{`
package main
import (
"golang.org/x/crypto/ssh"
)
func main() {
_ := ssh.InsecureIgnoreHostKey()
}`, 1}}
// SampleCodeG201 - SQL injection via format string
SampleCodeG201 = []CodeSample{
{`