Skip to content

Commit

Permalink
Exclude cves by products (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
RamanaReddy0M authored Nov 21, 2023
1 parent cae3eec commit 6087a67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func main() {
// flagset.StringSliceVarP(&options.cweIds, "cwe-id", "cwe", nil, "cve to list for given cwe id", goflags.CommaSeparatedStringSliceOptions),
flagset.StringSliceVarP(&options.vendor, "vendor", "v", nil, "cve to list for given vendor", goflags.CommaSeparatedStringSliceOptions),
flagset.StringSliceVarP(&options.product, "product", "p", nil, "cve to list for given product", goflags.CommaSeparatedStringSliceOptions),
flagset.StringSliceVar(&options.eproduct, "eproduct", nil, "cves to exclude based on products", goflags.CommaSeparatedStringSliceOptions),
flagset.StringSliceVarP(&options.severity, "severity", "s", nil, "cve to list for given severity", goflags.CommaSeparatedStringSliceOptions),
flagset.StringSliceVarP(&options.cvssScore, "cvss-score", "cs", nil, "cve to list for given cvss score", goflags.CommaSeparatedStringSliceOptions),
flagset.StringVarP(&options.cpe, "cpe", "c", "", "cve to list for given cpe"),
Expand Down Expand Up @@ -429,6 +430,9 @@ func constructQueryParams(opts Options) string {
if len(opts.product) > 0 {
addQueryParams(queryParams, "cpe.product", opts.product)
}
if len(opts.eproduct) > 0 {
addQueryParams(queryParams, "cpe.product_ne", opts.eproduct)
}
if len(opts.vendor) > 0 {
addQueryParams(queryParams, "cpe.vendor", opts.vendor)
}
Expand Down
1 change: 1 addition & 0 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ type Options struct {
cweIds goflags.StringSlice
vendor goflags.StringSlice
product goflags.StringSlice
eproduct goflags.StringSlice
severity goflags.StringSlice
cvssScore goflags.StringSlice
//cvssMetrics goflags.StringSlice
Expand Down

0 comments on commit 6087a67

Please sign in to comment.