Skip to content

Commit e4af279

Browse files
authored
feat(seal): add seal support (#9370)
1 parent e149094 commit e4af279

File tree

17 files changed

+711
-25
lines changed

17 files changed

+711
-25
lines changed

.github/workflows/semantic-pr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jobs:
6868
windows
6969
minimos
7070
rootio
71+
seal
7172
7273
# Languages
7374
ruby

docs/docs/coverage/others/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Trivy supports them for
1616
| [Conda](conda.md) | `<conda-root>/envs/<env>/conda-meta/<package>.json` ||| - | - |
1717
| | `environment.yml` | - | - |||
1818
| [Root.io images](rootio.md) | - ||| - | - |
19+
| [Seal Security](seal.md) | - ||| - | - |
1920
| [RPM Archives](rpm.md) | `*.rpm` |[^5] |[^5] |[^5] |[^5] |
2021

2122
[sbom]: ../../supply-chain/sbom.md

docs/docs/coverage/others/seal.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Seal Security
2+
3+
!!! warning "EXPERIMENTAL"
4+
Scanning results may be inaccurate.
5+
6+
While it is not an OS, this page describes the details of the [Seal Security]( https://sealsecurity.io/) vulnerability feed.
7+
Seal provides security advisories and patched versions for multiple Linux distributions, including [Debian](../os/debian.md), [Ubuntu](../os/ubuntu.md), [Alpine](../os/alpine.md), [Red Hat Enterprise Linux](../os/rhel.md), [CentOS](../os/centos.md), [Oracle Linux](../os/oracle.md), and [Azure Linux (CBL‑Mariner)](../os/azure.md).
8+
9+
Seal advisories are used when Trivy finds packages that indicate Seal-provided components:
10+
11+
- Packages whose name or source name starts with `seal-` (for example, `seal-wget`, `seal-zlib`).
12+
13+
When such Seal packages are detected, Trivy automatically enables Seal scanning for those packages while continuing to use the base OS scanner for the rest.
14+
15+
!!! note
16+
For vulnerabilities, Trivy prefers severity from the base OS vendor when available.
17+
18+
For details on supported scanners, features, and behavior for each base OS, refer to their respective pages:
19+
20+
- [Debian](../os/debian.md)
21+
- [Ubuntu](../os/ubuntu.md)
22+
- [Alpine](../os/alpine.md)
23+
- [Red Hat Enterprise Linux](../os/rhel.md)
24+
- [CentOS](../os/centos.md)
25+
- [Oracle Linux](../os/oracle.md)
26+
- [Azure Linux (CBL‑Mariner)](../os/azure.md)
27+

docs/docs/scanner/vulnerability.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ See [here](../coverage/os/index.md#supported-os) for the supported OSes.
3838
| OpenSUSE/SLES | [CVRF][suse] |
3939
| Photon OS | [Photon Security Advisory][photon] |
4040
| Root.io | [Root.io Patch Feed][rootio] |
41+
| Seal Security | [Seal Security vulnerability feed][seal] |
4142

4243
#### Data Source Selection
4344
Trivy **only** consumes security advisories from the sources listed in the above table.
@@ -404,6 +405,7 @@ Example logic for the following vendor severity levels when scanning an Alpine i
404405
[photon]: https://packages.vmware.com/photon/photon_cve_metadata/
405406
[azure]: https://github.com/microsoft/AzureLinuxVulnerabilityData/
406407
[rootio]: https://api.root.io/external/patch_feed
408+
[seal]: http://vulnfeed.sealsecurity.io/v1/osv/renamed/vulnerabilities.zip
407409
408410
[php-ghsa]: https://github.com/advisories?query=ecosystem%3Acomposer
409411
[python-ghsa]: https://github.com/advisories?query=ecosystem%3Apip
@@ -433,4 +435,4 @@ Example logic for the following vendor severity levels when scanning an Alpine i
433435
[RHSA-2023:4520]: https://access.redhat.com/errata/RHSA-2023:4520
434436
[ghsa]: https://github.com/advisories
435437
[requests]: https://pypi.org/project/requests/
436-
[precision-recall]: https://developers.google.com/machine-learning/crash-course/classification/precision-and-recall
438+
[precision-recall]: https://developers.google.com/machine-learning/crash-course/classification/precision-and-recall

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/aquasecurity/testdocker v0.0.0-20250616060700-ba6845ac6d17
2525
github.com/aquasecurity/tml v0.6.1
2626
github.com/aquasecurity/trivy-checks v1.11.3-0.20250604022615-9a7efa7c9169
27-
github.com/aquasecurity/trivy-db v0.0.0-20250912085155-990a6528209a
27+
github.com/aquasecurity/trivy-db v0.0.0-20250929072116-eba1ced2340a
2828
github.com/aquasecurity/trivy-java-db v0.0.0-20240109071736-184bd7481d48
2929
github.com/aquasecurity/trivy-kubernetes v0.9.1
3030
github.com/aws/aws-sdk-go-v2 v1.39.0
@@ -369,6 +369,7 @@ require (
369369
github.com/opencontainers/selinux v1.12.0 // indirect
370370
github.com/opentracing/opentracing-go v1.2.0 // indirect
371371
github.com/owenrumney/squealer v1.2.11 // indirect
372+
github.com/pandatix/go-cvss v0.6.2 // indirect
372373
github.com/pelletier/go-toml v1.9.5 // indirect
373374
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
374375
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ github.com/aquasecurity/tml v0.6.1 h1:y2ZlGSfrhnn7t4ZJ/0rotuH+v5Jgv6BDDO5jB6A9gw
219219
github.com/aquasecurity/tml v0.6.1/go.mod h1:OnYMWY5lvI9ejU7yH9LCberWaaTBW7hBFsITiIMY2yY=
220220
github.com/aquasecurity/trivy-checks v1.11.3-0.20250604022615-9a7efa7c9169 h1:TckzIxUX7lZaU9f2lNxCN0noYYP8fzmSQf6a4JdV83w=
221221
github.com/aquasecurity/trivy-checks v1.11.3-0.20250604022615-9a7efa7c9169/go.mod h1:nT69xgRcBD4NlHwTBpWMYirpK5/Zpl8M+XDOgmjMn2k=
222-
github.com/aquasecurity/trivy-db v0.0.0-20250912085155-990a6528209a h1:mcPk1ovUuUFnJwbRMRKtSIe3j0BQfJ33RQdB/kB5QZY=
223-
github.com/aquasecurity/trivy-db v0.0.0-20250912085155-990a6528209a/go.mod h1:upAJqDQkN5FdIJbtJMpokncGNhYAPGkpoCbaGciWPt4=
222+
github.com/aquasecurity/trivy-db v0.0.0-20250929072116-eba1ced2340a h1:Wmvjq3zQGsZ8Wlqh75zvujh7LZNTXU4YoEf8tyL1LoM=
223+
github.com/aquasecurity/trivy-db v0.0.0-20250929072116-eba1ced2340a/go.mod h1:upAJqDQkN5FdIJbtJMpokncGNhYAPGkpoCbaGciWPt4=
224224
github.com/aquasecurity/trivy-java-db v0.0.0-20240109071736-184bd7481d48 h1:JVgBIuIYbwG+ekC5lUHUpGJboPYiCcxiz06RCtz8neI=
225225
github.com/aquasecurity/trivy-java-db v0.0.0-20240109071736-184bd7481d48/go.mod h1:Ldya37FLi0e/5Cjq2T5Bty7cFkzUDwTcPeQua+2M8i8=
226226
github.com/aquasecurity/trivy-kubernetes v0.9.1 h1:bSErQcavKXDh7XMwbGX7Vy//jR5+xhe/bOgfn9G+9lQ=
@@ -1027,6 +1027,8 @@ github.com/owenrumney/squealer v1.2.11 h1:vMudrj70VeOzY+t7Phz9Yo0wAgm4kXes9DcTLB
10271027
github.com/owenrumney/squealer v1.2.11/go.mod h1:8KOuitfOfmS/OtzgxQbxnnrbngAGopfgKB/BiGGpqGA=
10281028
github.com/package-url/packageurl-go v0.1.3 h1:4juMED3hHiz0set3Vq3KeQ75KD1avthoXLtmE3I0PLs=
10291029
github.com/package-url/packageurl-go v0.1.3/go.mod h1:nKAWB8E6uk1MHqiS/lQb9pYBGH2+mdJ2PJc2s50dQY0=
1030+
github.com/pandatix/go-cvss v0.6.2 h1:TFiHlzUkT67s6UkelHmK6s1INKVUG7nlKYiWWDTITGI=
1031+
github.com/pandatix/go-cvss v0.6.2/go.mod h1:jDXYlQBZrc8nvrMUVVvTG8PhmuShOnKrxP53nOFkt8Q=
10301032
github.com/pborman/getopt v0.0.0-20170112200414-7148bc3a4c30/go.mod h1:85jBQOZwpVEaDAr341tbn15RS4fCAsIst0qp7i8ex1o=
10311033
github.com/pborman/uuid v1.2.1 h1:+ZZIw58t/ozdjRaXh/3awHfmWRbzYxJoAdNJxe/3pvw=
10321034
github.com/pborman/uuid v1.2.1/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ nav:
119119
- Bitnami Images: docs/coverage/others/bitnami.md
120120
- Conda: docs/coverage/others/conda.md
121121
- Root.io Images: docs/coverage/others/rootio.md
122+
- Seal Security: docs/coverage/others/seal.md
122123
- RPM Archives: docs/coverage/others/rpm.md
123124
- Kubernetes: docs/coverage/kubernetes.md
124125
- Configuration:
@@ -291,4 +292,3 @@ extra:
291292
plugins:
292293
- search
293294
- macros
294-

pkg/detector/library/driver.go

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"golang.org/x/xerrors"
99

1010
"github.com/aquasecurity/trivy-db/pkg/db"
11+
"github.com/aquasecurity/trivy-db/pkg/ecosystem"
1112
dbTypes "github.com/aquasecurity/trivy-db/pkg/types"
1213
"github.com/aquasecurity/trivy-db/pkg/vulnsrc/vulnerability"
1314
"github.com/aquasecurity/trivy/pkg/detector/library/compare"
@@ -23,63 +24,63 @@ import (
2324

2425
// NewDriver returns a driver according to the library type
2526
func NewDriver(libType ftypes.LangType) (Driver, bool) {
26-
var ecosystem dbTypes.Ecosystem
27+
var eco ecosystem.Type
2728
var comparer compare.Comparer
2829

2930
switch libType {
3031
case ftypes.Bundler, ftypes.GemSpec:
31-
ecosystem = vulnerability.RubyGems
32+
eco = ecosystem.RubyGems
3233
comparer = rubygems.Comparer{}
3334
case ftypes.RustBinary, ftypes.Cargo:
34-
ecosystem = vulnerability.Cargo
35+
eco = ecosystem.Cargo
3536
comparer = compare.GenericComparer{}
3637
case ftypes.Composer, ftypes.ComposerVendor:
37-
ecosystem = vulnerability.Composer
38+
eco = ecosystem.Composer
3839
comparer = compare.GenericComparer{}
3940
case ftypes.GoBinary, ftypes.GoModule:
40-
ecosystem = vulnerability.Go
41+
eco = ecosystem.Go
4142
comparer = compare.GenericComparer{}
4243
case ftypes.Jar, ftypes.Pom, ftypes.Gradle, ftypes.Sbt:
43-
ecosystem = vulnerability.Maven
44+
eco = ecosystem.Maven
4445
comparer = maven.Comparer{}
4546
case ftypes.Npm, ftypes.Yarn, ftypes.Pnpm, ftypes.Bun, ftypes.NodePkg, ftypes.JavaScript:
46-
ecosystem = vulnerability.Npm
47+
eco = ecosystem.Npm
4748
comparer = npm.Comparer{}
4849
case ftypes.NuGet, ftypes.DotNetCore, ftypes.PackagesProps:
49-
ecosystem = vulnerability.NuGet
50+
eco = ecosystem.NuGet
5051
comparer = compare.GenericComparer{}
5152
case ftypes.Pipenv, ftypes.Poetry, ftypes.Pip, ftypes.PythonPkg, ftypes.Uv:
52-
ecosystem = vulnerability.Pip
53+
eco = ecosystem.Pip
5354
comparer = pep440.Comparer{}
5455
case ftypes.Pub:
55-
ecosystem = vulnerability.Pub
56+
eco = ecosystem.Pub
5657
comparer = compare.GenericComparer{}
5758
case ftypes.Hex:
58-
ecosystem = vulnerability.Erlang
59+
eco = ecosystem.Erlang
5960
comparer = compare.GenericComparer{}
6061
case ftypes.Conan:
61-
ecosystem = vulnerability.Conan
62+
eco = ecosystem.Conan
6263
// Only semver can be used for version ranges
6364
// https://docs.conan.io/en/latest/versioning/version_ranges.html
6465
comparer = compare.GenericComparer{}
6566
case ftypes.Swift:
6667
// Swift uses semver
6768
// https://www.swift.org/package-manager/#importing-dependencies
68-
ecosystem = vulnerability.Swift
69+
eco = ecosystem.Swift
6970
comparer = compare.GenericComparer{}
7071
case ftypes.Cocoapods:
7172
// CocoaPods uses RubyGems version specifiers
7273
// https://guides.cocoapods.org/making/making-a-cocoapod.html#cocoapods-versioning-specifics
73-
ecosystem = vulnerability.Cocoapods
74+
eco = ecosystem.Cocoapods
7475
comparer = rubygems.Comparer{}
7576
case ftypes.CondaPkg, ftypes.CondaEnv:
7677
log.Warn("Conda package is supported for SBOM, not for vulnerability scanning")
7778
return Driver{}, false
7879
case ftypes.Bitnami:
79-
ecosystem = vulnerability.Bitnami
80+
eco = ecosystem.Bitnami
8081
comparer = bitnami.Comparer{}
8182
case ftypes.K8sUpstream:
82-
ecosystem = vulnerability.Kubernetes
83+
eco = ecosystem.Kubernetes
8384
comparer = compare.GenericComparer{}
8485
case ftypes.Julia:
8586
log.Warn("Julia is supported for SBOM, not for vulnerability scanning")
@@ -90,15 +91,15 @@ func NewDriver(libType ftypes.LangType) (Driver, bool) {
9091
return Driver{}, false
9192
}
9293
return Driver{
93-
ecosystem: ecosystem,
94+
ecosystem: eco,
9495
comparer: comparer,
9596
dbc: db.Config{},
9697
}, true
9798
}
9899

99100
// Driver represents security advisories for each programming language
100101
type Driver struct {
101-
ecosystem dbTypes.Ecosystem
102+
ecosystem ecosystem.Type
102103
comparer compare.Comparer
103104
dbc db.Config
104105
}

pkg/detector/ospkg/detect.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"github.com/aquasecurity/trivy/pkg/detector/ospkg/redhat"
2323
"github.com/aquasecurity/trivy/pkg/detector/ospkg/rocky"
2424
"github.com/aquasecurity/trivy/pkg/detector/ospkg/rootio"
25+
"github.com/aquasecurity/trivy/pkg/detector/ospkg/seal"
2526
"github.com/aquasecurity/trivy/pkg/detector/ospkg/suse"
2627
"github.com/aquasecurity/trivy/pkg/detector/ospkg/ubuntu"
2728
"github.com/aquasecurity/trivy/pkg/detector/ospkg/wolfi"
@@ -63,6 +64,7 @@ var (
6364
// and environment detection. They are tried before standard OS-specific drivers.
6465
providers = []driver.Provider{
6566
rootio.Provider,
67+
seal.Provider,
6668
}
6769
)
6870

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package seal
2+
3+
import (
4+
"slices"
5+
6+
"github.com/aquasecurity/trivy/pkg/detector/ospkg/driver"
7+
ftypes "github.com/aquasecurity/trivy/pkg/fanal/types"
8+
"github.com/aquasecurity/trivy/pkg/set"
9+
)
10+
11+
var (
12+
supportedOSFamilies = set.New(
13+
ftypes.Alpine,
14+
ftypes.CBLMariner,
15+
ftypes.CentOS,
16+
ftypes.RedHat,
17+
ftypes.Debian,
18+
ftypes.Oracle,
19+
ftypes.Ubuntu,
20+
)
21+
)
22+
23+
// Provider creates a Root.io driver if Root.io packages are detected
24+
func Provider(osFamily ftypes.OSType, pkgs []ftypes.Package) driver.Driver {
25+
if supportedOSFamilies.Contains(osFamily) && slices.ContainsFunc(pkgs, sealPkg) {
26+
return NewScanner(osFamily)
27+
}
28+
return nil
29+
}

0 commit comments

Comments
 (0)