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

Update insecure packages immediately, even when schedule is set #1567

Closed
openjck opened this issue Feb 27, 2018 · 23 comments · Fixed by #2321
Closed

Update insecure packages immediately, even when schedule is set #1567

openjck opened this issue Feb 27, 2018 · 23 comments · Fixed by #2321
Assignees
Labels
priority-2-high Bugs impacting wide number of users or very important features type:feature Feature (new functionality)

Comments

@openjck
Copy link

openjck commented Feb 27, 2018

The schedule option can be used to force Renovate to wait until a given time before opening pull requests.

This can help cut down on noise, but developers who use this option risk missing critical security updates. For example, if Renovate is scheduled to update packages on Mondays, and a security update is published on a Tuesday, the project using Renovate might be insecure for 6 days.

I'd like to request that Renovate identify security updates and open pull requests for them immediately, even when a schedule is set.

@rarkins rarkins added type:feature Feature (new functionality) needs-requirements priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others labels Feb 28, 2018
@rarkins
Copy link
Collaborator

rarkins commented Feb 28, 2018

Hi @openjck, thanks for the suggestion. The key point is how to know when to do this, however this is definitely something I plan to do.

@rarkins
Copy link
Collaborator

rarkins commented Mar 29, 2018

Can we do this with a community-sourced set of packageRules to override schedules? It could be in the form of an opt-in preset.

Eg today there were node security releases for all supported streams. Basically anyone using node should upgrade.

But that doesn’t mean that node should be upgrade forever now (eg if there’s a job security patch tomorrow).

Maybe instead our rule should be a >= or < concept, ie override schedule of existing version is less than x.y.z. Little hard when something like node has multiple major versions at once, but most shouldn’t be like that.

Also we probably need to remove any groupName so that it doesn’t get mixed up with others that are non-urgent. Maybe also apply a label.

I suggest we design it as a preset but the option to include it is a native config option enabled/disabled.

@openjck
Copy link
Author

openjck commented Apr 7, 2018

I just discovered the nsp module, which flags insecure dependencies. I think they use https://nodesecurity.io/ under the hood.

@openjck
Copy link
Author

openjck commented May 15, 2018

I just discovered another neat addition to the ecosystem: synk. It looks like Renovate for security vulnerabilities. But I'm pretty loyal to Renovate and I'd love if it could do both at once. Plus it would be annoying to enable/configure yet another service for all of the repos I manage.

@rarkins
Copy link
Collaborator

rarkins commented May 17, 2018

nsp has been acquired and integrated with npm now. When you run npm install in latest versions it warns if there are any known insecure versions. We will capture/parse that output soon and use it in the PRs we raise. The main challenge is that many projects have deeply nested insecure dependencies that you often can't do much about, whereas most important to us are any direct dependencies with vulnerabilities because those can be upgraded.

@rarkins rarkins self-assigned this Jul 26, 2018
@rarkins rarkins added in progress priority-2-high Bugs impacting wide number of users or very important features and removed needs-requirements priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others labels Jul 26, 2018
rarkins added a commit that referenced this issue Jul 29, 2018
Adds rules to skip any configured grouping or schedules that prevent insecure packages from being updated immediately.

If GitHub's vulnerability alerts are detected, package rules are added to force empty schedule and grouping for each affected package. Settings are configurable via new `vulnerabilityAlerts` config object, e.g. so that custom PR titles, labels or assignees can be configured.

Closes #1567
@renovate-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 13.37.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@rarkins
Copy link
Collaborator

rarkins commented Jul 29, 2018

This feature will become active in the Renovate App once additional permissions for reading vulnerability alerts are granted.

@karlhorky
Copy link
Contributor

@rarkins so I guess #2321 added a feature to configure the security vulnerability PRs separately. What is not clear from this or the documentation is how a user would achieve resetting an existing schedule, as requested in this issue.

Trying to piece together the config documentation, maybe something like the following would work? The default schedule would be set to before 6am on friday, but for vulnerabilities, they would be opened at any time?

