Skip to content
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

improve Haskell stack.yaml and stack.yaml.lock cataloging #2454

Open
willmurphyscode opened this issue Dec 22, 2023 · 0 comments
Open

improve Haskell stack.yaml and stack.yaml.lock cataloging #2454

willmurphyscode opened this issue Dec 22, 2023 · 0 comments
Labels
enhancement New feature or request good-first-issue Good for newcomers

Comments

@willmurphyscode
Copy link
Contributor

What would you like to be added:

When syft parses stack.yaml or stack.yaml.lock files, it currently assumes everything was installed from a package manager, and doesn't know how to parse the entry that results when a package is installed directly from GitHub, for example.

Example stack.yaml:
https://github.com/EdsonACortese/postgrest/blob/aaa4fbc3703642cea2300715c5b2c7cb8266134a/stack.yaml#L31-L32

Example stack.yaml.lock:
https://github.com/EdsonACortese/postgrest/blob/aaa4fbc3703642cea2300715c5b2c7cb8266134a/stack.yaml.lock#L133-L144

Why is this needed:
Right now, syft doesn't know how to parse these entries, and skips them. In the case of stack.yaml.lock, it skips only the entry. In the case of stack.yaml, it fails to parse the entire file.

There's enough information to get a package name and maybe a version from these dependencies, so we should at least try to catalog them. Failing to parse the entire stack.yaml because of one unusual entry is probably a bug.

Additional context:

Previously, syft would panic when encountering such a stack.yaml.lock entry, but that was fixed in #2421. This was discovered while investigating that issue.

@willmurphyscode willmurphyscode added enhancement New feature or request good-first-issue Good for newcomers labels Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good-first-issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant