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

Add support for java "nar" files #1701

Closed
ZENinjaneer opened this issue Mar 29, 2023 · 5 comments · Fixed by #1727
Closed

Add support for java "nar" files #1701

ZENinjaneer opened this issue Mar 29, 2023 · 5 comments · Fixed by #1727
Labels
good-first-issue Good for newcomers

Comments

@ZENinjaneer
Copy link

case "jar", "war", "ear", "lpkg", "par", "sar":

could you please add "nar" to this case statement so it can support grype scanning NiFi nars?

@wagoodman
Copy link
Contributor

curious! is a nar just a jar? That is, is it the same metadata (like with war, ear, etc) just with a different name? Or is there more metadata to parse?

@ZENinjaneer
Copy link
Author

A nar is basically a shaded jar. It's very similar to a WAR but instead of a WEB-INF the root is META-INF (like in a JAR). Under the META-INF there are other text files that essentially have to do with licensing. A short and sweet overview can be found here: https://medium.com/hashmapinc/nifi-nar-files-explained-14113f7796fd

@tgerla tgerla added the good-first-issue Good for newcomers label Apr 6, 2023
@tgerla
Copy link
Contributor

tgerla commented Apr 6, 2023

Thanks for the details! I think this would be a reasonable addition to the list of archive filenames. We will add this to our backlog but please let us know if you want to submit a pull request yourself--we can help you through the process if you need.

We think the only things that need to change are a new glob for .nar files here:

var archiveFormatGlobs = []string{

And in the list here:

case "jar", "war", "ear", "lpkg", "par", "sar":

@shanedell
Copy link
Contributor

@tgerla Could I tackle this? If @ZENinjaneer doesn't plan to of course

@wagoodman
Copy link
Contributor

@shanedell have at it!

shanedell added a commit to shanedell/syft that referenced this issue Apr 10, 2023
- Update README.md to show that nar is now supported.
- Created a java-archives/example.nar so that the tests wouldn't break.
- Add nar glob and as an option for pkgType.

Closes anchore#1701
shanedell added a commit to shanedell/syft that referenced this issue Apr 10, 2023
- Update README.md to show that nar is now supported.
- Created a java-archives/example.nar so that the tests wouldn't break.
- Add nar glob and as an option for pkgType.

Closes anchore#1701

Signed-off-by: Shane Dell <shanedell100@gmail.com>
@wagoodman wagoodman changed the title Support for nars? Add support for java "nar" files Apr 11, 2023
wagoodman pushed a commit that referenced this issue Apr 11, 2023
- Update README.md to show that nar is now supported.
- Created a java-archives/example.nar so that the tests wouldn't break.
- Add nar glob and as an option for pkgType.

Closes #1701

Signed-off-by: Shane Dell <shanedell100@gmail.com>
GijsCalis pushed a commit to GijsCalis/syft that referenced this issue Feb 19, 2024
- Update README.md to show that nar is now supported.
- Created a java-archives/example.nar so that the tests wouldn't break.
- Add nar glob and as an option for pkgType.

Closes anchore#1701

Signed-off-by: Shane Dell <shanedell100@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants