Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
924f4c0
feat: implement ability to ignore vulns in config
G-Rath Feb 18, 2026
5e3bb40
test: write some tests
G-Rath Feb 18, 2026
0766c5e
feat: implement experimental flag
G-Rath Feb 19, 2026
443c75c
test: add some cmd cases
G-Rath Feb 19, 2026
827087b
fix: update ignores before doing filtering
G-Rath Feb 19, 2026
45ff086
fix: deduplicate ignores
G-Rath Feb 19, 2026
e5a5891
fix: return errors
G-Rath Feb 19, 2026
5da88e9
fix: remove indenting
G-Rath Feb 19, 2026
415bd4f
refactor: rename flag
G-Rath Feb 19, 2026
3e3a7df
fix: ensure vulns are sorted by ID
G-Rath Feb 19, 2026
3d423b4
refactor: make `copyFile` public (internally)
G-Rath Feb 19, 2026
3ae74bd
test: add a case with a custom global config
G-Rath Feb 19, 2026
4340360
fix: account for multiple files using the same config
G-Rath Feb 19, 2026
b472f2b
test: use `os.CopyFS`
G-Rath Feb 19, 2026
8a6cf7e
fix: skip the default config and add nil check
G-Rath Feb 19, 2026
7a76ced
refactor: simplify "update configs" implementation (somewhat)
G-Rath Feb 19, 2026
43ba19b
test: update names
G-Rath Feb 19, 2026
9162350
test: add case for global config + recursive
G-Rath Feb 19, 2026
73a85bd
test: add more cases for "with no config"
G-Rath Feb 19, 2026
5527553
test: merge groups
G-Rath Feb 19, 2026
c67455f
test: use cassettes and update snapshots
G-Rath Feb 23, 2026
a465f22
test: use vertical output instead
G-Rath Feb 23, 2026
b9d3790
feat: switch to using a string flag
G-Rath Feb 24, 2026
a03aab2
feat: implement support for removing unused ignores
G-Rath Feb 24, 2026
8a72743
refactor: merge `unused-config.toml` and `custom-config.toml`
G-Rath Feb 26, 2026
f5636b8
test: add a config case with a package override
G-Rath Feb 26, 2026
423103a
chore: add todos
G-Rath Feb 26, 2026
840c3f3
refactor(config): split ignoring and saving
G-Rath Mar 2, 2026
dabe5eb
refactor: clean up functions a bit more
G-Rath Mar 2, 2026
cc2c376
refactor: stick with saving as config map is not holding pointers
G-Rath Mar 3, 2026
0e719b6
chore: update cassettes
G-Rath Mar 5, 2026
52d8639
docs: add a page
G-Rath Mar 6, 2026
dbb1a0b
perf: optimize slice filtering
G-Rath Mar 10, 2026
fd8d1b0
fix: store configs by reference
G-Rath Mar 10, 2026
3ca2cb3
feat: print the number of removed unused ignore entries
G-Rath Mar 10, 2026
03d6d54
feat: print the actual ignore entries that were removed
G-Rath Mar 10, 2026
05b14dc
fix: don't record configs that had no ignores removed
G-Rath Mar 10, 2026
d207c3c
feat: print when config ignores have been updated
G-Rath Mar 10, 2026
4db71ef
refactor: deduplicate "reporting on unused ignore action"
G-Rath Mar 10, 2026
7851113
refactor: deduplicate the whole "unused ignore entries" section
G-Rath Mar 10, 2026
fd1744d
refactor: deduplicate for when we're ignoring all entries too
G-Rath Mar 10, 2026
097b8cc
fix: omit empty fields from package overrides
G-Rath Mar 10, 2026
e7d5c43
fix: omit ignored vulns and package overrides entirely if empty
G-Rath Mar 10, 2026
917a41e
fix: reorder top level `Config` fields
G-Rath Mar 10, 2026
b1aaffb
feat: don't filter when ignoring all vulns
G-Rath Mar 10, 2026
be56aee
test: update snapshots and cassettes
G-Rath Jun 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cmd/osv-scanner/internal/helper/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,19 @@ func BuildCommonScanFlags(defaultExtractors []string) []cli.Flag {
Name: "experimental-no-default-plugins",
Usage: "disable default plugins, instead using only those enabled by --experimental-plugins",
},
&cli.StringFlag{
Name: "experimental-update-config-ignores",
Usage: "update config file(s) to ignore vulnerabilities - must be one of: none, unused, or all",
Action: func(_ context.Context, _ *cli.Command, s string) error {
// todo: can we do something other than "none"?
// - feels like that might mean "remove all ignores"
// - ideally empty string would be nice, but might not work properly as a flag default?
if s == "none" || s == "unused" || s == "all" {
return nil
}

return fmt.Errorf("unsupported option \"%s\" - must be none, unused, or all", s)
},
},
}
}
1 change: 1 addition & 0 deletions cmd/osv-scanner/internal/helper/getters.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ func GetExperimentalScannerActions(cmd *cli.Command, client *http.Client) osvsca
PluginsNoDefaults: cmd.Bool("experimental-no-default-plugins"),
HTTPClient: client,
FlagDeprecatedPackages: cmd.Bool("experimental-flag-deprecated-packages"),
UpdateConfigIgnores: cmd.String("experimental-update-config-ignores"),
}
}
4 changes: 2 additions & 2 deletions cmd/osv-scanner/internal/testcmd/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"
)

func copyFile(from, to string) (string, error) {
func CopyFile(from, to string) (string, error) {
b, err := os.ReadFile(from)
if err != nil {
return "", fmt.Errorf("could not read test file: %w", err)
Expand Down Expand Up @@ -37,7 +37,7 @@ func CopyFileFlagTo(t *testing.T, tc Case, flagName string, dir string) string {
return ""
}

newPath, err := copyFile(flagValue, filepath.Join(dir, filepath.Base(flagValue)))
newPath, err := CopyFile(flagValue, filepath.Join(dir, filepath.Base(flagValue)))

if err != nil {
t.Fatalf("%v", err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/osv-scanner/internal/testcmd/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func SetupGitFixtures() (func(), error) {
}

for _, f := range gitIgnoreFiles {
gitignoreFile, err := copyFile(f, filepath.Join(filepath.Dir(f), ".gitignore"))
gitignoreFile, err := CopyFile(f, filepath.Join(filepath.Dir(f), ".gitignore"))

if err != nil {
return cleaner, err
Expand Down
Loading
Loading