Documentation
¶
Overview ¶
Package module defines the core Generator interface and supporting types used by all MacNoise telemetry modules. Every module implements Generator and self-registers via init() so the runner can discover and execute it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CategoryCounts ¶
CategoryCounts returns a map from Category to the number of registered modules in that category.
Types ¶
type Category ¶
type Category string
Category is the telemetry domain that a module belongs to.
const ( CategoryNetwork Category = "network" CategoryProcess Category = "process" CategoryFile Category = "file" CategoryTCC Category = "tcc" CategoryEndpointSecurity Category = "endpoint_security" CategoryService Category = "service" CategoryPlist Category = "plist" CategoryXPC Category = "xpc" )
Category constants for each supported telemetry domain.
func AllCategories ¶
func AllCategories() []Category
AllCategories returns a slice containing every known Category value.
type EventEmitter ¶
type EventEmitter func(TelemetryEvent)
EventEmitter is a callback that receives a telemetry event from a module.
type Generator ¶
type Generator interface {
Info() ModuleInfo
ParamSpecs() []ParamSpec
CheckPrereqs() error
Generate(ctx context.Context, params Params, emit EventEmitter) error
DryRun(params Params) []string
Cleanup() error
}
Generator is implemented by every MacNoise module and drives the runner lifecycle.
func ByCategory ¶
ByCategory returns all registered modules in the given category, sorted by name.
type ModuleInfo ¶
type ParamSpec ¶
type ParamSpec struct {
Name string
Description string
Required bool
DefaultValue string
Example string
}
ParamSpec describes a single named parameter accepted by a module.
type Privilege ¶
type Privilege string
Privilege represents the privilege level required to run a module.
type ProcessContext ¶
type ProcessContext struct {
PID int `json:"pid"`
PPID int `json:"ppid"`
Executable string `json:"executable"`
Username string `json:"username"`
}
ProcessContext captures identifying information about the MacNoise process itself.
type TelemetryEvent ¶
type TelemetryEvent struct {
SchemaVersion string `json:"schema_version"`
Timestamp time.Time `json:"timestamp"`
Module string `json:"module"`
Category string `json:"category"`
EventType string `json:"event_type"`
Success bool `json:"success"`
Message string `json:"message"`
Details map[string]any `json:"details,omitempty"`
Error string `json:"error,omitempty"`
MITRE []MITRE `json:"mitre,omitempty"`
ProcessContext ProcessContext `json:"process_context"`
}
TelemetryEvent is the structured record emitted by a module for each action it performs.