analyzer

package module
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 22 Imported by: 3

README

image-analyzer

OCI images analyzer

This repository exists for 3 reasons:

  • github.com/castai/image-analyzer/image/daemon.Image interface.
  • Having various analyzers bundled in a single module. This didn't exist at the time of the fork
  • https://github.com/aquasecurity/trivy/tree/v0.50.1/pkg/fanal/analyzer/pkg/apk analyzer not scanning installed binaries.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCacheNotFound = errors.New("blob not found in cache")
)

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	// contains filtered or unexported fields
}

Artifact bundles image with the required dependencies to be able to scan it.

func NewArtifact

func NewArtifact(img types.Image, log logrus.FieldLogger, c CacheClient, opt ArtifactOption) (*Artifact, error)

NewArtifact bundles already pulled image with additional dependencies for scanning.

func (Artifact) Clean

func (Artifact) Clean(_ artifact.Reference) error

func (Artifact) Inspect

func (a Artifact) Inspect(ctx context.Context) (*ArtifactReference, error)

type ArtifactOption

type ArtifactOption = artifact.Option

ArtifactOption customizes scanning behavior

type ArtifactReference

type ArtifactReference struct {
	// BlobsInfo contains information about image layers
	BlobsInfo    []types.BlobInfo
	ConfigFile   *v1.ConfigFile
	ArtifactInfo *types.ArtifactInfo
	OsInfo       *types.OS
}

ArtifactReference represents uncompressed image with its layers also uncompressed

type CacheClient

type CacheClient interface {
	PutBlob(ctx context.Context, key string, blob []byte) error
	GetBlob(ctx context.Context, key string) ([]byte, error)
}

type CachedImage added in v0.7.0

type CachedImage = types.ArtifactInfo

CachedImage does not contain information about layers. Identified by ImageID in cache.

type CachedLayers added in v0.7.0

type CachedLayers = map[string]types.BlobInfo

CachedLayers are identified by diffID in cache.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL