mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 13:37:30 +00:00
Updated ingestion/CVE logic to support Jetbrains software with 2 version numbers (#42003)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or remove if NA --> **Related issue:** Resolves #37323 # Checklist for submitter If some of the following don't apply, delete the relevant line. - [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/guides/committing-changes.md#changes-files) for more information. ## Testing - [x] Added/updated automated tests - [x] QA'd all new/changed functionality manually <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved JetBrains software version detection to support the newer two-part version format (e.g., WebStorm 2025.1). * Enhanced CVE/vulnerability tracking accuracy for JetBrains products with updated version number parsing. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
6cc2836c20
commit
8dfdb94885
3 changed files with 14 additions and 3 deletions
1
changes/37323-jetbrains-cve
Normal file
1
changes/37323-jetbrains-cve
Normal file
|
|
@ -0,0 +1 @@
|
|||
* Updated ingestion/CVE logic to support JetBrains software with 2 version numbers, like WebStorm 2025.1
|
||||
|
|
@ -2158,9 +2158,9 @@ func directIngestSoftware(ctx context.Context, logger *slog.Logger, host *fleet.
|
|||
var (
|
||||
dcvVersionFormat = regexp.MustCompile(`^(\d+\.\d+)\s*\(r(\d+)\)$`)
|
||||
tunnelblickVersionFormat = regexp.MustCompile(`^(.+?)\s*\(build\s+\d+\)$`)
|
||||
// jetbrainsNameVersion extracts version from JetBrains product names like "GoLand 2025.3.3"
|
||||
// or "IntelliJ IDEA 2025.3.1.1" (supports 3 or 4 part versions)
|
||||
jetbrainsNameVersion = regexp.MustCompile(`\s(\d{4}\.\d+\.\d+(?:\.\d+)?)$`)
|
||||
// jetbrainsNameVersion extracts version from JetBrains product names like "WebStorm 2025.1",
|
||||
// "GoLand 2025.3.3", or "IntelliJ IDEA 2025.3.1.1" (supports 2, 3, or 4 part versions)
|
||||
jetbrainsNameVersion = regexp.MustCompile(`\s(\d{4}\.\d+(?:\.\d+){0,2})$`)
|
||||
basicAppSanitizers = []struct {
|
||||
matchBundleIdentifier string
|
||||
matchName string
|
||||
|
|
|
|||
|
|
@ -143,6 +143,16 @@ func TestSoftwareIngestionMutations(t *testing.T) {
|
|||
MutateSoftwareOnIngestion(t.Context(), jetbrainsGoLand, slog.New(slog.DiscardHandler))
|
||||
assert.Equal(t, "2025.3.3", jetbrainsGoLand.Version)
|
||||
|
||||
// Test JetBrains with 2-part year.minor version (like "WebStorm 2025.1")
|
||||
jetbrainsWebStorm := &fleet.Software{
|
||||
Name: "WebStorm 2025.1",
|
||||
Source: "programs",
|
||||
Vendor: "JetBrains s.r.o.",
|
||||
Version: "251.23774.424",
|
||||
}
|
||||
MutateSoftwareOnIngestion(t.Context(), jetbrainsWebStorm, slog.New(slog.DiscardHandler))
|
||||
assert.Equal(t, "2025.1", jetbrainsWebStorm.Version)
|
||||
|
||||
// Test JetBrains with 4-part version number
|
||||
jetbrainsIntelliJ := &fleet.Software{
|
||||
Name: "IntelliJ IDEA 2025.3.1.1",
|
||||
|
|
|
|||
Loading…
Reference in a new issue