Skip to content

Add scanning to released images and process to track vulnerabilities #28087

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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

lucasmrod
Copy link
Member

For #25902.

Copy link

codecov bot commented Apr 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.00%. Comparing base (a7a8027) to head (d70cccf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #28087   +/-   ##
=======================================
  Coverage   64.00%   64.00%           
=======================================
  Files        1780     1780           
  Lines      170729   170729           
  Branches     4883     4883           
=======================================
+ Hits       109268   109275    +7     
+ Misses      52848    52841    -7     
  Partials     8613     8613           
Flag Coverage Δ
backend 65.05% <ø> (+<0.01%) ⬆️

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@lukeheath
Copy link
Member

@sharon-fdm I'll defer to you to approve the workflow changes.

Comment on lines +61 to +67
mkdir trivy-download
cd trivy-download
curl -L https://github.com/aquasecurity/trivy/releases/download/v0.61.0/trivy_0.61.0_Linux-64bit.tar.gz --output trivy_0.61.0_Linux-64bit.tar.gz
tar -xf trivy_0.61.0_Linux-64bit.tar.gz
mv trivy ..
cd ..
chmod +x ./trivy
Copy link
Contributor

Choose a reason for hiding this comment

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

seems like a candidate for github action caching, but nbd if it doesn't take a long time

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems this step takes 13s. So maybe a-ok for now.

run: |
RELEASES="${{ steps.get_latest_releases.outputs.FLEET_LATEST_RELEASES }}"
for version in $RELEASES; do
docker pull fleetdm/fleet:$version
Copy link
Contributor

Choose a reason for hiding this comment

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

where are we getting $version from here?

Copy link
Member Author

Choose a reason for hiding this comment

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

for loop line above :)

Copy link
Contributor

Choose a reason for hiding this comment

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

haha time for new 👓

@sgress454
Copy link
Contributor

Is the .trivyignore file relevant here, i.e. should we mention it in the README?

@lucasmrod
Copy link
Member Author

Is the .trivyignore file relevant here, i.e. should we mention it in the README?

I added a comment around the code folder (currently .trivyignore is the only code-related scanning file there)
Happy to add more comments if not clear.

Copy link
Contributor

@sgress454 sgress454 left a comment

Choose a reason for hiding this comment

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

Tested the new github-releases and vex-parser tools as well as the make vex-report target 👍 . The Github actions lgtm though I didn't test the trivy command part.

@@ -15,10 +15,6 @@ defaults:
# fail-fast using bash -eo pipefail. See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
Copy link
Collaborator

Choose a reason for hiding this comment

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

Chat with Lucas:
We have Docker images to cross compile fleetd packages.
This is a github action check for vulns in them.

@@ -0,0 +1,124 @@
name: Check vulnerabilities in released docker images
Copy link
Collaborator

Choose a reason for hiding this comment

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

Check for vulns in docker images that we have already released. (Fleet server)

@@ -16,6 +16,8 @@ on:
- "website/**"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Check for vulns in fleet server docker images that were not yet released (As part of the release process)

chmod +x ./trivy
./trivy image \
--exit-code=1 \
--ignore-unfixed \
Copy link
Collaborator

Choose a reason for hiding this comment

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

From Lucas: Let's remove it cause we do want to see vulns that do not have a fix.

@@ -0,0 +1,58 @@
package main
Copy link
Collaborator

Choose a reason for hiding this comment

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

A tool to get the N last Github releases of fleet.

@@ -0,0 +1,102 @@
package main
Copy link
Collaborator

Choose a reason for hiding this comment

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

A tool to parse the CVE jsons and generates the status.md

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.

4 participants