{
  "schedule": "before 6am on friday",
  "vulnerabilityAlerts": {
    "schedule": null
  }
}

@lkreimann
Copy link

Hi all, I have a question regarding the vulnerability alerts: Do they only work on GitHub or can I use them everywhere? I'm a bit confused by the text here: https://docs.renovatebot.com/configuration-options/#vulnerabilityalerts
It would be great to have vulnerability alerts on every platform, if that's possible at all.

@viceice
Copy link
Member

viceice commented Sep 4, 2020

Currently they only work for github, because it's implemented in platform.

@karlhorky
Copy link
Contributor

karlhorky commented Sep 4, 2020

@viceice @rarkins or based on this commit maybe it's something more like this?

{
  "schedule": "before 6am on friday",
  "vulnerabilityAlerts": {
    "schedule": "at any time"
  }
}

Got "at any time" from here: https://docs.renovatebot.com/configuration-options/#schedule

The default value for schedule is "at any time", which is functionally the same as declaring a null schedule. i.e. Renovate will run on the repository around the clock.

@rarkins
Copy link
Collaborator

rarkins commented Sep 4, 2020

I think either should work, and neither should be necessary. We have default schedule settings for alerts already.

@karlhorky
Copy link
Contributor

karlhorky commented Sep 4, 2020

neither should be necessary. We have default schedule settings for alerts already

Hm, really? Maybe this is a misunderstanding.

What I want to do is to override an existing schedule (eg. weekly) for vulnerabilities. I want vulnerability alerts to appear instantly.

For example, what do I need to add to this config to make vulnerability alerts appear immediately?

{
  "extends": [
    "config:base"
  ],
  "schedule": "before 6am on friday"
}

@viceice
Copy link
Member

viceice commented Sep 4, 2020

@karlhorky Use this:

{
  "extends": [
    "config:base"
  ],
  "schedule": "before 6am on friday",
 "vulnerabilityAlerts": {
    "schedule": null
  }
}

null is the default schedule, which is the same as at any time

@rarkins I don't find a default schedule for vulnerabilityAlerts

enableVulnerabilityAlerts: {
description: 'Raise PR when vulnerability alerts are detected',
vulnerabilityAlerts: {
enabled: true,
},
},
enableVulnerabilityAlertsWithLabel: {
description:
'Raise PR when vulnerability alerts are detected with label <code>{{arg0}}</code>',
vulnerabilityAlerts: {
enabled: true,
labels: ['{{arg0}}'],
},
},
disableVulnerabilityAlerts: {
description: 'Disable vulnerability alerts completely',
vulnerabilityAlerts: {
enabled: false,
},
},

@viceice
Copy link
Member

viceice commented Sep 4, 2020

Ok found this:

name: 'vulnerabilityAlerts',
description:
'Config to apply when a PR is necessary due to vulnerability of existing package version.',
type: 'object',
default: {
groupName: null,
schedule: [],
dependencyDashboardApproval: false,
rangeStrategy: 'update-lockfile',
commitMessageSuffix: '[SECURITY]',
},
cli: false,
env: false,

Which should reset schedule.

@rarkins
Copy link
Collaborator

rarkins commented Sep 4, 2020

Let's not discuss things in 2+ year old closed issues any further though, we have a config help repo for this type of thing

@karlhorky
Copy link
Contributor

karlhorky commented Sep 4, 2020

@rarkins oh, really? That would be really cool! That's one of the most difficult thing about Renovate that I've experienced - the configuration is hard to piece together. The docs don't answer all questions that I have found myself asking about certain config options.

Googling usually leads to issues like this, which is why I've been trying to put together a lot of examples for those who are looking.

@karlhorky
Copy link
Contributor

karlhorky commented Sep 4, 2020

I guess you mean these issues in this here: https://github.com/renovatebot/config-help/issues

karlhorky added a commit to karlhorky/renovate-config that referenced this issue Sep 4, 2020
@rarkins
Copy link
Collaborator

rarkins commented Sep 4, 2020

PRs to improve the docs (which are open source, in this repo) are preferred over criticisms. Open source projects have makers and takers.. choose your path.

@karlhorky
Copy link
Contributor

karlhorky commented Sep 4, 2020

I think it's not that clear cut.

Re makers vs takers: It doesn't make sense for a lot of people to contribute out of time reasons. Furthermore, if someone is not comfortable with their knowledge on something, it's very difficult or impossible for them to contribute.

Re criticism: Non-toxic criticism is helpful for showing signals that something could be better. Sorry if I came over as toxic or negative. Renovate is awesome!

That said, I am already more on the end of the spectrum of "maker" (check out my contributions to open source if you want), and I will contribute to the Renovate docs, as soon as feel a bit more comfortable with my skills and the correctness of what I'm doing. I assume that the Configuration Options page is here: https://github.com/renovatebot/renovate/blob/master/docs/usage/configuration-options.md , is that correct?

@rarkins
Copy link
Collaborator

rarkins commented Sep 4, 2020

"The docs leave a lot to be desired." came across as non-constructive (toxic would not be a word I'd typically use, and definitely not here). I think most docs - open source or otherwise - could be improved greatly including ours, but in many ways ours are awesome. e.g. our linting rules mean it's impossible to add a config option to the product without a description for it, and the fact you need to add a subheading for it to the markdown doc too subtly encourages extended documentation too.

It's thankfully still the exception but as use of the project has grown, so too has the occurrences of people who act like they're owed or entitled to hand-holding, so anyway I also apologize that I lumped you into that group due to your comment. I did make sure to insert the word "project" after "open source" as people can be either in different contexts, myself included.

If a repo was source code only then I agree that some people simply can't contribute. But docs is another matter, and we have quite a lot of people who've proposed helpful edits to the markdown files without needing to even read a line of code.

The docs you see on the website are mostly all in the docs/usage/ folder and any approved PRs get automatically published pretty soon after. Any time you find it takes you more than one or two passes through the text to understand what it means, feel free to re-phrase or add to it to help the next user. Even if you're not sure of what's best feel free to raise a draft PR for feedback and we can suggest something better than what's there currently. If you feel really motivated about a particular topic, you can even create a new file on that topic as we don't have any fixed structure.

@karlhorky
Copy link
Contributor

karlhorky commented Sep 4, 2020

Understandable, I've reworded my original comment.

If you feel really motivated about a particular topic, you can even create a new file on that topic

Even if you're not sure of what's best feel free to raise a draft PR for feedback and we can suggest something better than what's there currently.

Will do, sure, if I get some time soon!

I think aside from clarity, some suggestions I would have would be:

  1. List all possible configuration values, maybe also multiple times in the document
  2. List of "common things you may want", such as some things listed by ljharb here: Guidance for initial default shared config? config-help#816
  3. Split up the config docs into separate pages. This will help tremendously with search engine visibility.
  4. A repo or folder full of config examples would also be helpful (or maybe this exists somewhere already?)

@rarkins
Copy link
Collaborator

rarkins commented Sep 4, 2020

  1. List all possible configuration values, maybe also multiple times in the document

All possible configuration options are in that file. For the values, we try to auto-generate that information from https://github.com/renovatebot/renovate/blob/master/lib/config/definitions.ts as it's prepared for docs.renovatebot.com

  1. List of "common things you may want", such as those listed by ljharb here: renovatebot/config-help#816

Yes, I agree that a most common topics doc could be useful. We need to offset the effects of overwhelming the typical user who just wants to get started (for whom which our config:base preset is intended). But also beware that ljharb is quite a power user so I wouldn't include all the things he's asking about there.

  1. Split up the config docs into separate pages. This will help tremendously with search engine visibility.

We should maybe do that now, seeing as it's grown so large now. It would need to be done in https://github.com/renovatebot/renovatebot.github.io

  1. A repo or folder full of config examples would also be helpful (or maybe this exists somewhere already?)

This kind of thing is hard to curate, as it starts growing large before long (it already grew too large around 2018-2019 so got absorbed into the regular docs).

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority-2-high Bugs impacting wide number of users or very important features type:feature Feature (new functionality)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants