Documentation
¶
Index ¶
Constants ¶
const ( // RuleVersion is the version of Rule RuleVersion string = "v1" )
Variables ¶
var ( // KnownProfileDataSurfaces and KnownProfileDataPatternFields are extracted // dynamically from the canonical armotypes structs so node-agent never // duplicates the field lists and automatically inherits any new surfaces. KnownProfileDataSurfaces = extractJSONFieldNames(reflect.TypeOf(armotypes.ProfileDataRequired{})) KnownProfileDataPatternFields = extractJSONFieldNames(reflect.TypeOf(armotypes.ProfileDataPattern{})) )
var RuleGvr = schema.GroupVersionResource{ Group: types.RuleGroup, Version: RuleVersion, Resource: types.RulePlural, }
Functions ¶
func ValidateRawProfileDataRequired ¶ added in v0.3.238
ValidateRawProfileDataRequired inspects raw, untyped profileDataRequired definitions (e.g. from an unstructured CRD or JSON/YAML map) before conversion to armotypes.ProfileDataRequired discards unknown keys.
Types ¶
type FieldRequirement ¶ added in v0.3.111
type FieldRequirement = armotypes.ProfileDataField
The profileDataRequired schema (the type, its match patterns, and the custom JSON/YAML/BSON (un)marshalling) lives in armoapi-go/armotypes — the single module imported by every consumer: node-agent (this query side: projection / was_path_opened), storage (the generation side: rule-aware collapse), and the backend (rules persisted in MongoDB). Defining it once there guarantees the matcher can never drift between the side that records a profile and the side that queries it.
These aliases preserve node-agent's historical type names. Note the shape change versus the old node-agent-local schema: a surface is now a *pointer* (ProfileDataRequired.Opens is *ProfileDataField); a nil pointer means "this rule does not declare this surface" — the role the old `Declared` bool played.
type PatternObject ¶ added in v0.3.111
type PatternObject = armotypes.ProfileDataPattern
The profileDataRequired schema (the type, its match patterns, and the custom JSON/YAML/BSON (un)marshalling) lives in armoapi-go/armotypes — the single module imported by every consumer: node-agent (this query side: projection / was_path_opened), storage (the generation side: rule-aware collapse), and the backend (rules persisted in MongoDB). Defining it once there guarantees the matcher can never drift between the side that records a profile and the side that queries it.
These aliases preserve node-agent's historical type names. Note the shape change versus the old node-agent-local schema: a surface is now a *pointer* (ProfileDataRequired.Opens is *ProfileDataField); a nil pointer means "this rule does not declare this surface" — the role the old `Declared` bool played.
type ProfileDataRequired ¶ added in v0.3.111
type ProfileDataRequired = armotypes.ProfileDataRequired
The profileDataRequired schema (the type, its match patterns, and the custom JSON/YAML/BSON (un)marshalling) lives in armoapi-go/armotypes — the single module imported by every consumer: node-agent (this query side: projection / was_path_opened), storage (the generation side: rule-aware collapse), and the backend (rules persisted in MongoDB). Defining it once there guarantees the matcher can never drift between the side that records a profile and the side that queries it.
These aliases preserve node-agent's historical type names. Note the shape change versus the old node-agent-local schema: a surface is now a *pointer* (ProfileDataRequired.Opens is *ProfileDataField); a nil pointer means "this rule does not declare this surface" — the role the old `Declared` bool played.
type Rule ¶
type Rule struct {
Enabled bool `json:"enabled" yaml:"enabled"`
ID string `json:"id" yaml:"id"`
Name string `json:"name" yaml:"name"`
Description string `json:"description" yaml:"description"`
Expressions RuleExpressions `json:"expressions" yaml:"expressions"`
ProfileDependency armotypes.ProfileDependency `json:"profileDependency" yaml:"profileDependency"`
ProfileDataRequired *ProfileDataRequired `json:"profileDataRequired,omitempty" yaml:"profileDataRequired,omitempty"`
Severity int `json:"severity" yaml:"severity"`
SupportPolicy bool `json:"supportPolicy" yaml:"supportPolicy"`
Tags []string `json:"tags" yaml:"tags"`
State map[string]any `json:"state,omitempty" yaml:"state,omitempty"`
AgentVersionRequirement string `json:"agentVersionRequirement" yaml:"agentVersionRequirement"`
IsTriggerAlert bool `json:"isTriggerAlert" yaml:"isTriggerAlert"`
MitreTactic string `json:"mitreTactic" yaml:"mitreTactic"`
MitreTechnique string `json:"mitreTechnique" yaml:"mitreTechnique"`
Prefilter *prefilter.Params `json:"-" yaml:"-"`
}
type RuleExpression ¶
type RuleExpressions ¶
type RuleExpressions struct {
Message string `json:"message" yaml:"message"`
UniqueID string `json:"uniqueId" yaml:"uniqueId"`
RuleExpression []RuleExpression `json:"ruleExpression" yaml:"ruleExpression"`
}