-
Notifications
You must be signed in to change notification settings - Fork 571
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
Expand deb cataloger to include opkg #1985
Expand deb cataloger to include opkg #1985
Conversation
opkg uses the same or nearly the same metadata and structure as Debian: **/lib/opkg/status lists status information for all packages **/lib/opkg/info/opkg.conffiles is a list of configuration files **/lib/opkg/info/*.list contains files and directories installed by the package **/lib/opkg/info/*.preinst are scripts to run before installation **/lib/opkg/info/*.postinst are scripts to run after installation **/lib/opkg/info/*.postrm are scripts to run after package removal **/lib/opkg/info/*.control provides package metadata Signed-off-by: Nicholas R. Smith <[email protected]>
Signed-off-by: Nicholas R. Smith <[email protected]>
Signed-off-by: Nicholas R. Smith <[email protected]>
@johnDeSilencio thanks so much for the quick contribution - this is great and we'll be sure to get it tried out for the next release =) |
You're welcome! Thank you and @kzantow for being responsive and helping me work out the best way to go about creating this PR. Seems like you have a great team at Anchore 😃 Also, heads up that I posted a follow-up PR. I forgot to run |
* Add opkg info directory and status file to deb cataloger opkg uses the same or nearly the same metadata and structure as Debian: **/lib/opkg/status lists status information for all packages **/lib/opkg/info/opkg.conffiles is a list of configuration files **/lib/opkg/info/*.list contains files and directories installed by the package **/lib/opkg/info/*.preinst are scripts to run before installation **/lib/opkg/info/*.postinst are scripts to run after installation **/lib/opkg/info/*.postrm are scripts to run after package removal **/lib/opkg/info/*.control provides package metadata Signed-off-by: Nicholas R. Smith <[email protected]> --------- Signed-off-by: Nicholas R. Smith <[email protected]> Co-authored-by: Nicholas R. Smith <[email protected]>
What?
This PR expands on the Debian cataloger so that it also catalogs packages installed by
opkg
.Why?
#1847 documents the reasons that @spiffcs, myself, and others may have for wanting to be able to catalog packages installed with
opkg
usingsyft
. In short, by supportingopkg
,syft
will support those creating SBOMs for software containerized with OpenWrt, those working in the Yocto ecosystem, and broadens support for generating SBOMs for embedded systems in general.How?
Because
opkg
strives to conform "to a subset of debian’s policy manual regarding control files",opkg
package metadata is actuallydeb
package metadata and can be parsed with the same cataloger - albeit from a different location.The image
openwrt/rootfs
storesopkg
package metadata under the directory/var/lib/opkg/info/*
. The company I work for uses tools from the Yocto ecosystem, not OpenWRT, and we have an internal image that stores the metadata under/usr/lib/opkg/info/*
. To generalize, I made the globs look for anything under a directory like**/lib/opkg
.Before putting up this PR, I discussed the possibility of creating a dedicated cataloger for
opkg
with @kzantow over Slack. Not only will this not work without an upstream PR to package-URL to define a new type foropkg
, but it doesn't make any sense. Thedeb
PURL type is for debian and debian-derived packages;opkg
packages are debian-derived. Making a separate cataloger foropkg
is not necessary sinceopkg
packages can and should be cataloged asdeb
packages.Testing?
git clone https://github.com/johnDeSilencio/syft
and navigate to the new directory withcd syft/
feature/expand-deb-cataloger-to-include-opkg
make bootstrap
make snapshot
syft openwrt/rootfs
. You should see something like the following output:docker run -it anchore/syft:latest openwrt/rootfs
. You should see something like the following output: