engine icon indicating copy to clipboard operation
engine copied to clipboard

Vulnerability Scanning on Third Party Deps

Open sealesj opened this issue 3 years ago • 1 comments

Introduce vulnerability scanning github workflow on third party dependencies defined in the DEPS file.

Project details The main flow of the scanning is the following: extract third party dependencies outlined in the DEPS file for each of those dependencies:

  • check there is a pinned commit hash value
  • use the corresponding upstream dependency url (found in DEPS file, vars section) to find a commit hash that the mirror dependency has most recently in common
  • use the above commit hash in common to query the Open Source Vulnerability database for potential vulnerabilities on the dependency
  • if a vulnerability is found, add the details to a SARIF file display the SARIF file report on the Flutter Engine "Security" tab For more details, see the design document link

Resolves b/230824334

Recipe Test: ~Successful recipe run for test outlined in tests.yaml https://chromium-swarm.appspot.com/task?id=5d7f4dc5008f7810~ ~Recipe will be added to recipes/engine which will trigger the tests defined in tests.yaml~ engine/engine_lint recipe updated to ensure that the DEPS file has the correct dependency metadata -- for mirrored deps it is essential to have the upstream repo url in the DEPS file Successful recipe test: https://chromium-swarm.appspot.com/task?id=5dccb000b2594810

Pre-launch Checklist

  • [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • [x] I read the Tree Hygiene wiki page, which explains my responsibilities.
  • [x] I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • [x] I listed at least one issue that this PR fixes in the description above.
  • [x] I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • [x] I updated/added relevant documentation (doc comments with ///).
  • [x] I signed the CLA.
  • [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

sealesj avatar Sep 29 '22 17:09 sealesj

The presubmits are failing on a couple of lints:

************* Module ci.scan_flattened_deps
ci/scan_flattened_deps.py:15:0: E0401: Unable to import 'requests' (import-error)
ci/scan_flattened_deps.py:262:13: W0703: Catching too general exception Exception (broad-except)

zanderso avatar Sep 29 '22 19:09 zanderso

From Triage: @sealesj Is this stale or are you still looking for a review. @zanderso wasn't sure which PR to review.

chinmaygarde avatar Oct 20 '22 20:10 chinmaygarde

@chinmaygarde Yes I am still looking for review

sealesj avatar Oct 20 '22 20:10 sealesj

@zanderso Could you review my updates if you have available time?

sealesj avatar Oct 24 '22 18:10 sealesj

Gold has detected about 1 new digest(s) on patchset 201. View them at https://flutter-engine-gold.skia.org/cl/github/36506

skia-gold avatar Oct 26 '22 20:10 skia-gold

@zanderso I need to use 'setUp' in lower-camel-case for the python unittest framework, but I can change the other methods to follow this style as well if necessary. I was following the example naming convention here https://docs.python.org/3/library/unittest.html#organizing-test-code

sealesj avatar Oct 31 '22 17:10 sealesj

@zanderso I need to use 'setUp' in lower-camel-case for the python unittest framework, but I can change the other methods to follow this style as well if necessary. I was following the example naming convention here https://docs.python.org/3/library/unittest.html#organizing-test-code

Ahh, I see. I think our yapf setup might prefer the lower_case_underscore style. In that case, can you note the exception for setUp in a comment?

zanderso avatar Oct 31 '22 17:10 zanderso

Sorry for the delay. Still hoping for answers to the open questions I had.

Apologies, I had several responses I needed to click "submit" for multiple responses

sealesj avatar Nov 10 '22 19:11 sealesj

cc @zanderso I believe this is good for another review. All outstanding questions seem to be resolved.

chinmaygarde avatar Nov 17 '22 21:11 chinmaygarde

Gold has detected about 1 new digest(s) on patchset 221. View them at https://flutter-engine-gold.skia.org/cl/github/36506

skia-gold avatar Nov 22 '22 19:11 skia-gold

Looks like the PR needs a rebase to pass presubs.

zanderso avatar Nov 22 '22 22:11 zanderso

Gold has detected about 1 new digest(s) on patchset 222. View them at https://flutter-engine-gold.skia.org/cl/github/36506

skia-gold avatar Nov 23 '22 17:11 skia-gold