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

Enable gomod ind. deps for vulnerabilities. #143

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

cevich
Copy link
Member

@cevich cevich commented Jun 5, 2023

Indirect deps are disabled by default for the gomod manager. Ref:
https://docs.renovatebot.com/modules/manager/gomod/#post-update-options

Indirect deps are also broken for golang updates due to go mod tidy problems. Ref:
https://github.com/renovatebot/renovate/issues/ number 12999

However, for vulnerability related updates, perhaps we want a PR opened anyway. Then at least a developer is able to fixup any go mod tidy related problems.

@github-actions
Copy link

github-actions bot commented Jun 5, 2023

Successfully triggered github-actions/success task to indicate successful run of cirrus-ci_retrospective integration and unit testing from this PR's 6f4167ecd35c8ccdfc7a1523a487ac8cc1360a81.

@edsantiago
Copy link
Member

I can't pretend to understand renovatebot workflows, but your motivation SGTM. Since I'm not the one who'll be responding to the vendoring PRs, I won't give final approval. Thank you for finding this issue and taking it on.

@cevich
Copy link
Member Author

cevich commented Jun 6, 2023

I can't pretend to understand renovatebot workflows

No worries, I barely understand them myself. It's an incredibly complex tool that sometimes operates in very unexpected ways. OTOH...it does give us a lot more fine-grain DRY controls compared to the (very spammy) Dependabot (with duplicate configs in every repo).

Since I'm not the one who'll be responding to the vendoring PRs, I won't give final approval.

No worries, and TBH I'm not even sure this change will work at all.

@cevich
Copy link
Member Author

cevich commented Jun 7, 2023

@containers/podman-maintainers @containers/buildah-maintainers @containers/image-maintainers @containers/storage-maintainers PTAL. I sent an e-mail about this...but it's really important and potentially time-sensitive (there's at least one vulnerability already reported).

Once merged, this change should (see below) cause any reported vulnerabilities in indirect golang dependencies to have PRs open. Those PRs will very likely fail to compile and/or fail tests. Near as I can tell, this doesn't affect rust or any other languages watched over by Renovate.

There are three alternatives as I see it (but maybe I'm wrong):

  1. Don't get any PRs for indirect dependencies at all, potentially not noticing something really important in our software supply-chain 😱
  2. Enable Renovate to propose updates for ANY indirect golang dependency (likely resulting in massive update-PR spam) 😖
  3. Re-enable Dependabot's ability to open vulnerability update PRs - they are also likely to fail to compile and/or fail tests 🤮

There's some risk

I'm not 100% sure this fix will address the problem. I've submitted a question upstream on the topic (no replies yet). However, once merged, I can easily go spelunking through the Renovate logs to confirm a known indirect dep. w/ vulnerability gets picked up (or not).

@cevich cevich marked this pull request as ready for review June 7, 2023 14:56
@mtrmac
Copy link
Collaborator

mtrmac commented Jun 7, 2023

(I’m not sure how renovatebot/renovate#12999 relates to the topic of this PR but I’m also not sufficiently motivated to try to reproduce that.)


For c/image and Skopeo, I’m fine with enabling updates on indirect dependencies, as a general principle (subject to the existing monthly cap on digest updates, if possible). About once a year I manually revisit the indirect dependencies to see if there is something we need, and having that automated wouldn't hurt.

If the worry is that this will file broken PRs, *shrug*, let’s try. We can always revert if it becomes too annoying.


BTW https://github.com/containers/podman/security/dependabot/30 is AFAICS not relevant to our code paths. That code is included but not called.

@cevich
Copy link
Member Author

cevich commented Jun 7, 2023

(I’m not sure how renovatebot/renovate#12999 relates to the topic of this PR

My limited (and maybe wrong) understanding is that feature/fix is needed to help renovate open non-broken PRs for indirect dependencies.

I’m fine with enabling updates on indirect dependencies, as a general principle (subject to the existing monthly cap on digest updates

Yeah I think having them limited on a schedule would be important. Then for projects like podman or buildah, I'd be afraid there simply might be "too" many PRs opened up. Unless (as this PR does) it's also limited to only indirect vulnerabilities.

AFAICS not relevant to our code paths. That code is included but not called.

That's good to hear.

Just so it's clear: My motivation to file this PR was: If dependabot hadn't (accidentally) been enabled (for vulnerability PRs) in podman, then NO PR would have been filed at all. Broken or otherwise. According to the Renovate logs, it simply ignored it (since it was indirect).

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

LGTM for the record.

@cevich cevich force-pushed the vuln_gomod_indirect_enable branch from 6f4167e to 60a3d37 Compare June 8, 2023 15:15
@cevich
Copy link
Member Author

cevich commented Jun 8, 2023

Force-push: Added enabled: true into vulnerabilityAlerts block as per discussion recommendation.

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

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

Updates only for vulnerable indirect dependencies is even better.

(The test failure is #144 .)

Indirect deps are disabled by default for the `gomod` manager.
Ref:
https://docs.renovatebot.com/modules/manager/gomod/#post-update-options

Indirect deps are also broken for golang updates due to `go mod tidy`
problems. Ref:
https://github.com/renovatebot/renovate/issues/ number 12999

However, for vulnerability related updates, perhaps we want a PR opened
anyway.  Then at least a developer is able to fixup any `go mod tidy`
related problems.

Signed-off-by: Chris Evich <[email protected]>
@cevich cevich force-pushed the vuln_gomod_indirect_enable branch from 60a3d37 to c005bb4 Compare June 8, 2023 16:11
@cevich
Copy link
Member Author

cevich commented Jun 8, 2023

Force-push: rebased to resolve lint problem.

@cevich
Copy link
Member Author

cevich commented Jun 8, 2023

Updates only for vulnerable indirect dependencies is even better.

Yeah, I think this is smarter. A course of resolution for these PRs could be to just wait and bump up the direct dependency if an update is in-progress.

@github-actions
Copy link

github-actions bot commented Jun 8, 2023

Successfully triggered github-actions/success task to indicate successful run of cirrus-ci_retrospective integration and unit testing from this PR's c005bb4c471d38b218fe7ecf2ce37b76cec55fa2.

@cevich cevich merged commit 62979df into containers:main Jun 8, 2023
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