Skip to content

Commit

Permalink
feat: add openSUSE tumbleweed detection and scanning
Browse files Browse the repository at this point in the history
needs changes in trivy-db to go along from aquasecurity/trivy-db#411 to go along

aquasecurity/trivy-db#410
  • Loading branch information
msmeissn committed Jun 19, 2024
1 parent 2d85a00 commit fb89e70
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/detector/ospkg/detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ var (
ftypes.CentOS: redhat.NewScanner(),
ftypes.Rocky: rocky.NewScanner(),
ftypes.Oracle: oracle.NewScanner(),
ftypes.OpenSUSETumbleweed: suse.NewScanner(suse.OpenSUSETumbleweed),
ftypes.OpenSUSELeap: suse.NewScanner(suse.OpenSUSE),
ftypes.SLES: suse.NewScanner(suse.SUSEEnterpriseLinux),
ftypes.Photon: photon.NewScanner(),
Expand Down
9 changes: 9 additions & 0 deletions pkg/detector/ospkg/suse/suse.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const (
SUSEEnterpriseLinux Type = iota
// OpenSUSE for open versions
OpenSUSE
OpenSUSETumbleweed
)

// Scanner implements the SUSE scanner
Expand All @@ -84,6 +85,10 @@ func NewScanner(t Type) *Scanner {
return &Scanner{
vs: susecvrf.NewVulnSrc(susecvrf.OpenSUSE),
}
case OpenSUSETumbleweed:
return &Scanner{
vs: susecvrf.NewVulnSrc(susecvrf.OpenSUSETumbleweed),
}
}
return nil
}
Expand Down Expand Up @@ -128,5 +133,9 @@ func (s *Scanner) IsSupportedVersion(ctx context.Context, osFamily ftypes.OSType
if osFamily == ftypes.SLES {
return osver.Supported(ctx, slesEolDates, osFamily, osVer)
}
// tumbleweed is a rolling release, it has no version and no eol
if osFamily == ftypes.OpenSUSETumbleweed {
return true
}
return osver.Supported(ctx, opensuseEolDates, osFamily, osVer)
}

0 comments on commit fb89e70

Please sign in to comment.