Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(vulnerabilities): add option to add summary to dashboard #21766

Merged

Conversation

secustor
Copy link
Collaborator

Changes

This PR adds a configuration option dependencyDashboardVulnerabilitySummary to allow to add a summary to the dependency dashboard.

Avaiable options are:

  • none no section is added
  • unresolved only vulnerabilities without fixes are displayed
  • all all vulnerabilities affecting the repository are listed

Context

Fixes #20242

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

secustor/renovate-security-dashboard#8

Copy link
Collaborator

@rarkins rarkins left a comment

Choose a reason for hiding this comment

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

We already hit character limits sometimes, how much will this add?

docs/usage/configuration-options.md Outdated Show resolved Hide resolved
@secustor
Copy link
Collaborator Author

secustor commented Apr 23, 2023

With the default configuration ( none ) there are no additional chars added.

If we are talking about extreme edge cases e.g. big monorepos with a lot of CVEs, then the section can become big.

As this is also marked as experimental, I think this fine as first iteration.

docs/usage/configuration-options.md Outdated Show resolved Hide resolved
lib/config/options/index.ts Outdated Show resolved Hide resolved
lib/config/options/index.ts Outdated Show resolved Hide resolved
secustor and others added 2 commits April 28, 2023 08:55
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
@secustor secustor marked this pull request as ready for review April 29, 2023 07:06
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
docs/usage/configuration-options.md Outdated Show resolved Hide resolved
lib/config/options/index.ts Outdated Show resolved Hide resolved
lib/workers/repository/dependency-dashboard.ts Outdated Show resolved Hide resolved
lib/workers/repository/dependency-dashboard.ts Outdated Show resolved Hide resolved
secustor and others added 2 commits April 29, 2023 14:10
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
HonkingGoose
HonkingGoose previously approved these changes May 1, 2023
@secustor
Copy link
Collaborator Author

secustor commented May 6, 2023

@rarkins @viceice Any chance you will able to take a look at this PR next week?

viceice
viceice previously approved these changes May 6, 2023
@secustor secustor dismissed stale reviews from viceice and HonkingGoose via 1c02843 May 7, 2023 20:03
@secustor secustor requested a review from rarkins May 7, 2023 20:04
@renovatebot renovatebot deleted a comment from HonkingGoose May 8, 2023
@HonkingGoose
Copy link
Collaborator

How about something like:

There are 7 CVEs.
All of your CVEs have Renovate fixes.

And if there's a mix of CVEs, so with and without fixes:

You are 7 CVEs.
Of those 1 needs to be fixed by you, because ....

@secustor
Copy link
Collaborator Author

secustor commented May 8, 2023

How about:

  • osvVulnerabilityAlerts === true
  • unresolvedVulnterabilities.length === 0

There are 7 CVEs.
All of your CVEs have Renovate fixes.

  • osvVulnerabilityAlerts === true
  • unresolvedVulnterabilities.length !== 0

There are 7 CVEs.
2 of your CVEs have no Renovate fixes.

  • osvVulnerabilityAlerts === false
  • unresolvedVulnterabilities.length === 0

There are 7 CVEs.
No Renovate fixes have been opened. See osvVulnerabilityAlerts to allow Renovate to supply fixes.

  • osvVulnerabilityAlerts === false
  • unresolvedVulnterabilities.length !== 0

There are 7 CVEs.
None of 5 Renovate fixes have been opened. See osvVulnerabilityAlerts to allow Renovate to supply fixes.

@rarkins
Copy link
Collaborator

rarkins commented May 9, 2023

Can we state how many have fixes rather than how many don't have fixes?

@secustor
Copy link
Collaborator Author

secustor commented May 9, 2023

Sure, that is possible. If we do that, the users have to compare the values in their head to find out if action from their side is necessary tough.

With my proposal they would only need to glance at the section to see two highlighted numbers and they would know manual actions are necessary.

@rarkins
Copy link
Collaborator

rarkins commented May 9, 2023

Can it be like "7 of 7" then, so that you can still tell from a glance if action is required?

@secustor
Copy link
Collaborator Author

secustor commented May 9, 2023

Not sure, what the difference then to my initial proposal is tbh.

Maybe we can fix that up then?
Do you have a suggestion?

@secustor
Copy link
Collaborator Author

To keep this moving ,here an adaption based on your feedback @rarkins .

  • osvVulnerabilityAlerts === true
  • unresolvedVulnterabilities.length === 0

There are 7 CVEs.
All of your CVEs have Renovate fixes.

  • osvVulnerabilityAlerts === true
  • unresolvedVulnterabilities.length !== 0

There are 2/7 CVEs without Renovate fixes.

  • osvVulnerabilityAlerts === false
  • unresolvedVulnterabilities.length === 0

There are 7 CVEs.
No Renovate fixes have been opened. See osvVulnerabilityAlerts to allow Renovate to supply fixes.

  • osvVulnerabilityAlerts === false
  • unresolvedVulnterabilities.length !== 0

There are 5/7 CVEs with possible Renovate fixes.
See osvVulnerabilityAlerts to allow Renovate to supply fixes.

@rarkins
Copy link
Collaborator

rarkins commented May 12, 2023

Is there really a need to support osvVulnerabilityAlerts=false in combination with this feature? What's the use case for that?

@secustor
Copy link
Collaborator Author

One use case would be that only a summary and no PRs are expected.

TBH 90% cases users will activate this with osvVulnerabilityAlerts enabled.

@rarkins
Copy link
Collaborator

rarkins commented May 12, 2023

I think users can still turn off PRs other ways (and if not we could make that happen). I'd like to simplify this so that it always prints a summary in the dashboard if that feature is enabled.

@secustor
Copy link
Collaborator Author

secustor commented May 12, 2023

Following up on your valid concerns in #20242 (comment), I think we shouldn't tightly couple these two config.

Rather I can image that we provide presets for the different use cases.

Or do you mean that dependencyDashboardVulnerabilitySummary !== 'none' forces creation of vulnerability PRs?
That would be IMO unintuitive.

@setchy
Copy link
Collaborator

setchy commented May 12, 2023

I kinda like the simplicity of something along these lines:

  • x / y CVEs have possible Renovate fixes.
    See osvVulnerabilityAlerts to allow Renovate to supply fixes.
  • x / y CVEs have Renovate fixes.

@secustor
Copy link
Collaborator Author

@rarkins Does the concerns regarding publishing the CVEs for public projects have changed your mind?

I'm in favor of keeping this a separated option to osvVulnerabilityAlerts and use the formulation of @setchy.
WDYT?

I would like to get this out and gather feedback.

@rarkins
Copy link
Collaborator

rarkins commented May 16, 2023

Good point, let's keep it opt in with a second option

@secustor
Copy link
Collaborator Author

@rarkins I have implemented the suggestion of setchy.
From my perspective this contains everything we have discussed:

  • positive formulation ( mentioning the fixes rather than what we can not do )
  • easy readablility
  • and referencing osvVulnerabilityAlerts if the feature is turned off.
image

@secustor secustor enabled auto-merge May 16, 2023 22:02
@secustor secustor added this pull request to the merge queue May 17, 2023
Merged via the queue into renovatebot:main with commit 3fccfbe May 17, 2023
11 checks passed
@secustor secustor deleted the feat/add_unfixed_CVEs_to_dashboards branch May 17, 2023 08:42
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 35.90.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show OSV vulnerabilities without fixes on Dependency Dashboard
6 participants