@@ -396,6 +396,111 @@ Suppressed Vulnerabilities (Total: 1)
396
396
├─────────┼───────────────┼──────────┼─────────┼─────────────────┼───────────────────┤
397
397
│ bar │ CVE-2020-0002 │ MEDIUM │ ignored │ Not exploitable │ .trivyignore.yaml │
398
398
└─────────┴───────────────┴──────────┴─────────┴─────────────────┴───────────────────┘
399
+ ` ,
400
+ },
401
+ {
402
+ name : "suppressed all OS package vulnerabilities without `showSuppressed` flag" ,
403
+ result : types.Result {
404
+ Target : "test" ,
405
+ Class : types .ClassOSPkg ,
406
+ Type : ftypes .Alpine ,
407
+ ModifiedFindings : []types.ModifiedFinding {
408
+ {
409
+ Type : types .FindingTypeVulnerability ,
410
+ Status : types .FindingStatusIgnored ,
411
+ Statement : "Not exploitable" ,
412
+ Source : ".trivyignore.yaml" ,
413
+ Finding : types.DetectedVulnerability {
414
+ VulnerabilityID : "CVE-2020-0001" ,
415
+ PkgName : "foo" ,
416
+ InstalledVersion : "1.2.3" ,
417
+ Status : dbTypes .StatusWillNotFix ,
418
+ Vulnerability : dbTypes.Vulnerability {
419
+ Title : "title1" ,
420
+ Description : "desc1" ,
421
+ Severity : "MEDIUM" ,
422
+ },
423
+ },
424
+ },
425
+ },
426
+ },
427
+ showSuppressed : false ,
428
+ want : `
429
+ test
430
+ ====
431
+ Total: 0 (MEDIUM: 0, HIGH: 0)
432
+
433
+ ` ,
434
+ },
435
+ {
436
+ name : "suppressed all language package vulnerabilities without `showSuppressed` flag" ,
437
+ result : types.Result {
438
+ Target : "test" ,
439
+ Class : types .ClassLangPkg ,
440
+ Type : ftypes .Jar ,
441
+ ModifiedFindings : []types.ModifiedFinding {
442
+ {
443
+ Type : types .FindingTypeVulnerability ,
444
+ Status : types .FindingStatusIgnored ,
445
+ Statement : "Not exploitable" ,
446
+ Source : ".trivyignore.yaml" ,
447
+ Finding : types.DetectedVulnerability {
448
+ VulnerabilityID : "CVE-2020-0001" ,
449
+ PkgName : "foo" ,
450
+ InstalledVersion : "1.2.3" ,
451
+ Status : dbTypes .StatusWillNotFix ,
452
+ Vulnerability : dbTypes.Vulnerability {
453
+ Title : "title1" ,
454
+ Description : "desc1" ,
455
+ Severity : "MEDIUM" ,
456
+ },
457
+ },
458
+ },
459
+ },
460
+ },
461
+ showSuppressed : false ,
462
+ want : `` ,
463
+ },
464
+ {
465
+ name : "suppressed all language package vulnerabilities with `showSuppressed` flag" ,
466
+ result : types.Result {
467
+ Target : "test" ,
468
+ Class : types .ClassLangPkg ,
469
+ Type : ftypes .Jar ,
470
+ ModifiedFindings : []types.ModifiedFinding {
471
+ {
472
+ Type : types .FindingTypeVulnerability ,
473
+ Status : types .FindingStatusIgnored ,
474
+ Statement : "Not exploitable" ,
475
+ Source : ".trivyignore.yaml" ,
476
+ Finding : types.DetectedVulnerability {
477
+ VulnerabilityID : "CVE-2020-0001" ,
478
+ PkgName : "foo" ,
479
+ InstalledVersion : "1.2.3" ,
480
+ Status : dbTypes .StatusWillNotFix ,
481
+ Vulnerability : dbTypes.Vulnerability {
482
+ Title : "title1" ,
483
+ Description : "desc1" ,
484
+ Severity : "MEDIUM" ,
485
+ },
486
+ },
487
+ },
488
+ },
489
+ },
490
+ showSuppressed : true ,
491
+ want : `
492
+ test (jar)
493
+ ==========
494
+ Total: 0 (MEDIUM: 0, HIGH: 0)
495
+
496
+
497
+ Suppressed Vulnerabilities (Total: 1)
498
+ =====================================
499
+ ┌─────────┬───────────────┬──────────┬─────────┬─────────────────┬───────────────────┐
500
+ │ Library │ Vulnerability │ Severity │ Status │ Statement │ Source │
501
+ ├─────────┼───────────────┼──────────┼─────────┼─────────────────┼───────────────────┤
502
+ │ foo │ CVE-2020-0001 │ MEDIUM │ ignored │ Not exploitable │ .trivyignore.yaml │
503
+ └─────────┴───────────────┴──────────┴─────────┴─────────────────┴───────────────────┘
399
504
` ,
400
505
},
401
506
}
0 commit comments