refactor(config): localize config used like a global variable (#1179)
* refactor(report): LocalFileWriter * refactor -format-json * refacotr: -format-one-email * refactor: -format-csv * refactor: -gzip * refactor: -format-full-text * refactor: -format-one-line-text * refactor: -format-list * refacotr: remove -to-* from config * refactor: IgnoreGitHubDismissed * refactor: GitHub * refactor: IgnoreUnsocred * refactor: diff * refacotr: lang * refacotr: cacheDBPath * refactor: Remove config references * refactor: ScanResults * refacotr: constant pkg * chore: comment * refactor: scanner * refactor: scanner * refactor: serverapi.go * refactor: serverapi * refactor: change pkg structure * refactor: serverapi.go * chore: remove emtpy file * fix(scan): remove -ssh-native-insecure option * fix(scan): remove the deprecated option `keypassword`
This commit is contained in:
69
scanner/pseudo.go
Normal file
69
scanner/pseudo.go
Normal file
@@ -0,0 +1,69 @@
|
||||
package scanner
|
||||
|
||||
import (
|
||||
"github.com/future-architect/vuls/config"
|
||||
"github.com/future-architect/vuls/constant"
|
||||
"github.com/future-architect/vuls/models"
|
||||
"github.com/future-architect/vuls/util"
|
||||
)
|
||||
|
||||
// inherit OsTypeInterface
|
||||
type pseudo struct {
|
||||
base
|
||||
}
|
||||
|
||||
func detectPseudo(c config.ServerInfo) (itsMe bool, pseudo osTypeInterface, err error) {
|
||||
if c.Type == constant.ServerTypePseudo {
|
||||
p := newPseudo(c)
|
||||
p.setDistro(constant.ServerTypePseudo, "")
|
||||
return true, p, nil
|
||||
}
|
||||
return false, nil, nil
|
||||
}
|
||||
|
||||
func newPseudo(c config.ServerInfo) *pseudo {
|
||||
d := &pseudo{
|
||||
base: base{
|
||||
osPackages: osPackages{
|
||||
Packages: models.Packages{},
|
||||
VulnInfos: models.VulnInfos{},
|
||||
},
|
||||
},
|
||||
}
|
||||
d.log = util.NewCustomLogger(c)
|
||||
d.setServerInfo(c)
|
||||
return d
|
||||
}
|
||||
|
||||
func (o *pseudo) checkScanMode() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *pseudo) checkIfSudoNoPasswd() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *pseudo) checkDeps() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *pseudo) preCure() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *pseudo) postScan() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *pseudo) scanPackages() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *pseudo) parseInstalledPackages(string) (models.Packages, models.SrcPackages, error) {
|
||||
return nil, nil, nil
|
||||
}
|
||||
|
||||
func (o *pseudo) detectPlatform() {
|
||||
o.setPlatform(models.Platform{Name: "other"})
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user