correlator

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package correlator correlates Go code dependencies with Dockerfile capabilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CorrelationResult

type CorrelationResult struct {
	Dependencies []Dependency
	Capabilities DockerfileCapability
	Findings     []rules.Finding
}

CorrelationResult represents the result of correlating dependencies with Dockerfile.

type Correlator

type Correlator struct{}

Correlator correlates Go code dependencies with Dockerfile capabilities.

func NewCorrelator

func NewCorrelator() *Correlator

NewCorrelator creates a new Correlator.

func (*Correlator) Correlate

func (c *Correlator) Correlate(deps []Dependency, cap DockerfileCapability) []rules.Finding

Correlate correlates dependencies with Dockerfile capabilities.

func (*Correlator) CorrelateAll

func (c *Correlator) CorrelateAll(goFindings, dockerfileFindings []rules.Finding) *CorrelationResult

CorrelateAll performs full correlation analysis.

func (*Correlator) ExtractCapabilities

func (c *Correlator) ExtractCapabilities(dockerfileFindings []rules.Finding) DockerfileCapability

ExtractCapabilities extracts capabilities from Dockerfile analyzer findings and stages.

func (*Correlator) ExtractDependencies

func (c *Correlator) ExtractDependencies(goFindings []rules.Finding) []Dependency

ExtractDependencies extracts dependencies from Go analyzer findings.

type Dependency

type Dependency struct {
	Type     DependencyType
	Name     string         // Command name or library name
	Location rules.Location // Where it was detected
	Details  map[string]interface{}
}

Dependency represents a dependency detected in Go code.

type DependencyType

type DependencyType string

DependencyType represents the type of dependency detected in Go code.

const (
	DepExecCommand  DependencyType = "exec_command"
	DepShellCommand DependencyType = "shell_command"
	DepSystemBinary DependencyType = "system_binary"
	DepCGO          DependencyType = "cgo"
	DepDynamicLink  DependencyType = "dynamic_link"
)

type DockerfileCapability

type DockerfileCapability struct {
	HasShell          bool
	HasGlibc          bool
	HasMusl           bool
	IsMinimalImage    bool // scratch, distroless
	IsAlpineImage     bool
	CGODisabled       bool
	AvailableBinaries []string // Binaries available in the image
	FinalBaseImage    string
	BuildBaseImage    string
}

DockerfileCapability represents what a Dockerfile can provide.

Jump to

Keyboard shortcuts

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