From 53deaee3d789c84686c733778167097a9d3bd565 Mon Sep 17 00:00:00 2001 From: Kota Kanbe Date: Fri, 25 Dec 2020 06:38:00 +0900 Subject: [PATCH] refactor(config): remove DependencyCheckXMLPath in config.toml (#1100) --- config/config.go | 55 ++++++++++++++++++++++---------------------- config/tomlloader.go | 4 ---- 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/config/config.go b/config/config.go index bc7c875a..ba92aa75 100644 --- a/config/config.go +++ b/config/config.go @@ -1096,34 +1096,33 @@ type Azure struct { // ServerInfo has SSH Info, additional CPE packages to scan. type ServerInfo struct { - ServerName string `toml:"-" json:"serverName,omitempty"` - User string `toml:"user,omitempty" json:"user,omitempty"` - Host string `toml:"host,omitempty" json:"host,omitempty"` - JumpServer []string `toml:"jumpServer,omitempty" json:"jumpServer,omitempty"` - Port string `toml:"port,omitempty" json:"port,omitempty"` - SSHConfigPath string `toml:"sshConfigPath,omitempty" json:"sshConfigPath,omitempty"` - KeyPath string `toml:"keyPath,omitempty" json:"keyPath,omitempty"` - KeyPassword string `json:"-,omitempty" toml:"-"` - CpeNames []string `toml:"cpeNames,omitempty" json:"cpeNames,omitempty"` - ScanMode []string `toml:"scanMode,omitempty" json:"scanMode,omitempty"` - DependencyCheckXMLPath string `toml:"dependencyCheckXMLPath,omitempty" json:"-"` // TODO Deprecated remove in near future - OwaspDCXMLPath string `toml:"owaspDCXMLPath,omitempty" json:"owaspDCXMLPath,omitempty"` - ContainersIncluded []string `toml:"containersIncluded,omitempty" json:"containersIncluded,omitempty"` - ContainersExcluded []string `toml:"containersExcluded,omitempty" json:"containersExcluded,omitempty"` - ContainerType string `toml:"containerType,omitempty" json:"containerType,omitempty"` - Containers map[string]ContainerSetting `toml:"containers" json:"containers,omitempty"` - IgnoreCves []string `toml:"ignoreCves,omitempty" json:"ignoreCves,omitempty"` - IgnorePkgsRegexp []string `toml:"ignorePkgsRegexp,omitempty" json:"ignorePkgsRegexp,omitempty"` - GitHubRepos map[string]GitHubConf `toml:"githubs" json:"githubs,omitempty"` // key: owner/repo - UUIDs map[string]string `toml:"uuids,omitempty" json:"uuids,omitempty"` - Memo string `toml:"memo,omitempty" json:"memo,omitempty"` - Enablerepo []string `toml:"enablerepo,omitempty" json:"enablerepo,omitempty"` // For CentOS, RHEL, Amazon - Optional map[string]interface{} `toml:"optional,omitempty" json:"optional,omitempty"` // Optional key-value set that will be outputted to JSON - Lockfiles []string `toml:"lockfiles,omitempty" json:"lockfiles,omitempty"` // ie) path/to/package-lock.json - FindLock bool `toml:"findLock,omitempty" json:"findLock,omitempty"` - Type string `toml:"type,omitempty" json:"type,omitempty"` // "pseudo" or "" - WordPress WordPressConf `toml:"wordpress,omitempty" json:"wordpress,omitempty"` - IgnoredJSONKeys []string `toml:"ignoredJSONKeys,omitempty" json:"ignoredJSONKeys,omitempty"` + ServerName string `toml:"-" json:"serverName,omitempty"` + User string `toml:"user,omitempty" json:"user,omitempty"` + Host string `toml:"host,omitempty" json:"host,omitempty"` + JumpServer []string `toml:"jumpServer,omitempty" json:"jumpServer,omitempty"` + Port string `toml:"port,omitempty" json:"port,omitempty"` + SSHConfigPath string `toml:"sshConfigPath,omitempty" json:"sshConfigPath,omitempty"` + KeyPath string `toml:"keyPath,omitempty" json:"keyPath,omitempty"` + KeyPassword string `json:"-,omitempty" toml:"-"` + CpeNames []string `toml:"cpeNames,omitempty" json:"cpeNames,omitempty"` + ScanMode []string `toml:"scanMode,omitempty" json:"scanMode,omitempty"` + OwaspDCXMLPath string `toml:"owaspDCXMLPath,omitempty" json:"owaspDCXMLPath,omitempty"` + ContainersIncluded []string `toml:"containersIncluded,omitempty" json:"containersIncluded,omitempty"` + ContainersExcluded []string `toml:"containersExcluded,omitempty" json:"containersExcluded,omitempty"` + ContainerType string `toml:"containerType,omitempty" json:"containerType,omitempty"` + Containers map[string]ContainerSetting `toml:"containers" json:"containers,omitempty"` + IgnoreCves []string `toml:"ignoreCves,omitempty" json:"ignoreCves,omitempty"` + IgnorePkgsRegexp []string `toml:"ignorePkgsRegexp,omitempty" json:"ignorePkgsRegexp,omitempty"` + GitHubRepos map[string]GitHubConf `toml:"githubs" json:"githubs,omitempty"` // key: owner/repo + UUIDs map[string]string `toml:"uuids,omitempty" json:"uuids,omitempty"` + Memo string `toml:"memo,omitempty" json:"memo,omitempty"` + Enablerepo []string `toml:"enablerepo,omitempty" json:"enablerepo,omitempty"` // For CentOS, RHEL, Amazon + Optional map[string]interface{} `toml:"optional,omitempty" json:"optional,omitempty"` // Optional key-value set that will be outputted to JSON + Lockfiles []string `toml:"lockfiles,omitempty" json:"lockfiles,omitempty"` // ie) path/to/package-lock.json + FindLock bool `toml:"findLock,omitempty" json:"findLock,omitempty"` + Type string `toml:"type,omitempty" json:"type,omitempty"` // "pseudo" or "" + WordPress WordPressConf `toml:"wordpress,omitempty" json:"wordpress,omitempty"` + IgnoredJSONKeys []string `toml:"ignoredJSONKeys,omitempty" json:"ignoredJSONKeys,omitempty"` // internal use IPv4Addrs []string `toml:"-" json:"ipv4Addrs,omitempty"` diff --git a/config/tomlloader.go b/config/tomlloader.go index b772fd9e..3fb4c633 100644 --- a/config/tomlloader.go +++ b/config/tomlloader.go @@ -164,10 +164,6 @@ func (c TOMLLoader) Load(pathToToml, keyPass string) error { s.Containers[contName] = cont } - if len(v.DependencyCheckXMLPath) != 0 || len(d.DependencyCheckXMLPath) != 0 { - return xerrors.Errorf("[DEPRECATED] dependencyCheckXMLPath IS DEPRECATED. USE owaspDCXMLPath INSTEAD: %s", serverName) - } - s.OwaspDCXMLPath = v.OwaspDCXMLPath if len(s.OwaspDCXMLPath) == 0 { s.OwaspDCXMLPath = d.OwaspDCXMLPath