File tree Expand file tree Collapse file tree 4 files changed +10
-7
lines changed
Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ The selector engine is configured in a YAML file which is provided via the `-s`
122122Available selector implementations :
123123
124124* regex: match the `RRNAME` field of the observation with one or multiple selectors
125+ * lua: process observations with lua scripts, see *selector.lua* for an example
125126
126127Example :
127128
Original file line number Diff line number Diff line change 1+ -- implement the process function for custom lua selectors
12function process (o )
23 print (" observation fields:" )
34 print (o :rcode ())
Original file line number Diff line number Diff line change @@ -2,9 +2,10 @@ package selector
22
33import (
44 "errors"
5+ "io/ioutil"
6+
57 "github.com/DCSO/balboa/observation"
68 lua "github.com/yuin/gopher-lua"
7- "io/ioutil"
89)
910
1011const (
@@ -142,7 +143,6 @@ func (l *LuaSelector) Reinitialize() (err error) {
142143}
143144
144145func (l * LuaSelector ) ProcessObservation (observation * observation.InputObservation ) (err error ) {
145-
146146 fn := l .L .GetGlobal (luaProcessObservationFunc )
147147 if err := l .L .CallByParam (lua.P {
148148 Fn : fn ,
Original file line number Diff line number Diff line change @@ -15,8 +15,9 @@ selectors:
1515 - filtered_tlds
1616 tags :
1717 - possible_cobaltstrike
18- - name : Lua Selector
19- type : lua
20- script : selector.lua
21- ingest :
22- - filtered_tlds
18+ # Example for a lua selector configuration
19+ # - name: Lua Selector
20+ # type: lua
21+ # script: selector.lua
22+ # ingest:
23+ # - filtered_tlds
You can’t perform that action at this time.
0 commit comments