Documentation
¶
Index ¶
- func FirstOf[K interface{}](inputs ...*K) *K
- func MergeMaps[K comparable, V comparable](maps ...map[K]V) map[K]V
- func Pointer[K interface{}](input K) *K
- type Activity
- type EvalOutput
- type Labels
- type Link
- type Package
- type Policy
- type PolicyManager
- type PolicyProcessor
- type Remediation
- type RemediationTask
- type Result
- type Risk
- type RiskTemplate
- type RiskTemplateLabelSchema
- type Step
- type ThreatRef
- type Violation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FirstOf ¶ added in v0.1.7
func FirstOf[K interface{}](inputs ...*K) *K
FirstOf will return the first pointer which is not null. This is used when multiple optional options exist to fill a field, but they have an order of priority
func MergeMaps ¶ added in v0.1.7
func MergeMaps[K comparable, V comparable](maps ...map[K]V) map[K]V
Types ¶
type EvalOutput ¶
type EvalOutput = policyeval.EvalOutput
The evaluation core lives in the API module's policyeval package, shared with the API's playback endpoint so both evaluate policies identically. These aliases keep this package's exported names stable for plugins.
type Package ¶
type Package = policyeval.Package
type Policy ¶
type Policy = policyeval.Policy
type PolicyManager ¶
type PolicyManager struct {
// contains filtered or unexported fields
}
func (*PolicyManager) Execute ¶
func (pm *PolicyManager) Execute(ctx context.Context, input interface{}) ([]Result, error)
func (*PolicyManager) GetRiskTemplates ¶ added in v0.3.0
func (pm *PolicyManager) GetRiskTemplates(ctx context.Context) (map[string][]*proto.RiskTemplate, error)
type PolicyProcessor ¶ added in v0.1.7
type PolicyProcessor struct {
// contains filtered or unexported fields
}
func NewPolicyProcessor ¶ added in v0.1.7
func (*PolicyProcessor) GenerateResults ¶ added in v0.1.7
type Remediation ¶ added in v0.3.0
type Remediation struct {
Title string `json:"title" mapstructure:"title"`
Description string `json:"description" mapstructure:"description"`
Tasks []RemediationTask `json:"tasks" mapstructure:"tasks"`
}
type RemediationTask ¶ added in v0.3.0
type RemediationTask struct {
Title string `json:"title" mapstructure:"title"`
}
type Result ¶
type Result = policyeval.Result
type RiskTemplate ¶ added in v0.3.0
type RiskTemplate struct {
Name string `json:"name" mapstructure:"name"`
Title string `json:"title" mapstructure:"title"`
Statement string `json:"statement" mapstructure:"statement"`
LikelihoodHint string `json:"likelihood_hint" mapstructure:"likelihood_hint"`
ImpactHint string `json:"impact_hint" mapstructure:"impact_hint"`
ViolationIds []string `json:"violation_ids" mapstructure:"violation_ids"`
ThreatRefs []ThreatRef `json:"threat_refs" mapstructure:"threat_refs"`
Remediation *Remediation `json:"remediation,omitempty" mapstructure:"remediation"`
DedupeLabelKeys []string `json:"dedupe_label_keys" mapstructure:"dedupe_label_keys"`
LabelSchema []RiskTemplateLabelSchema `json:"label_schema" mapstructure:"label_schema"`
}
type RiskTemplateLabelSchema ¶ added in v0.3.2
type Violation ¶
type Violation = policyeval.Violation
Click to show internal directories.
Click to hide internal directories.