finos / tracdap

A next-generation data and analytics platform for use in highly regulated environments
Apache License 2.0
41 stars 12 forks source link

Vulnerability and license scanning - Java #74

Closed martin-traverse closed 3 years ago

martin-traverse commented 3 years ago

These scans will cover the core platform services:

Both scans to run out of CI and publish results as build artifacts. Probably it is sufficient to run on PR, merge and tag events.

(The same scanning should cover the Java/Scala model runtime in future).

maoo commented 3 years ago

We used https://jeremylong.github.io/DependencyCheck/dependency-check-maven/ for security checks.

As per license reporting, another FINOS project found a gradle plugin to manage it, see https://github.com/finos/symphony-bdk-java/issues/416#issuecomment-762332733

martin-traverse commented 3 years ago

Hi @maoo - I've raised PR #81 for this. Example run/output here (time limited):

https://github.com/Accenture/trac/actions/runs/1375626678

Some points to note:

Questions

I'll see if I can make GitHub cache the NVD files in the build before merging.

maoo commented 3 years ago

Hi @maoo - I've raised PR #81 for this. Example run/output here (time limited):

https://github.com/Accenture/trac/actions/runs/1375626678

Awesome work here @martin-traverse ! My comments below:

Some points to note:

  • False positives for vulnerabilities are listed in dev/vulnerabilities/, the project name 'trac' is one! Probably a separate discussion, so I have marked it as a false positive for now.
  • There are no vulnerabilities that need risk accepting

That's awesome! I'll review it, and confirm that we can actually check the security requirement for FINOS contribution.

  • On license, I have allowed EPL for test licenses and two BOM packages that have missing (null) license
  • Create trac-lib-javax to get around the dependency from gRPC on javax.annotation, which is CDDL. Implementation is copied from the Tomcat version, which is Apache 2.

That's great, but please keep in mind that both EPL and CDDL (as any other Category B license) are licenses that you can safely redistribute, assuming you add a mention in the NOTICE file, see https://github.com/finos/community/blob/master/governance/Software-Projects/License-categories.md

  • Build is set to fail on any license scan failure, or a CVSS score >= 4 (i.e medium and above)
  • Reports are always generated as build artefacts

Amazing.

I don't see the Python and Node validations yet; is this something we'll tackle as separate issues/PRs ?

Questions

  • I think it is ok to run this on PR, merge and tag only, do you agree?

Yes, assuming we protect the main branch from direct commits, these events would suffice.

  • Where would you like the compliance reports saved? Should we add them as a release artefact for release tag builds?

For now, I'd just print them out in the GitHub Actions logs; we can safely leave this task for later, ie when we discuss the first release of Trac into FINOS. WDYT?

maoo commented 3 years ago

Answering to myself re. JS and Python validations... see #75 and #76

@martin-traverse - I reviewed reports on https://github.com/martin-traverse/trac/tree/feature/java_compliance/dev . LGTM, thank you!

martin-traverse commented 3 years ago

That's great, thanks @maoo, I will prepare PRs for the other two languages.