Skip to content

Warn loudly if SQLite driver is not present when needed #3234

@cx-david-kesoshvili

Description

@cx-david-kesoshvili

The SBOM generated for the MySQL:8.x container does not include the RPM packages. It seems that important package information is missing

the code for generating the SBOM:

func analyzeImageUsingSyft(l *logger.Logger, imageId string) (source.Source, *sbom.SBOM, error) {

	img, err := stereoscope.GetImageFromSource(context.Background(), imageId, oci.Registry, stereoscope.WithPlatform("linux/amd64"))
	if err != nil {
		l.Error("Could not create image source object. err: %v", err)
		return nil, nil, err
	}

	imageSource := stereoscopesource.New(img, stereoscopesource.ImageConfig{Reference: imageId})
	if err != nil {
		l.Error("Could not pull image: %s. err: %v", imageId, err)
		return nil, nil, err
	}

	s, err := getSBOM(imageSource, true)
	if err != nil {
		l.Error("Could get image SBOM. image: %s. err: %v", imageId, err)
		return nil, nil, err
	}
	return imageSource, &s, nil
}

func getSBOM(src source.Source, saveToFile bool) (sbom.SBOM, error) {
	s, err := syft.CreateSBOM(context.Background(), src, cfg)
	if err != nil {
		return sbom.SBOM{}, err
	}
	return *s, nil
}

Other images with RPMs are getting scanned correctly, but this issue seems specific to MySQL:8.x.

Environment:

  • syft version: 1.11.1
  • OS: tested on Windows,Linux and macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions