Documentation
¶
Overview ¶
Package correlator correlates Go code dependencies with Dockerfile capabilities.
Index ¶
- type CorrelationResult
- type Correlator
- func (c *Correlator) Correlate(deps []Dependency, cap DockerfileCapability) []rules.Finding
- func (c *Correlator) CorrelateAll(goFindings, dockerfileFindings []rules.Finding) *CorrelationResult
- func (c *Correlator) ExtractCapabilities(dockerfileFindings []rules.Finding) DockerfileCapability
- func (c *Correlator) ExtractDependencies(goFindings []rules.Finding) []Dependency
- type Dependency
- type DependencyType
- type DockerfileCapability
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 (*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.