Updated translation rules so that Docker Desktop can be mapped to the proper CPE (#10326)

Updated translation rules so that Docker Desktop can be mapped to the proper CPE.
This commit is contained in:
Juan Fernandez 2023-03-09 17:46:57 -04:00 committed by GitHub
parent f457b8cd33
commit 56ed2727b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 54 additions and 0 deletions

View file

@ -0,0 +1 @@
Updated translation rules so that Docker Desktop can be mapped to the correct CPE.

View file

@ -1141,6 +1141,38 @@ func TestCPEFromSoftwareIntegration(t *testing.T) {
BundleIdentifier: "com.microsoft.Excel",
}, cpe: "",
},
{
software: fleet.Software{
Name: "Docker.app",
Source: "apps",
Version: "4.7.1",
BundleIdentifier: "com.docker.docker",
}, cpe: "cpe:2.3:a:docker:docker_desktop:4.7.1:*:*:*:*:macos:*:*",
},
{
software: fleet.Software{
Name: "Docker Desktop.app",
Source: "apps",
Version: "4.16.2",
BundleIdentifier: "com.electron.dockerdesktop",
}, cpe: "cpe:2.3:a:docker:docker_desktop:4.16.2:*:*:*:*:macos:*:*",
},
{
software: fleet.Software{
Name: "Docker Desktop.app",
Source: "apps",
Version: "3.5.0",
BundleIdentifier: "com.electron.docker-frontend",
}, cpe: "cpe:2.3:a:docker:docker_desktop:3.5.0:*:*:*:*:macos:*:*",
},
// 2023-03-06: there are no entries for the docker python package at the NVD dataset.
{
software: fleet.Software{
Name: "docker",
Source: "python_packages",
Version: "6.0.1",
}, cpe: "",
},
}
tempDir := t.TempDir()

View file

@ -79,5 +79,26 @@
"filter": {
"skip": true
}
},
{
"software": {
"bundle_identifier": [
"/(?i)(com\\.docker\\.docker|com\\.electron\\.dockerdesktop|com\\.electron\\.docker-frontend)/"
],
"source": ["apps"]
},
"filter": {
"product": ["docker_desktop"],
"vendor": ["docker"]
}
},
{
"software": {
"name": ["docker"],
"source": ["python_packages"]
},
"filter": {
"skip": true
}
}
]