refactor(scan): remove yum-security related code (#836)
* refactor(scan): remove yum-security related code * fix(reporting): error if no OVAL entry
This commit is contained in:
@@ -52,59 +52,11 @@ func (o *oracle) depsFast() []string {
|
||||
}
|
||||
|
||||
func (o *oracle) depsFastRoot() []string {
|
||||
if o.getServerInfo().Mode.IsOffline() {
|
||||
//TODO
|
||||
// return []string{"yum-plugin-ps"}
|
||||
}
|
||||
|
||||
majorVersion, _ := o.Distro.MajorVersion()
|
||||
switch majorVersion {
|
||||
case 5:
|
||||
return []string{
|
||||
"yum-utils",
|
||||
"yum-security",
|
||||
}
|
||||
case 6:
|
||||
return []string{
|
||||
"yum-utils",
|
||||
"yum-plugin-security",
|
||||
//TODO
|
||||
// return []string{"yum-plugin-ps"}
|
||||
}
|
||||
default:
|
||||
return []string{
|
||||
"yum-utils",
|
||||
//TODO
|
||||
// return []string{"yum-plugin-ps"}
|
||||
}
|
||||
}
|
||||
return []string{"yum-utils"}
|
||||
}
|
||||
|
||||
func (o *oracle) depsDeep() []string {
|
||||
majorVersion, _ := o.Distro.MajorVersion()
|
||||
switch majorVersion {
|
||||
case 5:
|
||||
return []string{
|
||||
"yum-utils",
|
||||
"yum-security",
|
||||
"yum-changelog",
|
||||
}
|
||||
case 6:
|
||||
return []string{
|
||||
"yum-utils",
|
||||
"yum-plugin-security",
|
||||
"yum-plugin-changelog",
|
||||
//TODO
|
||||
// return []string{"yum-plugin-ps"}
|
||||
}
|
||||
default:
|
||||
return []string{
|
||||
"yum-utils",
|
||||
"yum-plugin-changelog",
|
||||
//TODO
|
||||
// return []string{"yum-plugin-ps"}
|
||||
}
|
||||
}
|
||||
return o.depsFastRoot()
|
||||
}
|
||||
|
||||
func (o *oracle) checkIfSudoNoPasswd() error {
|
||||
@@ -126,21 +78,7 @@ func (o *oracle) sudoNoPasswdCmdsFastRoot() []cmd {
|
||||
if o.getServerInfo().Mode.IsOffline() {
|
||||
return cmds
|
||||
}
|
||||
|
||||
majorVersion, _ := o.Distro.MajorVersion()
|
||||
if majorVersion < 6 {
|
||||
return []cmd{
|
||||
{"yum repolist --color=never", exitStatusZero},
|
||||
{"yum list-security --security --color=never", exitStatusZero},
|
||||
{"yum info-security --color=never", exitStatusZero},
|
||||
{"repoquery -h", exitStatusZero},
|
||||
}
|
||||
}
|
||||
return append(cmds,
|
||||
cmd{"yum repolist --color=never", exitStatusZero},
|
||||
cmd{"yum updateinfo list updates --security --color=never", exitStatusZero},
|
||||
cmd{"yum updateinfo updates --security --color=never", exitStatusZero},
|
||||
cmd{"repoquery -h", exitStatusZero})
|
||||
return append(cmds, cmd{"repoquery -h", exitStatusZero})
|
||||
}
|
||||
|
||||
func (o *oracle) sudoNoPasswdCmdsDeep() []cmd {
|
||||
@@ -153,19 +91,6 @@ func (o rootPrivOracle) repoquery() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (o rootPrivOracle) yumRepolist() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (o rootPrivOracle) yumUpdateInfo() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// root privilege isn't needed
|
||||
func (o rootPrivOracle) yumChangelog() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (o rootPrivOracle) yumMakeCache() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user