Change default ssh method from go library to external command (#416)

* Change default ssh method from go library to external command
This commit is contained in:
Kota Kanbe
2017-04-06 12:00:09 +09:00
committed by Teppei Fukuda
parent 33b2aa2d52
commit 05884c2d29
6 changed files with 45 additions and 43 deletions

View File

@@ -44,7 +44,7 @@ type Config struct {
CvssScoreOver float64
IgnoreUnscoredCves bool
SSHExternal bool
SSHNative bool
ContainersOnly bool
SkipBroken bool
@@ -82,8 +82,8 @@ type Config struct {
func (c Config) ValidateOnConfigtest() bool {
errs := []error{}
if runtime.GOOS == "windows" && c.SSHExternal {
errs = append(errs, fmt.Errorf("-ssh-external cannot be used on windows"))
if runtime.GOOS == "windows" && !c.SSHNative {
errs = append(errs, fmt.Errorf("-ssh-native-insecure is needed on windows"))
}
_, err := valid.ValidateStruct(c)
@@ -114,8 +114,8 @@ func (c Config) ValidateOnScan() bool {
}
}
if runtime.GOOS == "windows" && c.SSHExternal {
errs = append(errs, fmt.Errorf("-ssh-external cannot be used on windows"))
if runtime.GOOS == "windows" && !c.SSHNative {
errs = append(errs, fmt.Errorf("-ssh-native-insecure is needed on windows"))
}
if len(c.ResultsDir) != 0 {