Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,10 @@ type ServerInfo struct {
IgnorePkgsRegexp []string `toml:"ignorePkgsRegexp,omitempty" json:"ignorePkgsRegexp,omitempty"`
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, Alma, Rocky, RHEL, Amazon
Optional map[string]any `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
Enablerepo []string `toml:"enablerepo,omitempty" json:"enablerepo,omitempty"` // For CentOS, Alma, Rocky, RHEL, Amazon, Fedora
Disablerepo []string `toml:"disablerepo,omitempty" json:"disablerepo,omitempty"` // For CentOS, Alma, Rocky, RHEL, Amazon, Fedora
Optional map[string]any `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"`
FindLockDirs []string `toml:"findLockDirs,omitempty" json:"findLockDirs,omitempty"`
Type string `toml:"type,omitempty" json:"type,omitempty"` // "pseudo" or ""
Expand Down
4 changes: 4 additions & 0 deletions config/tomlloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ func (c TOMLLoader) Load(pathToToml string) error {
}
}

if len(server.Disablerepo) == 0 {
server.Disablerepo = Conf.Default.Disablerepo
}

if server.PortScan.ScannerBinPath != "" {
server.PortScan.IsUseExternalScanner = true
}
Expand Down
4 changes: 4 additions & 0 deletions saas/uuid.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ func cleanForTOMLEncoding(server config.ServerInfo, def config.ServerInfo) confi
server.Enablerepo = nil
}

if reflect.DeepEqual(server.Disablerepo, def.Disablerepo) {
server.Disablerepo = nil
}

for k, v := range def.Optional {
if vv, ok := server.Optional[k]; ok && v == vv {
delete(server.Optional, k)
Expand Down
3 changes: 3 additions & 0 deletions scanner/redhatbase.go
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,9 @@ func (o *redhatBase) scanUpdatablePackages() (models.Packages, error) {
for _, repo := range o.getServerInfo().Enablerepo {
cmd += " --enablerepo=" + repo
}
for _, repo := range o.getServerInfo().Disablerepo {
cmd += " --disablerepo=" + repo
}

r := o.exec(util.PrependProxyEnv(cmd), o.sudo.repoquery())
if !r.isSuccess() {
Expand Down
4 changes: 4 additions & 0 deletions subcmds/discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ func printConfigToml(ips []string) (err error) {
#containerType = "docker" #or "lxd" or "lxc" default: docker
#containersIncluded = ["${running}"]
#containersExcluded = ["container_name_a"]
#enablerepo = ["base", "updates"] # For RHEL-family. Currently only "base" and "updates" are allowed
#disablerepo = ["epel"] # For RHEL-family

# https://vuls.io/docs/en/config.toml.html#servers-section
[servers]
Expand All @@ -231,6 +233,8 @@ host = "{{$ip}}"
#containerType = "docker" #or "lxd" or "lxc" default: docker
#containersIncluded = ["${running}"]
#containersExcluded = ["container_name_a"]
#enablerepo = ["base", "updates"] # For RHEL-family. Currently only "base" and "updates" are allowed
#disablerepo = ["epel"] # For RHEL-family
#confidenceScoreOver = 80

#[servers.{{index $names $i}}.containers.container_name_a]
Expand Down
Loading