You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At first glance the above sounds like "switch back to a broken version and wow it's broken!" but the mitigation we're looking for here ensures that if we have issues in some other part of the JSON we're delivering we catch those issues as well and opt to fail out (and raise a P1 alert) rather than publishing what amounts to a poisoned vulns feed.
🛠️ To fix
We need to add a step in the workflow that basically does at least the inverse of what the vulnerability processing cron (or, more simply, the vuln_processing command) does when the disable_data_sync config value is set to true: sync vulnerabilities without worrying about scanning against installed packages on hosts. Add that step after this one:
and fail the build if the command returns nonzero.
In order to do this, we'll need to decide what's in-scope to integration test, and how to effectively mock the rest; my thought here is that we can place the files where the server would expect them rather than downloading over GitHub, and that will still catch the sorts of issues we're looking for. That's about as good as we can do without publishing releases.
download the patch into the vulnerabilities repository
modify .github/workflows/generate-cve.yml
Right after the step that checks out the fleet repository name: Checkout Repo add a step that applies the patch to the checked out fleet repository
- name: Apply patch to Fleet repository
run: |
cd fleet
git apply ../../description_failure.patch.txt
Run the workflow. You should see it fail, this is intended, because it means the new code is properly detecting an error in the import process.
Fleet version: all
💥 Actual behavior
The
vulnerabilitiesfeed build workflow is capable of pushing a release that panics Fleet server attempts to parse it (see #21239).🧑💻 Steps to reproduce
At first glance the above sounds like "switch back to a broken version and wow it's broken!" but the mitigation we're looking for here ensures that if we have issues in some other part of the JSON we're delivering we catch those issues as well and opt to fail out (and raise a P1 alert) rather than publishing what amounts to a poisoned vulns feed.
🛠️ To fix
We need to add a step in the workflow that basically does at least the inverse of what the vulnerability processing cron (or, more simply, the
vuln_processingcommand) does when thedisable_data_syncconfig value is set totrue: sync vulnerabilities without worrying about scanning against installed packages on hosts. Add that step after this one:https://github.com/fleetdm/vulnerabilities/blob/b17bd30c22abe6e23f01ae89b5162e8acfa8a990/.github/workflows/generate-cve.yml#L62-L66
and fail the build if the command returns nonzero.
In order to do this, we'll need to decide what's in-scope to integration test, and how to effectively mock the rest; my thought here is that we can place the files where the server would expect them rather than downloading over GitHub, and that will still catch the sorts of issues we're looking for. That's about as good as we can do without publishing releases.
/cc @sharon-fdm @getvictor
QA Steps
Add a step to install jq sqlite3 xz-utils
Add a step after
name: Build goval-dictionary and ensure destination dir existsstep to break the feed filesname: Build goval-dictionary and ensure destination dir existsto run the validationTesting with patch.
Right after the step that checks out the fleet repository
name: Checkout Repoadd a step that applies the patch to the checked out fleet repository