Expand deb cataloger to include opkg#1985
Merged
spiffcs merged 3 commits intoAug 3, 2023
Merged
Conversation
added 3 commits
August 1, 2023 12:33
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 <nicholas_smith@selinc.com>
Signed-off-by: Nicholas R. Smith <nicholas_smith@selinc.com>
Signed-off-by: Nicholas R. Smith <nicholas_smith@selinc.com>
spiffcs
approved these changes
Aug 3, 2023
Contributor
|
@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 =) |
Contributor
Author
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 |
This was referenced Aug 15, 2023
Closed
Closed
Open
Closed
GijsCalis
pushed a commit
to GijsCalis/syft
that referenced
this pull request
Feb 19, 2024
* 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 <nicholas_smith@selinc.com> --------- Signed-off-by: Nicholas R. Smith <nicholas_smith@selinc.com> Co-authored-by: Nicholas R. Smith <nicholas_smith@selinc.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
opkgusingsyft. In short, by supportingopkg,syftwill 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
opkgstrives to conform "to a subset of debian’s policy manual regarding control files",opkgpackage metadata is actuallydebpackage metadata and can be parsed with the same cataloger - albeit from a different location.The image
openwrt/rootfsstoresopkgpackage 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
opkgwith @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. ThedebPURL type is for debian and debian-derived packages;opkgpackages are debian-derived. Making a separate cataloger foropkgis not necessary sinceopkgpackages can and should be cataloged asdebpackages.Testing?
git clone https://github.com/johnDeSilencio/syftand navigate to the new directory withcd syft/feature/expand-deb-cataloger-to-include-opkgmake bootstrapmake snapshotsyft 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: