This package is designed to analyze container images and extract package information using the Syft tool.
The Syft Packages Extractor analyzes container images to extract detailed package information. It uses the Syft tool to examine images and provides information on the packages found within those images.
- Analyze container images and extract package information.
- Handle multiple image formats and locations.
- Log the analysis process and results.
To install this package, you need to have Go installed on your machine.
-
Clone the repository:
git clone https://github.com/Checkmarx/containers-syft-package-extractor.git
-
Navigate to the project directory:
cd containers-syft-package-extractor
-
Install dependencies:
go mod tidy
Here is an example of how to use the SyftPackagesExtractor
:
package main
import (
"github.com/Checkmarx/containers-types/types"
"github.com/Checkmarx/containers-syft-package-extractor/syftPackagesExtractor"
"log"
)
func main() {
extractor := syftPackagesExtractor.SyftPackagesExtractor{}
images := []types.ImageModel{
// Populate with ImageModel objects
}
// Analyze images
containerResolution, err := extractor.AnalyzeImages(images)
if err != nil {
log.Fatalf("Error analyzing images: %v", err)
}
// Handle the container resolution as needed
log.Printf("Analyzed images: %v", containerResolution)
}