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

Purl Generation Alpine #1131

Closed
ThiefaineM opened this issue Mar 11, 2022 · 5 comments · Fixed by #1154
Closed

Purl Generation Alpine #1131

ThiefaineM opened this issue Mar 11, 2022 · 5 comments · Fixed by #1154

Comments

@ThiefaineM
Copy link

Describe the bug
The generated purl for alpine composants does not match the one use in OSSINDEX.

To Reproduce
Steps to reproduce the behavior:
1- Create a Docker with an alpine image such as postgres:12.0-alpine
2- Use Tern to generate a BOM in cycloneDx json format
3- Look at the purl generate: for example the one for libxml2

Expected behavior
It seems that for alpine the purl looks like "pkg:alpine/libxml2@2.9.9-r2" instead of "pkg:apk/alpine/libxml2@2.9.9-r2". Here the two result depending on the purl :
https://ossindex.sonatype.org/component/pkg:alpine/libxml2
https://ossindex.sonatype.org/component/pkg:apk/alpine/libxml2
It looks like that for alpine the package type should not be written

ThiefaineM pushed a commit to ThiefaineM/tern that referenced this issue Mar 21, 2022
The purl generation for apk packages was faulty.
For example the purl for alpine busybox was pkg:apk/alpine/busybox@1.31.1-r9
instead of pkg:apk/alpine/busybox@1.31.1-r9.
Here are the result in the OSSINDEX base with the two purls:
- https://ossindex.sonatype.org/component/pkg:apk/alpine/busybox@1.31.1-r9
- https://ossindex.sonatype.org/component/pkg:alpine/busybox@1.31.1-r9

Resolves: tern-tools#1131

Signed-off-by: Thiéfaine Mercier <thiefaine.mercier@avisto.com>
@ivanayov
Copy link
Contributor

Can I work on this?

@rnjudge
Copy link
Contributor

rnjudge commented Mar 21, 2022

@ivanayov I think @ThiefaineM already opened a PR with a fix for this.

ThiefaineM pushed a commit to ThiefaineM/tern that referenced this issue Mar 22, 2022
The purl generation for apk packages was faulty.
For example the purl for alpine busybox was
pkg:apk/alpine/busybox@1.31.1-r9
instead of pkg:apk/alpine/busybox@1.31.1-r9.

Resolves: tern-tools#1131

Signed-off-by: Thiéfaine Mercier <thiefaine.mercier@avisto.com>
@rnjudge
Copy link
Contributor

rnjudge commented Mar 25, 2022

@ThiefaineM Mentioned this in my PR, but it does not look like apk/alpine packages are actually defined in the purl spec so curious why ossindex has a preference, do you know?

@ThiefaineM
Copy link
Author

I do not have an idea on why they did it like this sorry.
Nevertheless by looking at the spec, I saw that Python packages (with others) should have their name is lowercase. But it is not the case as generated purl for Django is : "pkg:pip/Django@3.2.3"
Should I create an other issue specific to it ?

@rnjudge
Copy link
Contributor

rnjudge commented Mar 28, 2022

I do not have an idea on why they did it like this sorry. Nevertheless by looking at the spec, I saw that Python packages (with others) should have their name is lowercase. But it is not the case as generated purl for Django is : "pkg:pip/Django@3.2.3" Should I create an other issue specific to it ?

Yes, please. By the way, I opened an issue in the purl repository asking about the alpine/apk purl type entry. It would make me feel better to have a specified Alpine type in the purl spec before merging your PR but I'll see what they respond with. I'm not opposed to merging your PR if the purl maintainers seem agreeable with the current ossindex expectation.

rnjudge added a commit to rnjudge/tern that referenced this issue Apr 14, 2022
The purl generation for apk packages was faulty. For example the purl
for an alpine image busybox package was pkg:apk/alpine/busybox@1.31.1-r9
instead of the correct pkg:alpine/busybox@1.31.1-r9.

Note that "apk" type packages are not defined for purl yet,
specifically, but OSSINDEX uses the pkg:alpine[1] notation and purl has
purposely chosen not to use "apk" as an identifier due to a known
conflict with Android which also uses the term apk[2].

[1] https://ossindex.sonatype.org/component/pkg:alpine/busybox@1.31.1-r9
[2] package-url/purl-spec#159 (comment)

Resolves: tern-tools#1131

Signed-off-by: Thiéfaine Mercier <thiefaine.mercier@avisto.com>
Signed-off-by: Rose Judge <rjudge@vmware.com>
rnjudge added a commit that referenced this issue Apr 14, 2022
The purl generation for apk packages was faulty. For example the purl
for an alpine image busybox package was pkg:apk/alpine/busybox@1.31.1-r9
instead of the correct pkg:alpine/busybox@1.31.1-r9.

Note that "apk" type packages are not defined for purl yet,
specifically, but OSSINDEX uses the pkg:alpine[1] notation and purl has
purposely chosen not to use "apk" as an identifier due to a known
conflict with Android which also uses the term apk[2].

[1] https://ossindex.sonatype.org/component/pkg:alpine/busybox@1.31.1-r9
[2] package-url/purl-spec#159 (comment)

Resolves: #1131

Signed-off-by: Thiéfaine Mercier <thiefaine.mercier@avisto.com>
Signed-off-by: Rose Judge <rjudge@vmware.com>
alannaemmrie pushed a commit to alannaemmrie/tern that referenced this issue Apr 27, 2022
The purl generation for apk packages was faulty. For example the purl
for an alpine image busybox package was pkg:apk/alpine/busybox@1.31.1-r9
instead of the correct pkg:alpine/busybox@1.31.1-r9.

Note that "apk" type packages are not defined for purl yet,
specifically, but OSSINDEX uses the pkg:alpine[1] notation and purl has
purposely chosen not to use "apk" as an identifier due to a known
conflict with Android which also uses the term apk[2].

[1] https://ossindex.sonatype.org/component/pkg:alpine/busybox@1.31.1-r9
[2] package-url/purl-spec#159 (comment)

Resolves: tern-tools#1131

Signed-off-by: Thiéfaine Mercier <thiefaine.mercier@avisto.com>
Signed-off-by: Rose Judge <rjudge@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants