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

fix: add missing javascript-lock-cataloger in docker image catalogers #1022

Closed
wants to merge 1 commit into from

Conversation

patrikbeno
Copy link
Contributor

@patrikbeno patrikbeno commented Jun 1, 2022

example use case:

  • build react app
  • static content is generated in build/ folder
  • add yarn.lock or package-lock.json into build/ folder to enable dependency analysis on image
  • node_modules is dev-only, and intentionally not included in image

without javascript-lock-cataloger, syft ignores this layout, and depedencies are not recognized.

I am not aware of other valid aproach to support this layout.

Also:

syft build/ properly detects lock file and dependencies in buid/ folder

but if the same build/ folder is just copied to docker image, syft $myimage behaves differently (ignores lock file and fails to populate dependencies)

Signed-off-by: Patrik Beno <patrik.beno@greenhorn.sk>
@patrikbeno
Copy link
Contributor Author

#1029 provides more generic approach but requires additional step in CI/build:

syft yarn.lock -o cyclonedx-json > build/sbom.json

@sambhav
Copy link
Contributor

sambhav commented Jun 5, 2022

I believe #843 might solve this as well.

@spiffcs
Copy link
Contributor

spiffcs commented Jun 21, 2022

👋 Thanks for the contribution @patrikbeno!

With #1038 merged in the next release of syft should give you more flexibility in controlling which catalogers run as part of the configuration. I do admit it requires a bit more steps in the CI/Build, but let us know if we can improve the configuration at all on the next release in an issue.

We'll work with you to get syft updated in a way that lets you use the JavascriptLockCataloger cataloger as part of your workflows with syft.

Closing this for now, but please feel free to reach out to me if you have questions or more ideas on how we can update the cataloger configuration for you!

@spiffcs spiffcs closed this Jun 21, 2022
@spiffcs spiffcs self-assigned this Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants