Skip to content

Commit 7974bfe

Browse files
committed
cleanup
1 parent cd97d39 commit 7974bfe

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ The selector engine is configured in a YAML file which is provided via the `-s`
122122
Available 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

126127
Example:
127128

selector.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
-- implement the process function for custom lua selectors
12
function process(o)
23
print("observation fields:")
34
print(o:rcode())

selector/selector_lua.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package selector
22

33
import (
44
"errors"
5+
"io/ioutil"
6+
57
"github.com/DCSO/balboa/observation"
68
lua "github.com/yuin/gopher-lua"
7-
"io/ioutil"
89
)
910

1011
const (
@@ -142,7 +143,6 @@ func (l *LuaSelector) Reinitialize() (err error) {
142143
}
143144

144145
func (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,

selectors.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)