Skip to content

Commit

Permalink
new(events/syscall): system user interactive
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 643d968 commit 66687c3
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions events/syscall/system_user_interactive.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// +build linux

package syscall

import (
"os/exec"

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

var _ = events.Register(SystemUserInteractive)

func SystemUserInteractive(h events.Helper) error {
err := runAsUser(h, "daemon", "/bin/login")

// silently ignore /bin/login exit status 1
if exitErr, isExitErr := err.(*exec.ExitError); isExitErr {
h.Log().WithError(exitErr).Debug("silently ignore exit status")
return nil
}
return err
}

0 comments on commit 66687c3

Please sign in to comment.