Skip to content

feat(checker): Added Mozilla Thunderbird checker #2429

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

Merged
merged 7 commits into from
Dec 20, 2022

Conversation

metabiswadeep
Copy link
Contributor

Fixes #2056

Signed off by metabiswadeep

@metabiswadeep metabiswadeep changed the title Added Mozilla Thunderbird checker feat(checker): Added Mozilla Thunderbird checker Dec 8, 2022
@metabiswadeep
Copy link
Contributor Author

metabiswadeep commented Dec 11, 2022

@terriko All tests pass on my local in linux as well as on windows. I guess its just a buggy CI which is the cause of these errors?

Edit: I used b17a185 as base for running tests on local

@terriko
Copy link
Contributor

terriko commented Dec 12, 2022

Poor buggy CI 😢

But yeah, in updating the underlying database to track sources of CVE data better and de-dupe better we had to break the CI until the cache could update (in theory I could force an update, but it wasn't working at the time that i tried). It looks like we broke at least one test that I wasn't anticipating, so Im working on resolving that today and hopefully we'll be able to get pull requests moving again for a few last things before I code freeze for 3.2.

CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = [r"thunderbird"]
VERSION_PATTERNS = [
r"ENCODER=Mozilla([0-9]+.[0-9]+(.[0-9]+)?)",
Copy link
Contributor

Choose a reason for hiding this comment

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

This pattern exists in Mozilla Firefox checker too. This could probably lead to false positives (we also might want to take out the pattern from Firefox if this pattern is present in Thunderbird)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess if the parent company is same then version tags for them will also be similar. Moreover this is the only valid debian version pattern that there is (I tried with many others but could not get any other patterns which make the tests pass).

Copy link
Contributor

Choose a reason for hiding this comment

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

The issue is with this pattern our tool will say the detected binary is Firefox if it scans Thunderbird (false positive). That's probably not what we want.

@metabiswadeep
Copy link
Contributor Author

@BreadGenie This should probably do it. All tests are passing on my local in linux as well as on windows.

Copy link
Contributor

@BreadGenie BreadGenie left a comment

Choose a reason for hiding this comment

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

LGTM

@terriko
Copy link
Contributor

terriko commented Dec 14, 2022

The error is around update schema (which was recently adjusted to need the extra arguments). I'm going to try updating the branch to see if that resolves it.

=========================== short test summary info ============================
FAILED test/test_cli.py::TestCLI::test_update_flags - TypeError: latest_schema() missing 2 required positional arguments: 'table_name' and 'table_schema'
FAILED test/test_cli.py::TestCLI::test_update - TypeError: latest_schema() missing 2 required positional arguments: 'table_name' and 'table_schema'
============ 2 failed, 18 passed, 2 skipped, 23 warnings in 48.64s =============

@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 2022

Codecov Report

Merging #2429 (075148c) into main (639fd49) will increase coverage by 0.65%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2429      +/-   ##
==========================================
+ Coverage   82.29%   82.95%   +0.65%     
==========================================
  Files         577      579       +2     
  Lines        9656     9666      +10     
  Branches     1148     1148              
==========================================
+ Hits         7946     8018      +72     
+ Misses       1373     1322      -51     
+ Partials      337      326      -11     
Flag Coverage Δ
longtests 82.46% <100.00%> (+0.73%) ⬆️
win-longtests 75.22% <100.00%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cve_bin_tool/checkers/__init__.py 95.55% <ø> (ø)
cve_bin_tool/checkers/thunderbird.py 100.00% <100.00%> (ø)
test/test_data/thunderbird.py 100.00% <100.00%> (ø)
test/test_json.py 72.41% <0.00%> (-17.25%) ⬇️
cve_bin_tool/data_sources/redhat_source.py 62.91% <0.00%> (-3.32%) ⬇️
cve_bin_tool/cli.py 68.16% <0.00%> (+0.32%) ⬆️
cve_bin_tool/data_sources/nvd_source.py 62.24% <0.00%> (+3.73%) ⬆️
cve_bin_tool/cvedb.py 77.95% <0.00%> (+4.65%) ⬆️
cve_bin_tool/data_sources/osv_source.py 84.57% <0.00%> (+21.96%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@terriko terriko left a comment

Choose a reason for hiding this comment

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

This looks ready to merge. I've filed a separate bug #2453 for improving the firefox pattern so that it doesn't give false positives on thunderbird; I think we'll definitely want to fix that.

@terriko terriko merged commit f7830d8 into intel:main Dec 20, 2022
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.

new checker request: mozilla thunderbird
4 participants