Add support for scanning IPK packages using the deb-archive-cataloger - #5111
Add support for scanning IPK packages using the deb-archive-cataloger#5111skyhisi wants to merge 1 commit into
Conversation
0c2686c to
20582cf
Compare
spiffcs
left a comment
There was a problem hiding this comment.
👋 Thanks for the PR @skyhisi. I think I have some questions before we move foward.
Does this update do what is actually suggests in the PR?
Can you add some tests or show some steps that demonstrate syft working correctly with files that match the*.ipk glob?
Can the .ipk come as a gzipped tar like in this example and does syft handle this correctly with this change?
$ curl -sLO https://downloads.openwrt.org/releases/23.05.5/packages/mips_24kc/base/6in4_28_all.ipk
$ file 6in4_28_all.ipk → gzip compressed data
I don't think our current AR implementation would play nice with a match that comes as gzipped and might produce no package results as well as superfluous unknown entries.
I think we might need more complex handling of the compression for the different cases utilizing mholt/archives: see the original PR for context #3704
For this PR to move forward:
- I think we need to do a bit more inquiry into the different compression formats
*.ipkcould come in, handling of those, and tests added showing that handling - Glob tests added
- We probably want the team to chime in here as well to see if there are any other considerations for syft's surface area on if the opkg package manager should be lumped under the deb archive cataloger like this, or if it deserves a spot carved out on it's own or mentioned in some way.
|
@spiffcs Thanks for taking an initial look at this PR, I didn't realise the OpenWrt version of IPK used a gzip outer container, I'm using it with packages built by Yocto which follows the Debian format of having an outer AR file containing compressed tar files, which it works fine with. I can look into adding some tests for the globbing, but from using it, it works fine. I haven't tried it with OpenWrt packages and given that the OpenWrt project has moved to using APK (Alpine format) packages, I'm not sure if it's worth the syft project supporting the deprecated IPK format? Maybe it'd be enough if it skipped them? |
|
I've updated the PR with some unit tests now. |
Signed-off-by: Silas Parker <silas@srp.me.uk>
Description
IPK packages are used by the opkg package manager, they have the same format as DEB packages, so the existing scanner can be used.
Type of change
Checklist
Issue references