feat(seal): add seal support#9370
Merged
DmitriyLewen merged 30 commits intoaquasecurity:mainfrom Sep 29, 2025
Merged
Conversation
DmitriyLewen
commented
Aug 22, 2025
- add baseID field
- add coverage page - add seal datasource
knqyf263
approved these changes
Sep 16, 2025
Collaborator
knqyf263
left a comment
There was a problem hiding this comment.
LGTM. I left small comments.
| comparer = version.NewDEBComparer() | ||
| vsg = seal.NewVulnSrcGetter(ecosystem.Debian) | ||
| default: | ||
| // Should never happen as it's validated in the provider |
Collaborator
There was a problem hiding this comment.
I didn't find the validation in the provider. Am I missing something?
pkg/detector/ospkg/seal/seal.go
Outdated
Comment on lines
+50
to
+65
| case ftypes.CentOS: | ||
| scanner = redhat.NewScanner() | ||
| comparer = version.NewRPMComparer() | ||
| vsg = seal.NewVulnSrcGetter(ecosystem.RedHat) | ||
| case ftypes.Debian: | ||
| scanner = debian.NewScanner() | ||
| comparer = version.NewDEBComparer() | ||
| vsg = seal.NewVulnSrcGetter(ecosystem.Debian) | ||
| case ftypes.Oracle: | ||
| scanner = oracle.NewScanner() | ||
| comparer = version.NewRPMComparer() | ||
| vsg = seal.NewVulnSrcGetter(ecosystem.RedHat) | ||
| case ftypes.RedHat: | ||
| scanner = redhat.NewScanner() | ||
| comparer = version.NewRPMComparer() | ||
| vsg = seal.NewVulnSrcGetter(ecosystem.RedHat) |
Collaborator
There was a problem hiding this comment.
Do we need the case for CentOS?
Suggested change
| case ftypes.CentOS: | |
| scanner = redhat.NewScanner() | |
| comparer = version.NewRPMComparer() | |
| vsg = seal.NewVulnSrcGetter(ecosystem.RedHat) | |
| case ftypes.Debian: | |
| scanner = debian.NewScanner() | |
| comparer = version.NewDEBComparer() | |
| vsg = seal.NewVulnSrcGetter(ecosystem.Debian) | |
| case ftypes.Oracle: | |
| scanner = oracle.NewScanner() | |
| comparer = version.NewRPMComparer() | |
| vsg = seal.NewVulnSrcGetter(ecosystem.RedHat) | |
| case ftypes.RedHat: | |
| scanner = redhat.NewScanner() | |
| comparer = version.NewRPMComparer() | |
| vsg = seal.NewVulnSrcGetter(ecosystem.RedHat) | |
| case ftypes.Debian: | |
| scanner = debian.NewScanner() | |
| comparer = version.NewDEBComparer() | |
| vsg = seal.NewVulnSrcGetter(ecosystem.Debian) | |
| case ftypes.Oracle: | |
| scanner = oracle.NewScanner() | |
| comparer = version.NewRPMComparer() | |
| vsg = seal.NewVulnSrcGetter(ecosystem.RedHat) | |
| case ftypes.CentOS, ftypes.RedHat: | |
| scanner = redhat.NewScanner() | |
| comparer = version.NewRPMComparer() | |
| vsg = seal.NewVulnSrcGetter(ecosystem.RedHat) |
pkg/detector/ospkg/seal/seal.go
Outdated
| continue | ||
| } | ||
|
|
||
| srcName := pkg.SrcName |
Collaborator
There was a problem hiding this comment.
nit
Suggested change
| srcName := pkg.SrcName | |
| srcName := cmp.Or(pkg.SrcName, pkg.Name) | |
| srcRelease := cmp.Or(pkg.SrcRelease, pkg.Release) |
However, in my implementation, SrcName and SrcRelease are evaluated separately, so if you want to evaluate whether SrcName is empty in both cases, I think the current code is fine.
Suggested change
| srcName := pkg.SrcName | |
| srcName := cmp.Or(pkg.SrcName, pkg.Name) | |
| srcRelease := lo.Ternary(pkg.SrcName != "", pkg.SrcRelease, pkg.Release) |
Contributor
Author
There was a problem hiding this comment.
Most likely, if srcName exists, then srcRelease will also exist.
But I still added the check (your second option).
Updated in 1c9ce37
pkg/detector/ospkg/seal/seal_test.go
Outdated
| for _, tt := range tests { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| _ = dbtest.InitDB(t, tt.fixtures) | ||
| defer db.Close() |
Collaborator
There was a problem hiding this comment.
nit: We can remove the import of the db package.
Suggested change
| defer db.Close() | |
| defer dbtest.Close() |
- merge RedHat and CentOS cases - simplify logic to get pkg Name and Release - use `dbtest` package
knqyf263
approved these changes
Sep 29, 2025
alexlebens
pushed a commit
to alexlebens/infrastructure
that referenced
this pull request
Sep 30, 2025
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [mirror.gcr.io/aquasec/trivy](https://www.aquasec.com/products/trivy/) ([source](https://github.com/aquasecurity/trivy)) | minor | `0.66.0` -> `0.67.0` | --- ### Release Notes <details> <summary>aquasecurity/trivy (mirror.gcr.io/aquasec/trivy)</summary> ### [`v0.67.0`](https://github.com/aquasecurity/trivy/blob/HEAD/CHANGELOG.md#0670-2025-09-30) [Compare Source](aquasecurity/trivy@v0.66.0...v0.67.0) ##### Features - add documentation URL for database lock errors ([#​9531](aquasecurity/trivy#9531)) ([eba48af](aquasecurity/trivy@eba48af)) - **cli:** change --list-all-pkgs default to true ([#​9510](aquasecurity/trivy#9510)) ([7b663d8](aquasecurity/trivy@7b663d8)) - **cloudformation:** support default values and list results in Fn::FindInMap ([#​9515](aquasecurity/trivy#9515)) ([42b3bf3](aquasecurity/trivy@42b3bf3)) - **cyclonedx:** preserve SBOM structure when scanning SBOM files with vulnerability updates ([#​9439](aquasecurity/trivy#9439)) ([aff03eb](aquasecurity/trivy@aff03eb)) - **redhat:** add os-release detection for RHEL-based images ([#​9458](aquasecurity/trivy#9458)) ([cb25a07](aquasecurity/trivy@cb25a07)) - **sbom:** added support for CoreOS ([#​9448](aquasecurity/trivy#9448)) ([6d562a3](aquasecurity/trivy@6d562a3)) - **seal:** add seal support ([#​9370](aquasecurity/trivy#9370)) ([e4af279](aquasecurity/trivy@e4af279)) ##### Bug Fixes - **aws:** use `BuildableClient` insead of `xhttp.Client` ([#​9436](aquasecurity/trivy#9436)) ([fa6f1bf](aquasecurity/trivy@fa6f1bf)) - close file descriptors and pipes on error paths ([#​9536](aquasecurity/trivy#9536)) ([a4cbd6a](aquasecurity/trivy@a4cbd6a)) - **db:** Dowload database when missing but metadata still exists ([#​9393](aquasecurity/trivy#9393)) ([92ebc7e](aquasecurity/trivy@92ebc7e)) - **k8s:** disable parallel traversal with fs cache for k8s images ([#​9534](aquasecurity/trivy#9534)) ([c0c7a6b](aquasecurity/trivy@c0c7a6b)) - **misconf:** handle tofu files in module detection ([#​9486](aquasecurity/trivy#9486)) ([bfd2f6b](aquasecurity/trivy@bfd2f6b)) - **misconf:** strip build metadata suffixes from image history ([#​9498](aquasecurity/trivy#9498)) ([c938806](aquasecurity/trivy@c938806)) - **misconf:** unmark cty values before access ([#​9495](aquasecurity/trivy#9495)) ([8e40d27](aquasecurity/trivy@8e40d27)) - **misconf:** wrap legacy ENV values in quotes to preserve spaces ([#​9497](aquasecurity/trivy#9497)) ([267a970](aquasecurity/trivy@267a970)) - **nodejs:** parse workspaces as objects for package-lock.json files ([#​9518](aquasecurity/trivy#9518)) ([404abb3](aquasecurity/trivy@404abb3)) - **nodejs:** use snapshot string as `Package.ID` for pnpm packages ([#​9330](aquasecurity/trivy#9330)) ([4517e8c](aquasecurity/trivy@4517e8c)) - **vex:** don't suppress vulns for packages with infinity loop ([#​9465](aquasecurity/trivy#9465)) ([78f0d4a](aquasecurity/trivy@78f0d4a)) - **vuln:** compare `nuget` package names in lower case ([#​9456](aquasecurity/trivy#9456)) ([1ff9ac7](aquasecurity/trivy@1ff9ac7)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xMTYuNiIsInVwZGF0ZWRJblZlciI6IjQxLjExNi42IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbWFnZSJdfQ==--> Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/1622 Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net> Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for detecting vulnerabilities in Seal Security packages within Trivy. Seal Security provides patched versions of open source packages with security fixes that may not be available in upstream distributions. This
implementation enables Trivy to detect vulnerabilities specific to these Seal-patched packages by integrating with the Seal Security vulnerability database.
Features of implementation
Examples
Alpinebased image:Debianbased image:CentOSbased image:Related issues
Related PRs
Remove this section if you don't have related PRs.
Checklist