-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a config to cgoreceiver for suppressing events according to proce…
…sses' comm (#495) Signed-off-by: sanyangji <songyujie@zju.edu.cn>
- Loading branch information
Showing
11 changed files
with
129 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,86 @@ | ||
package cgoreceiver | ||
|
||
type Config struct { | ||
SubscribeInfo []SubEvent `mapstructure:"subscribe"` | ||
SubscribeInfo []SubEvent `mapstructure:"subscribe"` | ||
ProcessFilterInfo ProcessFilter `mapstructure:"process_filter"` | ||
} | ||
|
||
type SubEvent struct { | ||
Category string `mapstructure:"category"` | ||
Name string `mapstructure:"name"` | ||
Params map[string]string `mapstructure:"params"` | ||
} | ||
|
||
type ProcessFilter struct { | ||
Comms []string `mapstructure:"comms"` | ||
} | ||
|
||
func NewDefaultConfig() *Config { | ||
return &Config{ | ||
SubscribeInfo: []SubEvent{ | ||
{ | ||
Name: "syscall_exit-writev", | ||
Category: "net", | ||
}, | ||
{ | ||
Name: "syscall_exit-readv", | ||
Category: "net", | ||
}, | ||
{ | ||
Name: "syscall_exit-write", | ||
Category: "net", | ||
}, | ||
{ | ||
Name: "syscall_exit-read", | ||
Category: "net", | ||
}, | ||
{ | ||
Name: "syscall_exit-sendto", | ||
Category: "net", | ||
}, | ||
{ | ||
Name: "syscall_exit-recvfrom", | ||
Category: "net", | ||
}, | ||
{ | ||
Name: "syscall_exit-sendmsg", | ||
Category: "net", | ||
}, | ||
{ | ||
Name: "syscall_exit-recvmsg", | ||
Category: "net", | ||
}, | ||
{ | ||
Name: "syscall_exit-sendmmsg", | ||
Category: "net", | ||
}, | ||
{ | ||
Name: "kprobe-tcp_close", | ||
}, | ||
{ | ||
Name: "kprobe-tcp_rcv_established", | ||
}, | ||
{ | ||
Name: "kprobe-tcp_drop", | ||
}, | ||
{ | ||
Name: "kprobe-tcp_retransmit_skb", | ||
}, | ||
{ | ||
Name: "syscall_exit-connect", | ||
}, | ||
{ | ||
Name: "kretprobe-tcp_connect", | ||
}, | ||
{ | ||
Name: "kprobe-tcp_set_state", | ||
}, | ||
{ | ||
Name: "tracepoint-procexit", | ||
}, | ||
}, | ||
ProcessFilterInfo: ProcessFilter{ | ||
Comms: []string{"kindling-collec", "containerd", "dockerd", "containerd-shim"}, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters