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 3e9c836
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/docs/coverage/os/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Trivy supports operating systems for
| [CBL-Mariner](cbl-mariner.md) | 1.0, 2.0 | dnf/yum/rpm |
| [Amazon Linux](amazon.md) | 1, 2, 2023 | dnf/yum/rpm |
| [openSUSE Leap](suse.md) | 42, 15 | zypper/rpm |
| [openSUSE Tumbleweed](suse.md) | (n/a) | zypper/rpm |
| [SUSE Enterprise Linux](suse.md) | 11, 12, 15 | zypper/rpm |
| [Photon OS](photon.md) | 1.0, 2.0, 3.0, 4.0 | tndf/yum/rpm |
| [Debian GNU/Linux](debian.md) | 7, 8, 9, 10, 11, 12 | apt/dpkg |
Expand Down
5 changes: 3 additions & 2 deletions docs/docs/coverage/os/suse.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Trivy supports the following distributions:

- openSUSE Leap
- openSUSE Tumbleweed
- SUSE Enterprise Linux (SLE)

Please see [here](index.md#supported-os) for supported versions.
Expand Down Expand Up @@ -35,6 +36,6 @@ Trivy identifies licenses by examining the metadata of RPM packages.


[dependency-graph]: ../../configuration/reporting.md#show-origins-of-vulnerable-dependencies
[cvrf]: http://ftp.suse.com/pub/projects/security/cvrf/
[cvrf]: https://ftp.suse.com/pub/projects/security/cvrf/

[vulnerability statuses]: ../../configuration/filtering.md#by-status
[vulnerability statuses]: ../../configuration/filtering.md#by-status
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),
}
}

Check failure on line 92 in pkg/detector/ospkg/suse/suse.go

View workflow job for this annotation

GitHub Actions / Integration Test

undefined: susecvrf.OpenSUSETumbleweed

Check failure on line 92 in pkg/detector/ospkg/suse/suse.go

View workflow job for this annotation

GitHub Actions / Build Test (windows-latest)

undefined: susecvrf.OpenSUSETumbleweed

Check failure on line 92 in pkg/detector/ospkg/suse/suse.go

View workflow job for this annotation

GitHub Actions / Test (macos-latest)

undefined: susecvrf.OpenSUSETumbleweed

Check failure on line 92 in pkg/detector/ospkg/suse/suse.go

View workflow job for this annotation

GitHub Actions / K8s Integration Test

undefined: susecvrf.OpenSUSETumbleweed

Check failure on line 92 in pkg/detector/ospkg/suse/suse.go

View workflow job for this annotation

GitHub Actions / Module Integration Test

undefined: susecvrf.OpenSUSETumbleweed

Check failure on line 92 in pkg/detector/ospkg/suse/suse.go

View workflow job for this annotation

GitHub Actions / VM Integration Test

undefined: 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 3e9c836

Please sign in to comment.