-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(gobinary): incorrect ldflags parsing when version
part has prefix
#6702
bug(gobinary): incorrect ldflags parsing when version
part has prefix
#6702
Comments
#6705 addresses the case of ArgoCD, but a bigger problem is the inconsistent result. In the following case, we will face the same problem.
What if we collect all versions and select one of them deterministically? Or return an error, like |
I think this is bad idea. I think it's not their own binaries that users are scanning, so they can't update ldflags.
I didn't find many binaries using I suggest the following order |
First of all, the scan does not fail because analyzer errors are always converted into warnings. Next, when I said return error, I meant leave the version empty, rather than select a version that could be wrong on our end.
How do they embed versions without using ldflags? |
Sorry, my brain isn't working well today. I checked installed in my PC binaries which were installed using
Got it. Then this solution looks good. It also looks like we need to parse URL.
It looks like you are right and best solution is to skip version for binaries with more than one |
As you suggested, it may be a good idea to increase the priority if |
Just to confirm that I understood you correctly:
|
In any case, it is a heuristic, so it is simply how we define it. If there is more than one matching version in the same category (1, 2, 3 as you described), make the version empty. And in order of priority from the top.
graph TD
A{Number of versions matching 1} -->|0| B{Number of versions matching 2}
A -->|1| C[Adopt that version]
A -->|2+| D[Empty]
B -->|0| E{Number of versions matching 3}
B -->|1| F[Adopt that version]
B -->|2+| G[Empty]
E -->|0| H[Empty]
E -->|1| I[Adopt that version]
E -->|2+| J[Empty]
Since there is only one version matching the category 1, we take
same as above. |
Actually, all categories must start with the module name and end with
|
Description
Trivy detects different versions of Gobinary modules during multiple scans.
This happens when gobinari uses 2 ldflags with the suffix versions.
e.g.:
Discussed in #6669
The text was updated successfully, but these errors were encountered: