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

[Build] Run OWASP Dependency Check as a scheduled build once per day #10855

Merged

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Jun 7, 2021

Motivation

Monitoring for new library vulnerabilities without having an automated solution is prone to errors.

There's an enhancement request #8815 about "Automated security and update routine before every release". This PR will help address those aspects.

New library vulnerabilities can be detected earlier when there's a scheduled build once per day.

Modifications

  • add suppressions for false positives
  • add suppressions for known issues in distribution/server and make the check
    fail if new vulnerabilities are introduced
  • run reports for distribution/offloaders, distribution/io and
    pulsar-sql/presto-distribution to get a complete report of all
    vulnerabilities
  • upload report files as GitHub Actions artifact

Additional context

The current master branch contains a few vulnerabilities:

The vulnerabilities mentioned above are suppressed in src/owasp-dependency-check-suppressions.xml file so that it's possible to run OWASP Dependency Check with -DfailBuildOnAnyVulnerability=true for failing the build if any new vulnerabilities are detected. This is the way how this PR sets a baseline and llbrary vulnerabilities can be tracked.

- add suppressions for false positives
- add suppressions for known issues in distribution/server and make the check
  fail if new vulnerabilities are introduced
- run reports for distribution/offloaders, distribution/io and
  pulsar-sql/presto-distribution to get a complete report of all
  vulnerabilities
- upload report files as GitHub Actions artifact
@lhotari
Copy link
Member Author

lhotari commented Jun 7, 2021

Here's an example of the OWASP Dependency Check html reports that the schedule build will produce: https://github.com/lhotari/pulsar/actions/runs/914726687
Click on "owasp-dependency-check-reports" to download the zipped files (4 separate reports).

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

LGTM

we have a similar Job on Apache ZooKeeper project

+1

Copy link
Contributor

@merlimat merlimat left a comment

Choose a reason for hiding this comment

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

Looks good. Is there a way to trigger an email notification to the dev@ list when the job fails?

@lhotari
Copy link
Member Author

lhotari commented Jun 7, 2021

Looks good. Is there a way to trigger an email notification to the dev@ list when the job fails?

It's possible, but a bit complicated in GitHub Actions to send email. There are multiple ways to implement the sending of email from GitHub Actions. You need an email sending service in all solutions.

The simplest way might be with SendGrid free, adding the API key as a GitHub Actions secret and using a shell script where curl is used to send email via the SendGrid REST API.

Perhaps that could be done separately once we see how well the scheduled job works?
Notifications do get sent by GitHub when an action fails but I'm not exactly sure how this gets delivered in apache/pulsar.

@merlimat merlimat merged commit ccadc8a into apache:master Jun 7, 2021
@lhotari
Copy link
Member Author

lhotari commented Jun 8, 2021

The results of the scheduled OWASP Dependency Check scans can be found here:
https://github.com/apache/pulsar/actions/workflows/ci-owasp-dependency-check.yaml

yangl pushed a commit to yangl/pulsar that referenced this pull request Jun 23, 2021
…pache#10855)

- add suppressions for false positives
- add suppressions for known issues in distribution/server and make the check
  fail if new vulnerabilities are introduced
- run reports for distribution/offloaders, distribution/io and
  pulsar-sql/presto-distribution to get a complete report of all
  vulnerabilities
- upload report files as GitHub Actions artifact
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Nov 25, 2021
…pache#10855)

- add suppressions for false positives
- add suppressions for known issues in distribution/server and make the check
  fail if new vulnerabilities are introduced
- run reports for distribution/offloaders, distribution/io and
  pulsar-sql/presto-distribution to get a complete report of all
  vulnerabilities
- upload report files as GitHub Actions artifact

(cherry picked from commit ccadc8a)
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
…pache#10855)

- add suppressions for false positives
- add suppressions for known issues in distribution/server and make the check
  fail if new vulnerabilities are introduced
- run reports for distribution/offloaders, distribution/io and
  pulsar-sql/presto-distribution to get a complete report of all
  vulnerabilities
- upload report files as GitHub Actions artifact
@hpvd
Copy link

hpvd commented Aug 11, 2022

since list of suppressed vulnerabilities grows over time (today: 27)
would be good before every release to check if suppressing of vulnerabilities is still reasonable
See #17068

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants