Skip to content
Draft
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
4 changes: 2 additions & 2 deletions detector/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,11 @@ func Detect(rs []models.ScanResult, dir string) ([]models.ScanResult, error) {
func DetectPkgCves(r *models.ScanResult, ovalCnf config.GovalDictConf, gostCnf config.GostConf, vuls2Conf config.Vuls2Conf, logOpts logging.LogOpts, noProgress bool) error {
if isPkgCvesDetactable(r) {
switch r.Family {
case constant.RedHat, constant.CentOS, constant.Alma, constant.Rocky, constant.Oracle, constant.Alpine:
case constant.RedHat, constant.CentOS, constant.Alma, constant.Rocky, constant.Oracle, constant.Alpine, constant.OpenSUSE, constant.OpenSUSELeap, constant.SUSEEnterpriseServer, constant.SUSEEnterpriseDesktop:
if err := vuls2.Detect(r, vuls2Conf, noProgress); err != nil {
return xerrors.Errorf("Failed to detect CVE with Vuls2: %w", err)
}
case constant.Fedora, constant.Amazon, constant.OpenSUSE, constant.OpenSUSELeap, constant.SUSEEnterpriseServer, constant.SUSEEnterpriseDesktop:
case constant.Fedora, constant.Amazon:
if err := detectPkgsCvesWithOval(ovalCnf, r, logOpts); err != nil {
return xerrors.Errorf("Failed to detect CVE with OVAL: %w", err)
}
Expand Down
20 changes: 16 additions & 4 deletions detector/vuls2/vuls2.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
criteriaTypes "github.com/MaineK00n/vuls-data-update/pkg/extract/types/data/detection/condition/criteria"
criterionTypes "github.com/MaineK00n/vuls-data-update/pkg/extract/types/data/detection/condition/criteria/criterion"
vcAffectedRangeTypes "github.com/MaineK00n/vuls-data-update/pkg/extract/types/data/detection/condition/criteria/criterion/versioncriterion/affected/range"
"github.com/MaineK00n/vuls-data-update/pkg/extract/types/data/detection/condition/criteria/criterion/versioncriterion/fixstatus"
vcPackageTypes "github.com/MaineK00n/vuls-data-update/pkg/extract/types/data/detection/condition/criteria/criterion/versioncriterion/package"
segmentTypes "github.com/MaineK00n/vuls-data-update/pkg/extract/types/data/detection/segment"
ecosystemTypes "github.com/MaineK00n/vuls-data-update/pkg/extract/types/data/detection/segment/ecosystem"
Expand Down Expand Up @@ -120,8 +121,8 @@ func preConvert(sr *models.ScanResult) scanTypes.ScanResult {
return scanTypes.ScanResult{
JSONVersion: 0,
ServerName: sr.ServerName,
Family: ecosystemTypes.Ecosystem(sr.Family),
Release: sr.Release,
Family: ecosystemTypes.Ecosystem("suse.linux.enterprise.server"), // FIXME
Release: "15", // FIXME

Kernel: scanTypes.Kernel{
Release: sr.RunningKernel.Release,
Expand Down Expand Up @@ -466,6 +467,10 @@ func walkCriteria(e ecosystemTypes.Ecosystem, sourceID sourceTypes.SourceID, ca

switch cn.Criterion.Version.Package.Type {
case vcPackageTypes.PackageTypeBinary, vcPackageTypes.PackageTypeSource:
if !cn.Criterion.Version.Vulnerable {
continue
}

rangeType, fixedIn := func() (vcAffectedRangeTypes.RangeType, string) {
if cn.Criterion.Version.Affected == nil {
return vcAffectedRangeTypes.RangeTypeUnknown, ""
Expand All @@ -485,10 +490,17 @@ func walkCriteria(e ecosystemTypes.Ecosystem, sourceID sourceTypes.SourceID, ca
if cn.Criterion.Version.FixStatus == nil {
return ""
}

return cn.Criterion.Version.FixStatus.Vendor
}(),
FixedIn: fixedIn,
NotFixedYet: fixedIn == "",
FixedIn: fixedIn,
NotFixedYet: func() bool {

if cn.Criterion.Version.FixStatus == nil {
return true
}
return cn.Criterion.Version.FixStatus.Class != fixstatus.ClassFixed
}(),
},
})
}
Expand Down
6 changes: 5 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ require (
github.com/prometheus/common v0.62.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/redis/rueidis v1.0.60 // indirect
github.com/redis/rueidis v1.0.61 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/rubenv/sql-migrate v1.8.0 // indirect
Expand Down Expand Up @@ -381,3 +381,7 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.6.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace github.com/MaineK00n/vuls-data-update => ../vuls-data-update

replace github.com/MaineK00n/vuls2 => ../vuls2
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -682,10 +682,6 @@ github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapp
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
github.com/MaineK00n/go-paloalto-version v0.0.0-20250604055825-65738633ae7a h1:/ch5eGOtMXUGrS1uMvV07uWbuKEfMbm/3DeZ0Ctx52U=
github.com/MaineK00n/go-paloalto-version v0.0.0-20250604055825-65738633ae7a/go.mod h1:ELOxzfAd4oAe4niMmoZlSiJwzf1DF+DjNdjsUcuqAR8=
github.com/MaineK00n/vuls-data-update v0.0.0-20250612091020-1510dae2b184 h1:FxvcEbd/aEVKKXQpDbn9dC3GzUfRmLltzMwSS9/QCSA=
github.com/MaineK00n/vuls-data-update v0.0.0-20250612091020-1510dae2b184/go.mod h1:rAOVc7Vw0GX/KPj5I6jl5ObzWe6r0Kw625leCQHT7Uc=
github.com/MaineK00n/vuls2 v0.0.1-alpha.0.20250523010213-9b211cf92398 h1:sI22jqK3ptsn95EQldxgnsKYTRccxzVkFgbwFyNZFMY=
github.com/MaineK00n/vuls2 v0.0.1-alpha.0.20250523010213-9b211cf92398/go.mod h1:5kjwBPbOBPSxBTZz2dOGNbTPGWwawoiYwi4FZRprXl4=
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
Expand Down Expand Up @@ -1549,8 +1545,8 @@ github.com/redis/go-redis/extra/redisotel/v9 v9.0.5 h1:EfpWLLCyXw8PSM2/XNJLjI3Pb
github.com/redis/go-redis/extra/redisotel/v9 v9.0.5/go.mod h1:WZjPDy7VNzn77AAfnAfVjZNvfJTYfPetfZk5yoSTLaQ=
github.com/redis/go-redis/v9 v9.8.0 h1:q3nRvjrlge/6UD7eTu/DSg2uYiU2mCL0G/uzBWqhicI=
github.com/redis/go-redis/v9 v9.8.0/go.mod h1:huWgSWd8mW6+m0VPhJjSSQ+d6Nh1VICQ6Q5lHuCH/Iw=
github.com/redis/rueidis v1.0.60 h1:MGZX8uNdw7iyWz22JhjA/9iXzddfCUE/EMK4VxKoKpA=
github.com/redis/rueidis v1.0.60/go.mod h1:Lkhr2QTgcoYBhxARU7kJRO8SyVlgUuEkcJO1Y8MCluA=
github.com/redis/rueidis v1.0.61 h1:AkbCMeTyjFSQraGaNYncg3unMCTYGr6Y8WOqGhDOQu4=
github.com/redis/rueidis v1.0.61/go.mod h1:Lkhr2QTgcoYBhxARU7kJRO8SyVlgUuEkcJO1Y8MCluA=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
Expand Down