yara

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseByte

func ParseByte(input []byte) (rs *ast.RuleSet, err error)

ParseByte parses a YARA rule from the provided byte slice.

func ParseRule

func ParseRule(input io.Reader) (rs *ast.RuleSet, err error)

Parse parses a YARA rule from the provided input source.

func ParseString

func ParseString(s string) (*ast.RuleSet, error)

ParseString parses a YARA rule from the provided string.

Types

type Config

type Config struct {
	Title         string   // A short description of what this configuration does
	Order         int      // Defines the order of expansion when multiple config files are applicable
	Backends      []string // Lists the Sigma implementations that this config file is compatible with
	FieldMappings map[string]FieldMapping
	Placeholders  map[string][]interface{} // Defines values for placeholders that might appear in Yara rules
}

Config is a struct that defines the Sigma configuration

func ParseConfig

func ParseConfig(contents []byte) (Config, error)

ParseConfig takes a byte slice of YAML data and returns a Config struct or an error if unmarshaling fails

type FieldMapping

type FieldMapping struct {
	TargetNames []string // The name(s) that appear in the events being matched

}

FieldMapping is a struct that defines the target fields to be matched in Yara rules

func (*FieldMapping) UnmarshalYAML

func (f *FieldMapping) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML is a custom method for unmarshaling YAML data into FieldMapping

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL