Skip to content

Commit 3e9c836

Browse files
committed
feat: add openSUSE tumbleweed detection and scanning
needs changes in trivy-db to go along from aquasecurity/trivy-db#411 to go along aquasecurity/trivy-db#410
1 parent 2d85a00 commit 3e9c836

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

docs/docs/coverage/os/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Trivy supports operating systems for
2222
| [CBL-Mariner](cbl-mariner.md) | 1.0, 2.0 | dnf/yum/rpm |
2323
| [Amazon Linux](amazon.md) | 1, 2, 2023 | dnf/yum/rpm |
2424
| [openSUSE Leap](suse.md) | 42, 15 | zypper/rpm |
25+
| [openSUSE Tumbleweed](suse.md) | (n/a) | zypper/rpm |
2526
| [SUSE Enterprise Linux](suse.md) | 11, 12, 15 | zypper/rpm |
2627
| [Photon OS](photon.md) | 1.0, 2.0, 3.0, 4.0 | tndf/yum/rpm |
2728
| [Debian GNU/Linux](debian.md) | 7, 8, 9, 10, 11, 12 | apt/dpkg |

docs/docs/coverage/os/suse.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Trivy supports the following distributions:
33

44
- openSUSE Leap
5+
- openSUSE Tumbleweed
56
- SUSE Enterprise Linux (SLE)
67

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

3637

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

40-
[vulnerability statuses]: ../../configuration/filtering.md#by-status
41+
[vulnerability statuses]: ../../configuration/filtering.md#by-status

pkg/detector/ospkg/detect.go

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ var (
4040
ftypes.CentOS: redhat.NewScanner(),
4141
ftypes.Rocky: rocky.NewScanner(),
4242
ftypes.Oracle: oracle.NewScanner(),
43+
ftypes.OpenSUSETumbleweed: suse.NewScanner(suse.OpenSUSETumbleweed),
4344
ftypes.OpenSUSELeap: suse.NewScanner(suse.OpenSUSE),
4445
ftypes.SLES: suse.NewScanner(suse.SUSEEnterpriseLinux),
4546
ftypes.Photon: photon.NewScanner(),

pkg/detector/ospkg/suse/suse.go

+9
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ const (
6666
SUSEEnterpriseLinux Type = iota
6767
// OpenSUSE for open versions
6868
OpenSUSE
69+
OpenSUSETumbleweed
6970
)
7071

7172
// Scanner implements the SUSE scanner
@@ -84,6 +85,10 @@ func NewScanner(t Type) *Scanner {
8485
return &Scanner{
8586
vs: susecvrf.NewVulnSrc(susecvrf.OpenSUSE),
8687
}
88+
case OpenSUSETumbleweed:
89+
return &Scanner{
90+
vs: susecvrf.NewVulnSrc(susecvrf.OpenSUSETumbleweed),
91+
}
8792
}
8893
return nil
8994
}
@@ -128,5 +133,9 @@ func (s *Scanner) IsSupportedVersion(ctx context.Context, osFamily ftypes.OSType
128133
if osFamily == ftypes.SLES {
129134
return osver.Supported(ctx, slesEolDates, osFamily, osVer)
130135
}
136+
// tumbleweed is a rolling release, it has no version and no eol
137+
if osFamily == ftypes.OpenSUSETumbleweed {
138+
return true
139+
}
131140
return osver.Supported(ctx, opensuseEolDates, osFamily, osVer)
132141
}

0 commit comments

Comments
 (0)