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

fix(scan): false positives in Debian Pkg for CVE-IDs already detected by Trivy #1639

Merged
merged 3 commits into from
Apr 17, 2023

Conversation

kotakanbe
Copy link
Member

@kotakanbe kotakanbe commented Apr 11, 2023

What did you implement:

Fix the bug that causes false positives in the vulnerability detection process of Debian packages.

The issue occurs under the following conditions:

  • When scanning Debian
  • When scanning libraries
  • During the vulnerability detection process of the package, searching the package list from Gost's vulnerability database. If the vulnerability detected in the library is included in Gost's search results
    In this case, since the version comparison process for affected packages is skipped, it is considered detected in Gost as well

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

confirmed the diff in the Scan Result containing the following package information:

   "runningKernel": {
        "release": "8.19.0-23-cloud-amd64",
        "version": "8.19.269-1",
        "rebootRequired": false
    },
    "packages": {
        "zlib1g": {
            "name": "zlib1g",
            "version": "1:1.2.11.dfsg-1+deb10u2",
            "release": "",
            "newVersion": "",
            "newRelease": "",
            "arch": "",
            "repository": ""
        }
    },
    "SrcPackages": {
        "zlib": {
            "name": "zlib",
            "version": "1:1.2.11.dfsg-1+deb10u2",
            "arch": "",
            "binaryNames": [
                "zlib1g"
            ]
        }
    },
    "libraries": [
        {
            "Type": "bundler",
            "Libs": [
                {
                    "Name": "nokogiri",
                    "Version": "1.10.10",
                    "FilePath": ""
                }
            ],
            "path": "/home/admin/Gemfile.lock"
        }
    ],

By checking the diff, I verified that the false positives, which had been detected by Gost and erroneously included Debian package information in the affectedPackages, have been fixed.

diff localhost.json localhost.json.new                                                                                        INT ✘ 
33c33
<     "reportedAt": "2023-04-15T14:22:51.210993022+09:00",
---
>     "reportedAt": "2023-04-15T14:21:14.256507738+09:00",
35c35
<     "reportedRevision": "build-20230413_082522_ac82901",
---
>     "reportedRevision": "build-20230415_140328_f4519b7",
3467,3473c3467
<                     "detectionMethod": "DebianSecurityTrackerMatch"
<                 }
<             ],
<             "affectedPackages": [
<                 {
<                     "name": "zlib1g",
<                     "fixedIn": "1:1.2.11.dfsg-1+deb10u1"
---
>                     "detectionMethod": "TrivyMatch"

Checklist:

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES

@kotakanbe kotakanbe marked this pull request as ready for review April 15, 2023 05:39
@kotakanbe kotakanbe merged commit a1d3fbf into master Apr 17, 2023
@kotakanbe kotakanbe deleted the fix-debian-detection branch April 17, 2023 00:21
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