8000 Conda ecosystem support (basic) by SimeonStoykovQC · Pull Request #4002 · anchore/syft · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Conda ecosystem support (basic) #4002

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

SimeonStoykovQC
Copy link
@SimeonStoykovQC SimeonStoykovQC commented Jun 12, 2025

Description

This PR introduces basic support for sbom generation of packages in conda environments.

Status Quo

Up until now, syft had limited capabilities in conda environments and relied on language-specific catalogers (e.g. python and go). This meant that it wouldn't detect packages such as zlib, even though the metadata needed is already accessible.

Scope

The scope of this PR is to provide a minimum-effort conda support with the metadata that is already available, until the syft/grype and conda ecosystems decide on a more comprehensive approach (see #932 and conda/ceps#63).

The known shortcomings of this implementation are:

  • PURLs are not included at all, since we cannot generate meaningful ones yet;
  • The CPEs are best-effort, as we derive them from the conda package name, which could be arbitrary even in the case of repackaging (for example, the helm package in conda is named kubernetes-helm, which won't match any existing helm CVEs);
  • Any statically linked transitive dependencies are not detected;
  • There will be duplicate sboms for packages that were already detected before.

Implementation

The implementation partially addresses #932.

Each installed package in a conda environment produces a JSON metadata file inside the conda-meta directory. It provides a name and a version, among other things, and we use that to construct a package list.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • I have added unit tests that cover changed behavior
  • I have tested my code in common scenarios and confirmed there are no regressions
  • I have added comments to my code, particularly in hard-to-understand sections

Signed-off-by: Simeon Stoykov <simeon.stoykov@quantco.com>
Signed-off-by: Simeon Stoykov <simeon.stoykov@quantco.com>
Signed-off-by: Simeon Stoykov <simeon.stoykov@quantco.com>
Signed-off-by: Simeon Stoykov <simeon.stoykov@quantco.com>
Signed-off-by: Simeon Stoykov <simeon.stoykov@quantco.com>
Signed-off-by: Simeon Stoykov <simeon.stoykov@quantco.com>
@xhochy
Copy link
xhochy commented Jun 17, 2025

Thank you, @SimeonStoykovQC! This already looks like a first sensible version that successfully produces found vulnerabilities in grype, nice. I'm only a conda expert, not a Go one and thus cannot provide more review of the code than LGTM.

Any statically linked transitive dependencies are not detected;

This is probably the same as in every other ecosystem. Neither do they detect it. The plan for the cond ecosystem is to follow what PyPI/Python did with PEP770: Include SBOMs in packages that ship statically linked packages.

For the PURLs: This will be addressed in the linked Conda Enhancement Proposal, and I know that @pavelzw is working on revamping this and getting it over the finish line. I guess this PR here should not be blocked by that, though.

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.

2 participants
0