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

ENG-4766:Add trivy to SDK CI build #77

Merged
merged 3 commits into from
Mar 27, 2024
Merged

ENG-4766:Add trivy to SDK CI build #77

merged 3 commits into from
Mar 27, 2024

Conversation

JMkrish
Copy link
Contributor

@JMkrish JMkrish commented Mar 23, 2024

Ticket(s), Design Docs, other Relevant Artifacts:

Description

This PR performs a security audit using an open source tool called Trivy. A repository scan is run every commit and a scan of the repository and latest image for the main/master branch is run nightly.

For the the nightly build, if there are issues reported, a slack message is generated to the monitoring-sdk slack channel. The message looks like this:

image

The Slack user display name will be changed to "CircleCI Build Bot".

Examples of the reports in HTML can be seen here in the artifacts tab: https://app.circleci.com/pipelines/github/sightmachine/sightmachine-sdk/417/workflows/d826285e-3a79-49a8-be1d-76e0aa65f7e8/jobs/1089

A number of legacy integrations were upgraded as part of maintaining tech-debt in the build system:

  1. Started using Slack ORB 4.x. Required creation of a OAuth Application in Slack, CircleCI Build Bot.
  2. Started using Google CLI ORB to integration google cli.
  3. Upgraded codecov Orb from 3.x to 4.x.
    The tuning of the trivy report can be handled in a separate ticket.

Testing

This was manually tested via the CircleCI build process. A log of the test are cached in CircleCI under the branch.

To test yourself, replay an existing build or clone the branch and push.

To test the cve-image-scan job, attach it to the commit build.

Documentation

A markdown readme about configuring Trivy for developers / QA has been added.

@codecov-commenter
Copy link

codecov-commenter commented Mar 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 23.27%. Comparing base (3eec73f) to head (c3f9456).
Report is 8 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #77   +/-   ##
=======================================
  Coverage   23.27%   23.27%           
=======================================
  Files          11       11           
  Lines        1366     1366           
  Branches      321      321           
=======================================
  Hits          318      318           
  Misses       1048     1048           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JMkrish JMkrish force-pushed the ENG-4766 branch 5 times, most recently from 511921a to 6251f82 Compare March 26, 2024 06:04
path: fs_report_master.html
# The following will mark the build as failed if there are issues in the report.
- sm-build/trivy_notify_on_issues:
slack_channel: monitoring-sdk
Copy link

Choose a reason for hiding this comment

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

The only question I have is should this be a separate channel, or should be piggy back on the MA Monitoring channel?

@JMkrish JMkrish merged commit 24f49f6 into master Mar 27, 2024
7 checks passed
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.

3 participants