summaryrefslogtreecommitdiffstats
path: root/src/global.go
diff options
context:
space:
mode:
authorWe-unite <3205135446@qq.com>2024-07-31 11:46:01 +0800
committerWe-unite <3205135446@qq.com>2024-08-01 15:10:36 +0800
commit3efeef969ebc344c993ce0fc46f557c7d8560525 (patch)
treef0f917080c64c8def6922c365465f1ee5371c464 /src/global.go
parentd6c6e13796435f9e1e59fec891aa53680748a2d7 (diff)
downloadgodo-3efeef969ebc344c993ce0fc46f557c7d8560525.tar.gz
godo-3efeef969ebc344c993ce0fc46f557c7d8560525.zip
Use netlink connector to recv pid info, fix exec
For some reasons, kernel-connector can catch exec event, but it doesn't tell me about what the process exec and what're its args. So we should use audit to collect these infomations, and complete in the database. However, there's different delays between connector and audit, although they both use netlink socket, as a result of which, exec may comes before fork. we deal with it the same way. But, there's also exec event lost, may because of the check for ppid in exec event, but it's necessary, and if is deleted, too much irrelavent infomation would flood into database, i've tried. So make it there, just go forward. Besides, what's newly discovered is that pthread_create also use clone syscall, but if pid 1 has a thread 2, the exec info will say that pid 2 execs. So i shouldn't ignore connector msg that childPid ne childTgid. This is my first attempt to use git-submodule function in my own pro- ject, also golang local package. Congratulations! Now, fight to fix about file operations. Hope that there wouldn't be too many fucking bugs.
Diffstat (limited to 'src/global.go')
-rw-r--r--src/global.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/global.go b/src/global.go
index f0f909c..a266b1b 100644
--- a/src/global.go
+++ b/src/global.go
@@ -33,12 +33,13 @@ type Event struct {
33 timestamp time.Time 33 timestamp time.Time
34 pid, ppid int 34 pid, ppid int
35 syscall int 35 syscall int
36 exit_code uint64 36 syscallParam [4]uint64
37 pathName string
37 argc int 38 argc int
38 argv []string 39 argv []string
39 cwd string 40 cwd string
40 syscallParam [4]uint64 41 exit_code uint64
41 pathName string 42 exit_signal int
42} 43}
43 44
44func (event Event) String() string { 45func (event Event) String() string {