-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
30 lines (24 loc) · 808 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
import (
"flag"
"fmt"
"io/ioutil"
"github.com/nevins-b/falco2seccomp/config"
"github.com/nevins-b/falco2seccomp/event"
)
func main() {
eventLog := flag.String("log", "", "Falco event log file path, event must be in json format")
configPath := flag.String("config", "config.yml", "Path to configuration")
containerID := flag.String("container-id", "", "ID of container")
ruleName := flag.String("rule-name", "container_syscall", "The name of the Falco rule")
outFile := flag.String("out", "", "File to write profile to, stdout if not specified")
flag.Parse()
c := config.LoadConfig(configPath, containerID, ruleName)
eP := event.NewEventParser(c)
js := eP.ParseLog(eventLog)
if *outFile != "" {
ioutil.WriteFile(*outFile, js, 0600)
} else {
fmt.Println(string(js))
}
}