diff options
Diffstat (limited to '')
-rw-r--r-- | listener/deal.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/listener/deal.go b/listener/deal.go index 8225224..70c2827 100644 --- a/listener/deal.go +++ b/listener/deal.go | |||
@@ -79,19 +79,19 @@ func deal() { | |||
79 | 79 | ||
80 | switch cooked.tag { | 80 | switch cooked.tag { |
81 | case NEWPID: | 81 | case NEWPID: |
82 | go dealNewPid(cooked) | 82 | dealNewPid(cooked) |
83 | case EXECVE: | 83 | case EXECVE: |
84 | go dealExecve(cooked) | 84 | dealExecve(cooked) |
85 | case PIDEXIT: | 85 | case PIDEXIT: |
86 | go deletePid(cooked) | 86 | deletePid(cooked) |
87 | case FILEOPEN: | 87 | case FILEOPEN: |
88 | go fileOpen(cooked) | 88 | fileOpen(cooked) |
89 | case FILEWRITE: | 89 | case FILEWRITE: |
90 | go fileWrite(cooked) | 90 | fileWrite(cooked) |
91 | case FILECLOSE: | 91 | case FILECLOSE: |
92 | go fileClose(cooked) | 92 | fileClose(cooked) |
93 | case PIVOTROOT: | 93 | case PIVOTROOT: |
94 | go pivotRoot(cooked) | 94 | pivotRoot(cooked) |
95 | } | 95 | } |
96 | } | 96 | } |
97 | } | 97 | } |
@@ -131,6 +131,7 @@ func dealNewPid(cooked Event) { | |||
131 | docRes[0].Cwd = cooked.cwd | 131 | docRes[0].Cwd = cooked.cwd |
132 | docRes[0].Comm = cooked.comm | 132 | docRes[0].Comm = cooked.comm |
133 | docRes[0].Args = cooked.argv | 133 | docRes[0].Args = cooked.argv |
134 | docRes[0].DockerId = cooked.cgroup | ||
134 | 135 | ||
135 | err := pidCol.ReplaceOne(bson.M{"pid": cooked.pid}, docRes[0]) | 136 | err := pidCol.ReplaceOne(bson.M{"pid": cooked.pid}, docRes[0]) |
136 | if err != nil { | 137 | if err != nil { |
@@ -149,6 +150,7 @@ func dealNewPid(cooked Event) { | |||
149 | Cwd: cooked.cwd, | 150 | Cwd: cooked.cwd, |
150 | Execve: make([]Exec, 0), | 151 | Execve: make([]Exec, 0), |
151 | Children: make([]int, 0), | 152 | Children: make([]int, 0), |
153 | DockerId: cooked.cgroup, | ||
152 | }) | 154 | }) |
153 | if err != nil { | 155 | if err != nil { |
154 | fmt.Fprintf(os.Stderr, "Err inserting: %v\n", err) | 156 | fmt.Fprintf(os.Stderr, "Err inserting: %v\n", err) |