Skip to content

Improve SCA handling of bogus shlib dependencies #2109

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

Merged
merged 6 commits into from
Jul 30, 2025

Conversation

sergiodj
Copy link
Contributor

A few issues have either been introduced or uncovered by two recent melange SCA changes:

  • 6b78277: SCA: Generate "depends" for shlibs ending in ".so"

  • b3bba3c: Do not require .so files to be executable

melange is now processing more shared libraries and binaries when calculating the necessary dependencies of a package, and we're encountering weird cases. The root cause is almost always the same: some of our packages ship prebuilt binaries (ugh) for different systems/architectures. For example, grafana-image-renderer ships binaries compiled for Android. code-server ships binaries linked against musl. Ideally we should fix these packages and get rid of these bogus binaries, but it's hard to cover the whole archive and detect all these cases.

In order to unbreak some of the most common cases, I'd like to propose yet another heuristic for melange. Let's carry a list of libraries that are known to be bogus when they appear on NEEDED, so that we can ignore them during SCA. I realize that this is moving more policy inside the mechanism, and I'm not happy with it, but I talked to @jonjohnsonjr and @dannf and told them that I'd create a future roadmap item to proper move these lists out of our source code and into configuration files.

sergiodj added 3 commits July 29, 2025 22:17
Signed-off-by: Sergio Durigan Junior <[email protected]>
Signed-off-by: Sergio Durigan Junior <[email protected]>
@sergiodj sergiodj marked this pull request as draft July 30, 2025 02:27
@sergiodj sergiodj linked an issue Jul 30, 2025 that may be closed by this pull request
jonjohnsonjr
jonjohnsonjr previously approved these changes Jul 30, 2025
@sergiodj sergiodj marked this pull request as ready for review July 30, 2025 18:31
@jonjohnsonjr
Copy link
Contributor

#2112 should unblock this

sergiodj and others added 3 commits July 30, 2025 15:03
Signed-off-by: Sergio Durigan Junior <[email protected]>
Some of the prebuilt binaries in our packages are compiled for
e.g. Android and other systems, and they should be skipped by SCA.

Signed-off-by: Sergio Durigan Junior <[email protected]>
This blocks us from updating melange if certain packages happen to have
detected vulns, which doesn't make sense, especially if updating a
package is blocked on a melange change.

Signed-off-by: Jon Johnson <[email protected]>
@sergiodj sergiodj merged commit ee43cbd into chainguard-dev:main Jul 30, 2025
103 of 105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

so:libc.so (no such package)
2 participants