Skip to content

Commit

Permalink
new(events/helper): actions not triggering a rule
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
  • Loading branch information
leogr committed Apr 14, 2020
1 parent 1ef10c8 commit 58a8676
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion events/syscall/exec_ls.go → events/helper/exec_ls.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package syscall
package helper

import (
"os/exec"
Expand Down
15 changes: 15 additions & 0 deletions events/helper/network_activity.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package helper

import (
"net"

"github.com/falcosecurity/event-generator/events"
)

var _ = events.Register(NetworkActivity)

func NetworkActivity(h events.Helper) error {
conn, err := net.Dial("udp", "10.2.3.4:8192")
defer conn.Close()
return err
}
13 changes: 13 additions & 0 deletions events/helper/run_shell.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package helper

import (
"os/exec"

"github.com/falcosecurity/event-generator/events"
)

var _ = events.Register(RunShell)

func RunShell(h events.Helper) error {
return exec.Command("bash", "-c", "ls > /dev/null").Run()
}
3 changes: 2 additions & 1 deletion events/syscall/db_program_spawn_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package syscall

import (
"github.com/falcosecurity/event-generator/events"
_ "github.com/falcosecurity/event-generator/events/helper"
)

var _ = events.Register(DbProgramSpawnProcess)

func DbProgramSpawnProcess(h events.Helper) error {
return h.SpawnAs("mysqld", "syscall.ExecLs")
return h.SpawnAs("mysqld", "helper.ExecLs")
}

0 comments on commit 58a8676

Please sign in to comment.