-
Notifications
You must be signed in to change notification settings - Fork 23
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
Enhance Alpine package scan results #307
Comments
fix #191 Signed-off-by: Mateusz Perc <m.perc@samsung.com>
@pombredanne should I PR it? |
@quepop please do! that's much easier for review
|
@pombredanne I don't think there is any other way. In order to extract source variable value (or any other value) we need to run the script (APKBUILD file), because in some of the alpine packages, source variable is built in a for loop (not to mention that sometimes bash string formatting is used). From _arch_keys="
aarch64:alpine-devel@lists.alpinelinux.org-58199dcc.rsa.pub
armhf:alpine-devel@lists.alpinelinux.org-524d27bb.rsa.pub
x86:alpine-devel@lists.alpinelinux.org-5243ef4b.rsa.pub
x86,x86_64:alpine-devel@lists.alpinelinux.org-4a6a0840.rsa.pub
x86_64:alpine-devel@lists.alpinelinux.org-5261cecb.rsa.pub
ppc64le:alpine-devel@lists.alpinelinux.org-58cbb476.rsa.pub
s390x:alpine-devel@lists.alpinelinux.org-58e4f17d.rsa.pub
mips64:alpine-devel@lists.alpinelinux.org-5e69ca50.rsa.pub
"
for _i in $_arch_keys; do
source="$source ${_i#*:}"
done |
@quepop good point, but do we need these (e.g. these |
@pombredanne We need the source variable to be complete (to be able to download sources and scan them for copyrights). I tried to emphasize (by giving an example) that the only way we get a complete source variable every time is by running the script. |
@pombredanne Regarding aboutcode-org/scancode-toolkit#2541 (comment), how should I name these new files (pipe, pipeline)? My idea is |
@quepop There's already a |
@tdruez In the case of multi-image projects we cannot match My solution is to add a new database field to the |
@quepop what about adding the |
Repasting from quepop/scancode.io@2f59440#r52902214 for reference : I have been thinking more about this for nexB#191 and sourcing arbitrary bash script this way is too much of a security concern. An alternative could include:
I think 2. is best and much less involved than having a container depdendency. Therefore I am implementing this that can then be reused here:
|
👍 ... this is being added too to SCTK FWIW |
@pombredanne sounds great but what about APKBUILDs like these: #307? Will it work? |
Signed-off-by: Thomas Druez <tdruez@nexb.com>
Signed-off-by: Thomas Druez <tdruez@nexb.com>
@quepop |
There is another issue that i found looking at my database. Some alpine images like |
@quepop not sure what to do wrt. subpackages... can you provide a concrete example with links and may sample APKBUILD snippets? |
re:
Actually the new approach in https://github.com/nexB/scancode-toolkit/blob/b7d070fc788f4c233df1f31d735e1ac5b3aa2d29/src/packagedcode/alpine.py#L144 could be enhanced to also collect these.
Then merge subpackages variables with the base variables. This way declared licensed, description and other sub-package-specific metadata could be collected. Note that this would work whereas the approach to just eval the APKBUILD with bash would not be able to collect variables defined inside a function, as this would require to run the function, which is impractical since the function names are not known (unless parsed ...) . |
See aboutcode-org/scancode.io#272 (comment) The feature will be implemented instead in PurlDB ... |
Moving this to PurlDB |
Alpine packages lack some important info like copyrights or where the source code is located. This info can't be gathered from the packages themselves as its just not there. To get this info we need to:
download aports repo & for each pkg check it out on commit specific to alpine package (via fetchcode)
parse APKBUILD aboutcode-org/scancode-toolkit#2541
download package sources (fetchcode) & amend new info to package's scan results
Discussed a bit with @pombredanne
Most likely @quepop will PR it
The question is- should it be standard behavior when alpine based docker is being scanned or should it be a separate pipeline?
The text was updated successfully, but these errors were encountered: