Skip to content

feat(rocky): Add Rootio Rocky Support#557

Open
urimils wants to merge 11 commits intoaquasecurity:mainfrom
urimils:rootio-rocky-support
Open

feat(rocky): Add Rootio Rocky Support#557
urimils wants to merge 11 commits intoaquasecurity:mainfrom
urimils:rootio-rocky-support

Conversation

@urimils
Copy link
Contributor

@urimils urimils commented Jul 20, 2025

Add support for Rocky in Root.io flow.
Since Rocky uses Arch as well as os and pkg versions, added an adapter so both options can be used where "Get" is required

@CLAassistant
Copy link

CLAassistant commented Jul 20, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ chait-slim
❌ Uri


Uri seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@urimils urimils changed the title Rootio rocky support Rootio Rocky Support Jul 20, 2025
@urimils urimils marked this pull request as ready for review July 20, 2025 09:57
@urimils urimils requested a review from knqyf263 as a code owner July 20, 2025 09:57
@urimils urimils changed the title Rootio Rocky Support feat(rocky): Add Rootio Rocky Support Jul 20, 2025
Copy link
Contributor

@DmitriyLewen DmitriyLewen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello @urimils
I left a comments.

Also i don't see Rocky advisories in feed.

pkg/db/db.go Outdated
Get(string, string) ([]types.Advisory, error)
}

type TrioGetter interface {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we can create one common interface for all (except RedHat) sources.
i created #558

After these changes we will easy use any source for root.io

@knqyf263 wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats exactly the rational behind this part of the PR - the differences between the two argument and three argument getters (otherwise it would of been a very simple addition). Do you want me to rebase above the #558 branch?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to rebase above the #558 branch?

No need this. You will rebase main branch after merge #558

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, so I will wait for the merge there before updating this PR (I just wanted to be proactive)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now you can edit other comments :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done (:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chait-slim we merged #558

args: args{
osVer: "11",
pkgName: "openssl",
arch: "amd64",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change can confusing (debian advisories don't use arches).
So let's add arch only for rocky related advisories.

@chait-slim
Copy link
Contributor

chait-slim commented Jul 21, 2025

@DmitriyLewen

Also i don't see Rocky advisories in feed.

Rocky feeds will be added on our side very shortly (matter of a week or two) with exactly the same format as Debian and Ubuntu. We our opening this PR now to allow Trivy to catch these on the July release

@DmitriyLewen
Copy link
Contributor

We our opening this PR now to allow Trivy to catch these on the July release

thank you for trying to prepare PRs in advance!

Rocky feeds will be added on our side very shortly (matter of a week or two) with exactly the same format as Debian and Ubuntu

  1. You need to add rocky advisories into testfile.
  2. We always build trivy-db with new data before merge PR. It would also be strange if we merge PR for Trivy (which states that Trivy supports Rocky for root.io), but trivy-db still doesn't have these advisories. So we will only merge PRs after adding a recommendation for Rocky.

@chait-slim
Copy link
Contributor

We our opening this PR now to allow Trivy to catch these on the July release

thank you for trying to prepare PRs in advance!

Rocky feeds will be added on our side very shortly (matter of a week or two) with exactly the same format as Debian and Ubuntu

  1. You need to add rocky advisories into testfile.
  2. We always build trivy-db with new data before merge PR. It would also be strange if we merge PR for Trivy (which states that Trivy supports Rocky for root.io), but trivy-db still doesn't have these advisories. So we will only merge PRs after adding a recommendation for Rocky.

Will update the file. Thanks!

@chait-slim chait-slim force-pushed the rootio-rocky-support branch 2 times, most recently from f40ec08 to 892f5bc Compare July 21, 2025 12:15
{
"pkg": {
"name": "nginx",
"cves": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will there be architectures in the root.io feed?
I think we can't use Rocky's arches because:

  1. There is a case where Rocky's advisory doesn't contain a CVE, but root.io has a fix for that CVE.
  2. There seems to be a case where root.io and Rocky advisories contain different architectures.

Copy link
Contributor

@chait-slim chait-slim Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From our point of view archs don't really matter:

  1. A vulnerability is relevant for both archs and we create fixes for both
  2. A vulnerability is only relevant for one arch and we create a fix for it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's see the following example:
There are CVE-2000-0001 for pkgA (affected versions are > 0.0.1 < 0.0.5) for amd64 only.
You create fix for this CVE and add it into feed (vulnerable_ranges is > 0.0.1 < 0.0.5-root.io.1)

User scans pkgA@0.0.2 for aarch64.
We find that feed contains CVE-2000-0001 for this package and show this package as vulnerable.
This is false positive.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see two options here:

  1. I add arch per cve for rocky
  2. There can be logic that checks - if no advisory from redhat, dont add the root vulnerability

Copy link
Contributor

@DmitriyLewen DmitriyLewen Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add arch per cve for rocky

You mean in root.io feed, right?
I think this is best solution.

in this case advisories will be "transparent" for users.
User will clearly see vulnerable version, patched version and architecture.
User will not need to refer to other advisory source, etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, after discussing internally, I will update the feed for all cves with the archs (to make the feed consistent). From Trivy's pov there shouldn't be any change - the arch will be ignored for Debian, Ubuntu, Alpine and used for Rocky,

Copy link
Contributor

@DmitriyLewen DmitriyLewen Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we only need arches for Rocky.
The rest of distrs are at your discretion.

BTW changes will be required in vuln-list-update
we did not specify the arch in schema:
https://github.com/aquasecurity/vuln-list-update/blob/be8391dd6bbdc696d65fd50adeb629aabde0a206/rootio/types.go#L23-L27

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, will update

@chait-slim chait-slim force-pushed the rootio-rocky-support branch from 892f5bc to a897efc Compare July 23, 2025 12:53
@chait-slim
Copy link
Contributor

@DmitriyLewen Rebased

"path/filepath"
"testing"

"github.com/aquasecurity/trivy-db/pkg/db"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use this import:

GetParams: db.GetParams{

"path/filepath"
"testing"

"github.com/aquasecurity/trivy-db/pkg/db"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

"path/filepath"
"testing"

"github.com/aquasecurity/trivy-db/pkg/db"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

"path/filepath"
"testing"

"github.com/aquasecurity/trivy-db/pkg/db"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

package photon

import (
"github.com/aquasecurity/trivy-db/pkg/db"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will be linter error

Comment on lines +116 to +127
- bucket: rocky 9
pairs:
- bucket: openssl
pairs:
- key: CVE-2023-0464
value:
FixedVersion: ""
Status: 2
- key: CVE-2024-13176
value:
FixedVersion: ""
Status: 2 No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC rocky always contains arch.
Tell me if you know CVEs without arch

Comment on lines +100 to +115
- bucket: root.io rocky 8
pairs:
- bucket: openssl
pairs:
- key: CVE-2023-0464
value:
VulnerableVersions:
- "<1.1.1k-7.el8_6.root.io.1"
PatchedVersions:
- "1.1.1k-7.el8_6.root.io.1"
- key: CVE-2024-13176
value:
VulnerableVersions:
- "<3.0.7-1.el8.root.io.2"
PatchedVersions:
- "3.0.7-1.el8.root.io.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed before - root.io advisories will contain arches.
Add arches here.


"github.com/stretchr/testify/assert"

"github.com/aquasecurity/trivy-db/pkg/db"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as for amazon_test.go

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add testcase for Update function

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add filter be arch in Get function.
example from Rocky:

if !slices.Contains(entry.Arches, params.Arch) {
continue
}

Uri and others added 4 commits July 24, 2025 13:07
…o-rocky-support

Resolved merge conflicts by accepting upstream changes that use db.GetParams interface
instead of individual parameters in Get methods.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@DmitriyLewen
Copy link
Contributor

Hello @chait-slim,
Is there any news about Rocky?
It looks like the feed still doesn’t contain Rocky advisories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants