Documentation
¶
Overview ¶
Package context classifies governance inputs such as environments and owners.
Index ¶
- Constants
- func ClassificationCounts(classifications map[string]Classification) (classified, unclassified int, byEnvironment map[string]int)
- type Application
- type Classification
- type ClassificationConfig
- type ClassificationSource
- type ContextInputs
- type ControlOverride
- type ControlParameters
- type ControlsConfig
- type ExceptionRecord
- type ExceptionSpec
- type Metadata
- type NameRule
- type NamespaceInput
- type Ownership
- type OwnershipConfig
- type OwnershipImport
- type OwnershipLabels
- type ResolveInput
- type Result
- type ScanConfig
- type WorkloadContext
- type WorkloadInput
Constants ¶
View Source
const ( APIVersion = "openmeshguard.io/v1alpha1" ScanConfigKind = "ScanConfig" OwnershipImportKind = "OwnershipImport" ExceptionKind = "Exception" )
View Source
const ( EnvironmentUnclassified = "unclassified" ConfidenceObserved = "observed" ConfidenceResolved = "resolved" ConfidenceInferred = "inferred" ConfidenceUserSupplied = "user-supplied" )
Variables ¶
This section is empty.
Functions ¶
func ClassificationCounts ¶
func ClassificationCounts(classifications map[string]Classification) (classified, unclassified int, byEnvironment map[string]int)
Types ¶
type Application ¶
type Classification ¶
type ClassificationConfig ¶
type ClassificationConfig struct {
Sources []ClassificationSource `yaml:"sources,omitempty"`
}
type ClassificationSource ¶
type ContextInputs ¶
type ControlOverride ¶
type ControlParameters ¶
type ControlsConfig ¶
type ControlsConfig struct {
Parameters ControlParameters `yaml:"parameters,omitempty"`
Overrides []ControlOverride `yaml:"overrides,omitempty"`
}
type ExceptionRecord ¶
type ExceptionRecord struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Metadata Metadata `yaml:"metadata"`
Spec ExceptionSpec `yaml:"spec"`
File string `yaml:"-"`
ValidationErrors []string `yaml:"-"`
ExpiresAt time.Time `yaml:"-"`
}
func LoadExceptions ¶
func LoadExceptions(paths []string) ([]ExceptionRecord, error)
type ExceptionSpec ¶
type NamespaceInput ¶
type OwnershipConfig ¶
type OwnershipConfig struct {
Labels OwnershipLabels `yaml:"labels,omitempty"`
Applications []Application `yaml:"applications,omitempty"`
}
type OwnershipImport ¶
type OwnershipImport struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Metadata Metadata `yaml:"metadata"`
Applications []Application `yaml:"applications"`
File string `yaml:"-"`
}
func LoadOwnershipImport ¶
func LoadOwnershipImport(path string) (OwnershipImport, error)
type OwnershipLabels ¶
type ResolveInput ¶
type ResolveInput struct {
ClusterContext string
InferEnvironments bool
Config ScanConfig
OwnershipImport OwnershipImport
Namespaces []NamespaceInput
Workloads []WorkloadInput
}
type Result ¶
type Result struct {
Namespaces map[string]Classification
Workloads []WorkloadContext
}
func Resolve ¶
func Resolve(input ResolveInput) Result
type ScanConfig ¶
type ScanConfig struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
Metadata Metadata `yaml:"metadata"`
Inputs ContextInputs `yaml:"inputs,omitempty"`
Classification ClassificationConfig `yaml:"classification,omitempty"`
Ownership OwnershipConfig `yaml:"ownership,omitempty"`
Controls ControlsConfig `yaml:"controls,omitempty"`
File string `yaml:"-"`
}
func LoadScanConfig ¶
func LoadScanConfig(path string) (ScanConfig, error)
type WorkloadContext ¶
type WorkloadContext struct {
Ref resolver.WorkloadRef
Classification Classification
Ownership Ownership
ExceptionID string
}
type WorkloadInput ¶
type WorkloadInput struct {
Ref resolver.WorkloadRef
Labels map[string]string
Annotations map[string]string
Namespace NamespaceInput
}
Click to show internal directories.
Click to hide internal directories.