mirror of
https://github.com/anchore/syft.git
synced 2026-02-12 18:46:41 +01:00
* feat: add Debian archive (.deb) file cataloger Add a cataloger that parses Debian package (.deb) archive files directly, allowing Syft to discover packages from .deb files without requiring them to be installed on the system. This implements issue #3315. Key features: - Parse .deb AR archives to extract package metadata - Support for gzip, xz, and zstd compressed control files - Extract package metadata from control files - Process file information from md5sums files - Mark configuration files from conffiles entries - Handle trailing slashes in archive member names Signed-off-by: Alan Pope <alan.pope@anchore.com> * chore: run go mod tidy to fix failing workflow Signed-off-by: Alan Pope <alan.pope@anchore.com> * add license processing to dpkg archive cataloger + add tests Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * update json schema with dpkg archive type Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> * update comments Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> --------- Signed-off-by: Alan Pope <alan.pope@anchore.com> Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com> Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
26 lines
1.1 KiB
Go
26 lines
1.1 KiB
Go
/*
|
|
Package debian provides a concrete Cataloger implementation relating to packages within the Debian linux distribution.
|
|
*/
|
|
package debian
|
|
|
|
import (
|
|
"github.com/anchore/syft/syft/pkg"
|
|
"github.com/anchore/syft/syft/pkg/cataloger/generic"
|
|
"github.com/anchore/syft/syft/pkg/cataloger/internal/dependency"
|
|
)
|
|
|
|
// NewDBCataloger returns a new Deb package cataloger capable of parsing DPKG status DB flat-file stores.
|
|
func NewDBCataloger() pkg.Cataloger {
|
|
return generic.NewCataloger("dpkg-db-cataloger").
|
|
// note: these globs have been intentionally split up in order to improve search performance,
|
|
// please do NOT combine into: "**/var/lib/dpkg/{status,status.d/*}"
|
|
WithParserByGlobs(parseDpkgDB, "**/lib/dpkg/status", "**/lib/dpkg/status.d/*", "**/lib/opkg/info/*.control", "**/lib/opkg/status").
|
|
WithProcessors(dependency.Processor(dbEntryDependencySpecifier))
|
|
}
|
|
|
|
// NewArchiveCataloger returns a new Debian package cataloger object capable of parsing .deb archive files
|
|
func NewArchiveCataloger() pkg.Cataloger {
|
|
return generic.NewCataloger("deb-archive-cataloger").
|
|
WithParserByGlobs(parseDebArchive, "**/*.deb")
|
|
}
|