Skip to content

fix(ops): allow gmpctl to ignore specified modules; loop#2008

Open
bwplotka wants to merge 2 commits into
mainfrom
gmpctl-ignore
Open

fix(ops): allow gmpctl to ignore specified modules; loop#2008
bwplotka wants to merge 2 commits into
mainfrom
gmpctl-ignore

Conversation

@bwplotka

@bwplotka bwplotka commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

This PR improves gmpctl vulnfix reliability by adding module ignoring capabilities, fixing dependency parsing, and adding multi-pass vulnerability resolution.

Changes Included

  1. Ignored Modules Support:

    • Added vuln_ignored_modules setting in .gmpctl.default.yaml.
    • Added -vuln-ignore-modules flag to gmpctl and vulnupdatelist to skip specific Go module upgrades (such as github.com/prometheus/prometheus) during vulnerability remediation.
  2. Dependency Update Bug Fix (lib.sh):

    • Fixed release-lib::gomod_vulnfix parsing of vulnupdatelist output (using $1 instead of $2 to correctly extract module@version rather than CVE IDs).
    • Switched from line-matching sed to go get "${mod_path}@${desired_version}" to reliably update both direct and indirect dependencies in go.mod.
  3. Multi-Pass Vulnerability Resolution (vulnfix.sh):

    • Added an iterative loop (up to 5 attempts) in vulnfix.sh to handle chained/transitive vulnerability fixes (e.g., when updating a module reveals a higher patch requirement in subsequent scans).
  4. Tests:

    • Added unit tests in vulnupdatelist/vuln_test.go verifying ignored module logic and update list compilation.

@bwplotka
bwplotka changed the base branch from gmpctl-nvdapi to gmpctl-tools July 24, 2026 20:58

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the ability to ignore specific Go modules during dependency upgrades by adding an ignored_modules configuration option to gmpctl. The feedback suggests optimizing the module lookup by using a map instead of a slice to achieve O(1) complexity, which requires updating the parsing logic, the signature of compileUpdateList, and the unit tests. Additionally, it is recommended to make the unit test hermetic by avoiding external NVD API calls triggered by osv entries in the mock JSON.

Comment thread ops/gmpctl/vulnupdatelist/main.go
Comment thread ops/gmpctl/vulnupdatelist/vuln.go
Comment thread ops/gmpctl/vulnupdatelist/vuln.go Outdated
Comment thread ops/gmpctl/vulnupdatelist/vuln_test.go
Comment thread ops/gmpctl/vulnupdatelist/vuln_test.go
@bwplotka
bwplotka changed the base branch from gmpctl-tools to main July 24, 2026 21:00
@bwplotka
bwplotka force-pushed the gmpctl-ignore branch 2 times, most recently from 418d60d to 510daf6 Compare July 24, 2026 21:04
@bwplotka
bwplotka changed the base branch from main to gmpctl-nvdapi July 24, 2026 21:04
@bwplotka bwplotka changed the title fix(gmpctl): add ignored_modules configuration to skip known module upgrades fix(ops): allow gmpctl to ignore specified modules Jul 24, 2026
@bwplotka
bwplotka changed the base branch from gmpctl-nvdapi to main July 24, 2026 22:07
@bwplotka
bwplotka force-pushed the gmpctl-ignore branch 5 times, most recently from 6b0f1b3 to 0896a8b Compare July 24, 2026 22:14
bwplotka added 2 commits July 24, 2026 23:32
Signed-off-by: bwplotka <bwplotka@google.com>
Signed-off-by: bwplotka <bwplotka@google.com>
@bwplotka bwplotka changed the title fix(ops): allow gmpctl to ignore specified modules fix(ops): allow gmpctl to ignore specified modules and fix vulnfix dependency updates Jul 24, 2026
@bwplotka bwplotka changed the title fix(ops): allow gmpctl to ignore specified modules and fix vulnfix dependency updates fix(ops): allow gmpctl to ignore specified modules; loop Jul 24, 2026
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.

1 participant