container

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package container provides a container image scan source. It pulls and inspects OCI/Docker images layer by layer without requiring a running Docker daemon (daemon-less, via go-containerregistry).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerSource

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

ContainerSource scans container image layers for secrets.

func New

func New(imageRef string, opts ...Option) *ContainerSource

New creates a new ContainerSource for the given image reference.

func (*ContainerSource) Chunks

func (s *ContainerSource) Chunks(ctx context.Context) <-chan source.Chunk

Chunks pulls the image and sends file contents from each layer as chunks.

func (*ContainerSource) Type

func (s *ContainerSource) Type() string

Type returns the source type identifier.

func (*ContainerSource) Validate

func (s *ContainerSource) Validate() error

Validate checks that the image reference is parseable and accessible.

type Option

type Option func(*ContainerSource)

Option configures a ContainerSource.

func WithBufferSize

func WithBufferSize(size int) Option

WithBufferSize sets the chunk channel buffer size. Values less than or equal to zero are ignored.

func WithExcludePaths

func WithExcludePaths(patterns []string) Option

WithExcludePaths sets glob patterns for layer file paths to exclude from scanning. Patterns are matched against each file's cleaned, slash-based path within the layer, mirroring filesystem.WithExcludePaths semantics.

func WithMaxFileSize

func WithMaxFileSize(size int64) Option

WithMaxFileSize sets the maximum file size to extract from layers. Values less than or equal to zero are ignored.

Jump to

Keyboard shortcuts

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