+
Skip to content

Conversation

wagoodman
Copy link
Contributor

@wagoodman wagoodman commented Jul 7, 2025

This adds support for considering Extended Updated Support (EUS) fix information for RedHat distros when matching.

Closes #2446

Changes

  • introduces a new result.Result object for being able to organize returned vulnerability objects from a provider into pseudo prototype matches, allowing for merging of sets with control over how the merge is done. This enables more flexibility for matchers to combine results (as is needed with EUS)
  • splits the RPM matcher into two paths based on the distro channel information: standard matching and EUS matching.

TODO

wagoodman added 2 commits July 6, 2025 15:08
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
wagoodman added 2 commits July 8, 2025 08:50
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
wagoodman added 4 commits July 9, 2025 17:01
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Copy link
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

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

The biggest question to me to answer stems around API configuration: having a way to specify "default everything to auto/enabled/disabled". In this PR, I think it will take either hardcoding each channel in code (which might make sense anyway, we might have specific code blocks for specific channels) or executing a query to get the full set of channels, and I don't know if we should be querying the db before executing grype itself just to get configurations. But it could work, too.

// TODO: in the future we may want to support more channels, as well as have a default-apply value here that can be overridden within each channel configuration

// EUS is the Extended Update Support channel for RHEL
RedHatEUS FixChannel `yaml:"redhat-eus" json:"redhat-eus" mapstructure:"redhat-eus"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this would be easy to make a map by channel name, e.g.:

fix-channels:
  apply: none
  channels:
    eus:
      apply: auto
      version: > 9

Where this configuration is more-or-less what gets sent to the matchers, e.g.:

type FixChannels struct {
  Apply FixChannelEnabled
  Channels map[string]FixChannel
}

... in some future state where a matcher does something like:

for channel in select_applicable_channels() {
  if fixChannels.enabled(channel) {
    // select some things from the special channel records
  }
}

... or should the initial configuration not even have redhat, only a global apply option?

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Base automatically changed from add-distro-channel to main July 22, 2025 13:32
Copy link
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

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

🎉

ID string

// Vulnerabilities is a set of vulnerabilities that were discovered from the search.
Vulnerabilities []vulnerability.Vulnerability
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 we agreed that each Result should reference a single Vulnerability to avoid cases where there are different match details that get merged together, is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we did agree, but the main bug was to ensure that the merge function correctly reasoned about these details (which was fixed). I held off incorporating the data shape changes for a few of reasons:

  1. this has been tested to show it's working as we'd expect
  2. further changes to the Result struct should probably be guided by what we want to do with match details and if we want criteria to take their place in the result struct
  3. I though you suggested to hold off on incorporating changes to the Result object based on your prototyping (maybe I misunderstood?)

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
@wagoodman wagoodman marked this pull request as ready for review July 22, 2025 20:03
@wagoodman wagoodman enabled auto-merge (squash) July 22, 2025 20:03
@wagoodman wagoodman merged commit 8c29880 into main Jul 22, 2025
12 checks passed
@wagoodman wagoodman deleted the add-eus-support branch July 22, 2025 20:13
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.

Add support for RHEL EUS

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载