-
What did you do?Sent a scan result with What did you expect to happen?Non-running kernel packages should be excluded before the heavy CVE detection ( What happened instead?From my reading of the code, it appears that On my environment, with 5 kernel versions (18 packages), AnalysisAs far as I can tell, there are currently three places where kernel packages are filtered:
In the Steps to reproduce the behaviour
{
"Family": "ubuntu",
"Release": "16.04",
"RunningKernel": {
"Release": "4.4.0-1079-aws",
"Version": "4.4.0-1079.89"
},
"Packages": {
"linux-aws-headers-4.4.0-1070": { "Name": "linux-aws-headers-4.4.0-1070", "Version": "4.4.0-1070.80" },
"linux-aws-headers-4.4.0-1075": { "Name": "linux-aws-headers-4.4.0-1075", "Version": "4.4.0-1075.85" },
"linux-aws-headers-4.4.0-1079": { "Name": "linux-aws-headers-4.4.0-1079", "Version": "4.4.0-1079.89" },
"linux-aws-headers-4.4.0-1083": { "Name": "linux-aws-headers-4.4.0-1083", "Version": "4.4.0-1083.93" },
"linux-aws-headers-4.4.0-1090": { "Name": "linux-aws-headers-4.4.0-1090", "Version": "4.4.0-1090.101" },
"linux-headers-4.4.0-1070-aws": { "Name": "linux-headers-4.4.0-1070-aws", "Version": "4.4.0-1070.80" },
"linux-headers-4.4.0-1075-aws": { "Name": "linux-headers-4.4.0-1075-aws", "Version": "4.4.0-1075.85" },
"linux-headers-4.4.0-1079-aws": { "Name": "linux-headers-4.4.0-1079-aws", "Version": "4.4.0-1079.89" },
"linux-headers-4.4.0-1083-aws": { "Name": "linux-headers-4.4.0-1083-aws", "Version": "4.4.0-1083.93" },
"linux-headers-4.4.0-1090-aws": { "Name": "linux-headers-4.4.0-1090-aws", "Version": "4.4.0-1090.101" },
"linux-image-4.4.0-1070-aws": { "Name": "linux-image-4.4.0-1070-aws", "Version": "4.4.0-1070.80" },
"linux-image-4.4.0-1075-aws": { "Name": "linux-image-4.4.0-1075-aws", "Version": "4.4.0-1075.85" },
"linux-image-4.4.0-1079-aws": { "Name": "linux-image-4.4.0-1079-aws", "Version": "4.4.0-1079.89" },
"linux-image-4.4.0-1083-aws": { "Name": "linux-image-4.4.0-1083-aws", "Version": "4.4.0-1083.93" },
"linux-image-4.4.0-1090-aws": { "Name": "linux-image-4.4.0-1090-aws", "Version": "4.4.0-1090.101" },
"linux-modules-4.4.0-1079-aws": { "Name": "linux-modules-4.4.0-1079-aws", "Version": "4.4.0-1079.89" },
"linux-modules-4.4.0-1083-aws": { "Name": "linux-modules-4.4.0-1083-aws", "Version": "4.4.0-1083.93" },
"linux-modules-4.4.0-1090-aws": { "Name": "linux-modules-4.4.0-1090-aws", "Version": "4.4.0-1090.101" }
},
"SrcPackages": {
"linux-aws-4.4.0-1070.80": {
"Name": "linux-aws", "Version": "4.4.0-1070.80",
"BinaryNames": ["linux-aws-headers-4.4.0-1070", "linux-headers-4.4.0-1070-aws", "linux-image-4.4.0-1070-aws"]
},
"linux-aws-4.4.0-1075.85": {
"Name": "linux-aws", "Version": "4.4.0-1075.85",
"BinaryNames": ["linux-aws-headers-4.4.0-1075", "linux-headers-4.4.0-1075-aws", "linux-image-4.4.0-1075-aws"]
},
"linux-aws-4.4.0-1079.89": {
"Name": "linux-aws", "Version": "4.4.0-1079.89",
"BinaryNames": ["linux-aws-headers-4.4.0-1079", "linux-headers-4.4.0-1079-aws", "linux-image-4.4.0-1079-aws", "linux-modules-4.4.0-1079-aws"]
},
"linux-aws-4.4.0-1083.93": {
"Name": "linux-aws", "Version": "4.4.0-1083.93",
"BinaryNames": ["linux-aws-headers-4.4.0-1083", "linux-headers-4.4.0-1083-aws", "linux-image-4.4.0-1083-aws", "linux-modules-4.4.0-1083-aws"]
},
"linux-aws-4.4.0-1090.101": {
"Name": "linux-aws", "Version": "4.4.0-1090.101",
"BinaryNames": ["linux-aws-headers-4.4.0-1090", "linux-headers-4.4.0-1090-aws", "linux-image-4.4.0-1090-aws", "linux-modules-4.4.0-1090-aws"]
}
}
}
# Start vuls server
vuls server -listen localhost:5515
# application/json (all kernel packages sent to ospkg.Detect)
time curl -X POST -H "Content-Type: application/json" -d @repro.json http://localhost:5515/vuls > /dev/null
# text/plain (non-running kernel packages filtered before ospkg.Detect)
time curl -X POST \
-H "Content-Type: text/plain" \
-H "X-Vuls-OS-Family: ubuntu" \
-H "X-Vuls-OS-Release: 16.04" \
-H "X-Vuls-Kernel-Release: 4.4.0-1079-aws" \
--data-binary "$(cat <<'EOF'
linux-aws-headers-4.4.0-1070,ii ,4.4.0-1070.80,linux-aws,4.4.0-1070.80
linux-aws-headers-4.4.0-1075,ii ,4.4.0-1075.85,linux-aws,4.4.0-1075.85
linux-aws-headers-4.4.0-1079,ii ,4.4.0-1079.89,linux-aws,4.4.0-1079.89
linux-aws-headers-4.4.0-1083,ii ,4.4.0-1083.93,linux-aws,4.4.0-1083.93
linux-aws-headers-4.4.0-1090,ii ,4.4.0-1090.101,linux-aws,4.4.0-1090.101
linux-headers-4.4.0-1070-aws,ii ,4.4.0-1070.80,linux-aws,4.4.0-1070.80
linux-headers-4.4.0-1075-aws,ii ,4.4.0-1075.85,linux-aws,4.4.0-1075.85
linux-headers-4.4.0-1079-aws,ii ,4.4.0-1079.89,linux-aws,4.4.0-1079.89
linux-headers-4.4.0-1083-aws,ii ,4.4.0-1083.93,linux-aws,4.4.0-1083.93
linux-headers-4.4.0-1090-aws,ii ,4.4.0-1090.101,linux-aws,4.4.0-1090.101
linux-image-4.4.0-1070-aws,ii ,4.4.0-1070.80,linux-aws,4.4.0-1070.80
linux-image-4.4.0-1075-aws,ii ,4.4.0-1075.85,linux-aws,4.4.0-1075.85
linux-image-4.4.0-1079-aws,ii ,4.4.0-1079.89,linux-aws,4.4.0-1079.89
linux-image-4.4.0-1083-aws,ii ,4.4.0-1083.93,linux-aws,4.4.0-1083.93
linux-image-4.4.0-1090-aws,ii ,4.4.0-1090.101,linux-aws,4.4.0-1090.101
linux-modules-4.4.0-1079-aws,ii ,4.4.0-1079.89,linux-aws,4.4.0-1079.89
linux-modules-4.4.0-1083-aws,ii ,4.4.0-1083.93,linux-aws,4.4.0-1083.93
linux-modules-4.4.0-1090-aws,ii ,4.4.0-1090.101,linux-aws,4.4.0-1090.101
EOF
)" http://localhost:5515/vuls > /dev/nullThe detection results should be equivalent, but Question for maintainersI'd like to understand the project's intended approach for this case:
I'm leaning toward (1) since it aligns with the original gost design and keeps the two content types consistent, but I may be missing context on the design intent. I'd like to follow whichever approach best fits the project's direction. Configuration
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
With the following files, I consistently see a 7-10x difference on my local environment and even more on production: # application/json
time curl -X POST -H "Content-Type: application/json" -d @repro-178pkgs.json http://localhost:5515/vuls > /dev/null
# text/plain
time curl -X POST \
-H "Content-Type: text/plain" \
-H "X-Vuls-OS-Family: ubuntu" \
-H "X-Vuls-OS-Release: 16.04" \
-H "X-Vuls-Kernel-Release: 4.4.0-1079-aws" \
--data-binary @repro-178pkgs.txt \
http://localhost:5515/vuls > /dev/null |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the detailed analysis and reproduction steps. The application/json endpoint is designed to receive JSON generated by vuls scan. In that workflow, non-running kernel packages are already filtered out during the scan phase by parseInstalledPackages() The JSON in your reproduction was crafted externally and differs from what vuls produces in two ways:
Regarding the suggestion to add kernel filtering in preConvert: we do not plan to do this. Ideally, vulnerabilities should be detected for all installed kernel packages regardless of whether they are If you are sending JSON from an external tool, please ensure it matches the format that vuls scan produces. |
Beta Was this translation helpful? Give feedback.
Thank you for the detailed analysis and reproduction steps.
The application/json endpoint is designed to receive JSON generated by vuls scan. In that workflow, non-running kernel packages are already filtered out during the scan phase by parseInstalledPackages()
(e.g., scanner/debian.go#L429-L484), so the performance issue you observed does not occur in the normal usage path.
The JSON in your reproduction was crafted externally and differs from what vuls produces in two ways: