fleet/articles/vulnerability-processing.md

85 lines
9.6 KiB
Markdown
Raw Normal View History

# Vulnerability processing
Vulnerability processing in Fleet detects vulnerabilities (CVEs) for the software installed on your hosts.
To see what software is covered, check out the [Coverage section](#coverage).
[Learn more](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/architecture/software/vulnerability-processing.md) about how it works for different platforms.
<div purpose="embedded-content">
<iframe src="https://www.youtube.com/embed/amJFecMWyvI" allowfullscreen></iframe>
</div>
## Coverage
Fleet detects vulnerabilities for these software types:
| Type | macOS | Windows | Linux |
| ------------------- | ------------------------------------------ | ------------------------------------------------ |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Apps | ✅ | ✅ | On Linux, apps are installed as packages (there is no separate app format like `.app` on macOS). See the Packages row for coverage details. |
| Operating system (OS) | ✅ | ✅ | ✅ <p>Linux OS vulnerabilites are the kernel vulnerabilities. Currently, Ubuntu, Debian, CentOS, Fedora, and Amazon Linux are supported.</p> |
| Browser plugins | Chrome extensions, Firefox extensions | Chrome extensions, Firefox extensions | ❌ |
| Packages | Python, Homebrew, npm | Python, Atom, Chocolatey, npm | ✅ <p>For Ubuntu, RHEL, and CentOS: packages defined in the [OVAL definitions](https://github.com/fleetdm/nvd/blob/master/oval_sources.json), except for vulnerabilities involving configuration files</p><p>For Fedora (up to Fedora 40, released June 2024), packages defined in RHEL OVAL definitions [mapped by version](https://github.com/fleetdm/fleet/blob/main/server/vulnerabilities/oval/parsed/utils.go).</p><p><p>For Amazon Linux, packages maintained by Amazon by checking [ALAS advisories](https://alas.aws.amazon.com/).</p> |
| IDE extensions | VS Code, [VS Code forks](https://fleetdm.com/tables/vscode_extensions) (i.e. Cursor), and [JetBrains IDEs](https://fleetdm.com/tables/jetbrains_plugins) (i.e. IntelliJ IDEA) | VS Code, [VS Code forks](https://fleetdm.com/tables/vscode_extensions) (i.e. Cursor), and [JetBrains IDEs](https://fleetdm.com/tables/jetbrains_plugins) (i.e. IntelliJ IDEA) | VS Code, [VS Code forks](https://fleetdm.com/tables/vscode_extensions) (i.e. Cursor), and [JetBrains IDEs](https://fleetdm.com/tables/jetbrains_plugins) (i.e. IntelliJ IDEA) |
Linux kernel vulnerabilities with known variants (ie. `-generic` or `kernel`) are detected using OVAL. Custom kernels (unknown variants) are detected using NVD.
Currently, only software names with all ASCII characters are supported. Vulnerabilities won't be detected for software with names featuring non-ASCII characters, such as Cyrillic, or software that has been renamed from its default name (e.g. "Chrome 2" instead of "Google Chrome"). For some software, Fleet uses [custom rules](https://github.com/fleetdm/fleet/blob/main/server/vulnerabilities/nvd/cpe_translations.json) to mitigate these issues on an app-by-app basis.
For Ubuntu Linux, kernel vulnerabilities with known variants (ie. `-generic`) are detected using OVAL. Custom kernels (unknown variants) are detected using NVD.
Vulnerabilities that only impact software on specific operating systems may not be properly identified. Fleet does not take the hosts' operating system into account; CPEs are matched in isolation, only examining the software version.
Vulnerabilities that only impact specific software configurations are still reported. For example, Fleet will mark the [curl Homebrew package](https://formulae.brew.sh/formula/curl) with [CVE-2023-28320](https://nvd.nist.gov/vuln/detail/CVE-2023-28320) even if curl is not forced to use synchronous resolvers.
If you find that Fleet is incorrectly marking software as vulnerable (false positive) or missing a vulnerability (false negative), please file a [bug](https://github.com/fleetdm/fleet/issues/new?template=bug-report.md).
> **Note:** When false positives are fixed, it may take two hours for the false positives to disappear after upgrading Fleet. You can speed up this cleanup by running the vulnerabilities job manually.
## Sources
Fleet combines multiple sources to get accurate and up-to-date CVE information:
Include non-primary CVSS scores from NVD when a primary score doesn'texist for a given CVSS version (#29199) Fixes #28261. ~~Of note, this logic will prefer a non-primary CVSSv3.1 score over a primary CVSSv3.0 score if 3.1 doesn't have primary but 3.0 does. I haven't seen any evidence of this in our dataset (looked at 2024 output).~~ Updated with logic that will prefer a primary CVSSv3.0 score over a secondary CVSSv3.1 score for a given vulnerability. In the test dataset (2023 vuln snapshot, ~20k vulns) there were no cases where this situation presented itself, so output was identical to the prior implementation. Validated by comparing a vulns run from GitHub Actions to a local run with the new code, and confirmed that existing v3 scores weren't replaced when they already existed (just got adds of v2 when only v3 existed, and v2/v3 adds when no scoring existed). Confirmed that all three CVEs mentioned in #28261 show up in feed data. Added spot-checks for secondary CVSS scores to the feed validator tool. # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [x] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [x] Manual QA for all new/changed functionality
2025-05-29 18:03:19 +00:00
- [National Vulnerability Database](https://nvd.nist.gov/developers/vulnerabilities) CVE feeds
- [VulnCheck](https://vulncheck.com/) Enriched NVD CPE data
- [Mac Office release notes](https://learn.microsoft.com/en-us/officeupdates/release-notes-office-for-mac) Office for Mac vulnerabilities
- [Microsoft MSRC Security Bulletins](https://msrc.microsoft.com/update-guide) for Windows OS vulnerabilities
- [OVAL definitions](https://github.com/fleetdm/nvd/blob/master/oval_sources.json) for Linux software
> **Note:** Fleet Premium includes CVSSv3 scores from NVD CVE feeds. Primary scores are preferred to Secondary scores if both are available, and v3.1 scores of the same type are preferred to v3.0.
Include non-primary CVSS scores from NVD when a primary score doesn'texist for a given CVSS version (#29199) Fixes #28261. ~~Of note, this logic will prefer a non-primary CVSSv3.1 score over a primary CVSSv3.0 score if 3.1 doesn't have primary but 3.0 does. I haven't seen any evidence of this in our dataset (looked at 2024 output).~~ Updated with logic that will prefer a primary CVSSv3.0 score over a secondary CVSSv3.1 score for a given vulnerability. In the test dataset (2023 vuln snapshot, ~20k vulns) there were no cases where this situation presented itself, so output was identical to the prior implementation. Validated by comparing a vulns run from GitHub Actions to a local run with the new code, and confirmed that existing v3 scores weren't replaced when they already existed (just got adds of v2 when only v3 existed, and v2/v3 adds when no scoring existed). Confirmed that all three CVEs mentioned in #28261 show up in feed data. Added spot-checks for secondary CVSS scores to the feed validator tool. # Checklist for submitter If some of the following don't apply, delete the relevant line. <!-- Note that API documentation changes are now addressed by the product design team. --> - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. See [Changes files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/Committing-Changes.md#changes-files) for more information. - [x] Input data is properly validated, `SELECT *` is avoided, SQL injection is prevented (using placeholders for values in statements) - [x] Manual QA for all new/changed functionality
2025-05-29 18:03:19 +00:00
## Advanced configuration
Fleet runs vulnerability downloading and processing via an internal scheduled cron job. This internal mechanism is useful for frictionless deployments and is well-suited for most use cases. However, it is desirable to manage vulnerability processing externally in larger deployments where there can be dozens of Fleet server replicas sitting behind a load balancer.
The reasons for this are as follows:
- Lower resource requirements across the entire Fleet server deployment (as vulnerability processing requires considerably more resources than just running the Fleet server alone)
- More control over scheduling constraints (only process during windows of low utilization, etc.)
It is possible to limit vulnerability processing to a single [dedicated host](https://fleetdm.com/docs/deploying/configuration#current-instance-checks), by setting `disable_schedule` to `true`, but still running one Fleet server as `false`, but the drawback here is still having to dedicate resources for this single host 24/7. The Fleet binary has a command that handles the same vulnerability processing, but will exit (successfully with 0) on completion. Using this sub-command, we can delegate vulnerability processing to external systems such as:
- [ECS](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/scheduling_tasks.html)
- [K8S](https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/)
- [GCP](https://cloud.google.com/run/docs/triggering/using-scheduler#create_job)
- [Plain old cron](https://en.wikipedia.org/wiki/Cron)
To opt into this functionality, be sure to configure your Fleet server deployment with
```bash
FLEET_VULNERABILITIES_DISABLE_SCHEDULE=true
```
This will **disable** the internal scheduling mechanism for vulnerability processing. You can still trigger an ad-hoc vulnerability scan using `fleetctl trigger --name=vulnerabilities`. The dedicated vulnerability processing server will pick up the request within 60 seconds.
Then externally run vulnerability processing with the same environment variables/configuration files passed to the server command:
```text
fleet vuln_processing
```
<meta name="category" value="guides">
<meta name="authorGitHubUsername" value="noahtalerman">
<meta name="authorFullName" value="Noah Talerman">
<meta name="publishedOn" value="2024-07-12">
<meta name="articleTitle" value="Vulnerability processing">
<meta name="description" value="Find out how Fleet detects vulnerabilities and what software it covers.">