Skip to content

Commit b592804

Browse files
committed
enable multiple filters
1 parent 1d4c706 commit b592804

File tree

6 files changed

+175
-173
lines changed

6 files changed

+175
-173
lines changed

res/flow-capture.yml

Lines changed: 4 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -46,81 +46,13 @@ spec:
4646
- name: ENABLE_FLOW_FILTER
4747
value: "false"
4848
- name: FLOW_FILTER_RULES
49-
value: >
50-
[ { "direction": "", "ip_cidr": "0.0.0.0/0", "protocol": "", "source_port": 0,
51-
"destination_port": 0, "port": 0, "source_port_range": "",
52-
"source_ports": "", "destination_port_range": "",
53-
"destination_ports": "", "port_range": "", "ports": "",
54-
"icmp_type": 0, "icmp_code": 0, "peer_ip": "", "action": "Accept",
55-
"tcp_flags": "", "drops": false }
56-
]
49+
value: >-
50+
[]
5751
- name: EXPORT
5852
value: "direct-flp"
5953
- name: FLP_CONFIG
60-
value: >
61-
{
62-
"log-level": "trace",
63-
"metricsSettings":{
64-
"disableGlobalServer": true
65-
},
66-
"parameters":[
67-
{
68-
"name":"enrich",
69-
"transform":{
70-
"type":"network",
71-
"network":{
72-
"rules":[
73-
{
74-
"type":"add_kubernetes",
75-
"kubernetes":{
76-
"add_zone": true,
77-
"ipField":"SrcAddr",
78-
"output":"SrcK8S"
79-
}
80-
},
81-
{
82-
"type":"add_kubernetes",
83-
"kubernetes":{
84-
"add_zone": true,
85-
"ipField":"DstAddr",
86-
"output":"DstK8S"
87-
}
88-
},
89-
{
90-
"type":"reinterpret_direction"
91-
}
92-
],
93-
"directionInfo":{
94-
"reporterIPField":"AgentIP",
95-
"srcHostField":"SrcK8S_HostIP",
96-
"dstHostField":"DstK8S_HostIP",
97-
"flowDirectionField":"FlowDirection"
98-
}
99-
}
100-
}
101-
},
102-
{
103-
"name":"send",
104-
"write":{
105-
"type":"grpc",
106-
"grpc":{
107-
"targetHost":"{{TARGET_HOST}}",
108-
"targetPort":9999
109-
}
110-
}
111-
}
112-
],
113-
"pipeline":[
114-
{
115-
"name":"enrich",
116-
"follows":"preset-ingester"
117-
},
118-
{
119-
"name":"send",
120-
"follows":"enrich"
121-
}
122-
]
123-
}
54+
value: |
55+
{}
12456
volumeMounts:
12557
- name: bpf-kernel-debug
12658
mountPath: /sys/kernel/debug

res/flow-filter.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"direction": "",
3+
"ip_cidr": "0.0.0.0/0",
4+
"protocol": "",
5+
"source_port": 0,
6+
"destination_port": 0,
7+
"port": 0,
8+
"source_port_range": "",
9+
"source_ports": "",
10+
"destination_port_range": "",
11+
"destination_ports": "",
12+
"port_range": "",
13+
"ports": "",
14+
"icmp_type": 0,
15+
"icmp_code": 0,
16+
"peer_ip": "",
17+
"action": "Accept",
18+
"tcp_flags": "",
19+
"drops": false
20+
}

res/packet-capture.yml

Lines changed: 4 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -32,81 +32,13 @@ spec:
3232
- name: LOG_LEVEL
3333
value: info
3434
- name: FLOW_FILTER_RULES
35-
value: >
36-
[ { "direction": "", "ip_cidr": "0.0.0.0/0", "protocol": "", "source_port": 0,
37-
"destination_port": 0, "port": 0, "source_port_range": "",
38-
"source_ports": "", "destination_port_range": "",
39-
"destination_ports": "", "port_range": "", "ports": "",
40-
"icmp_type": 0, "icmp_code": 0, "peer_ip": "", "action": "Accept",
41-
"tcp_flags": "", "drops": false }
42-
]
35+
value: >-
36+
[]
4337
- name: EXPORT
4438
value: "direct-flp"
4539
- name: FLP_CONFIG
46-
value: >
47-
{
48-
"log-level": "trace",
49-
"metricsSettings":{
50-
"disableGlobalServer": true
51-
},
52-
"parameters":[
53-
{
54-
"name":"enrich",
55-
"transform":{
56-
"type":"network",
57-
"network":{
58-
"rules":[
59-
{
60-
"type":"add_kubernetes",
61-
"kubernetes":{
62-
"add_zone": true,
63-
"ipField":"SrcAddr",
64-
"output":"SrcK8S"
65-
}
66-
},
67-
{
68-
"type":"add_kubernetes",
69-
"kubernetes":{
70-
"add_zone": true,
71-
"ipField":"DstAddr",
72-
"output":"DstK8S"
73-
}
74-
},
75-
{
76-
"type":"reinterpret_direction"
77-
}
78-
],
79-
"directionInfo":{
80-
"reporterIPField":"AgentIP",
81-
"srcHostField":"SrcK8S_HostIP",
82-
"dstHostField":"DstK8S_HostIP",
83-
"flowDirectionField":"FlowDirection"
84-
}
85-
}
86-
}
87-
},
88-
{
89-
"name":"send",
90-
"write":{
91-
"type":"grpc",
92-
"grpc":{
93-
"targetHost":"{{TARGET_HOST}}",
94-
"targetPort":9999
95-
}
96-
}
97-
}
98-
],
99-
"pipeline":[
100-
{
101-
"name":"enrich",
102-
"follows":"preset-ingester"
103-
},
104-
{
105-
"name":"send",
106-
"follows":"enrich"
107-
}
108-
]
109-
}
40+
value: |
41+
{}
11042
volumeMounts:
11143
- name: bpf-kernel-debug
11244
mountPath: /sys/kernel/debug

res/pipeline-config.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"log-level": "trace",
3+
"metricsSettings": {
4+
"disableGlobalServer": true
5+
},
6+
"parameters": [
7+
{
8+
"name": "enrich",
9+
"transform": {
10+
"type": "network",
11+
"network": {
12+
"rules": [
13+
{
14+
"type": "add_kubernetes",
15+
"kubernetes": {
16+
"add_zone": true,
17+
"ipField": "SrcAddr",
18+
"output": "SrcK8S"
19+
}
20+
},
21+
{
22+
"type": "add_kubernetes",
23+
"kubernetes": {
24+
"add_zone": true,
25+
"ipField": "DstAddr",
26+
"output": "DstK8S"
27+
}
28+
},
29+
{
30+
"type": "reinterpret_direction"
31+
}
32+
],
33+
"directionInfo": {
34+
"reporterIPField": "AgentIP",
35+
"srcHostField": "SrcK8S_HostIP",
36+
"dstHostField": "DstK8S_HostIP",
37+
"flowDirectionField": "FlowDirection"
38+
}
39+
}
40+
}
41+
},
42+
{
43+
"name": "send",
44+
"write": {
45+
"type": "grpc",
46+
"grpc": {
47+
"targetHost": "{{TARGET_HOST}}",
48+
"targetPort": 9999
49+
}
50+
}
51+
}
52+
],
53+
"pipeline": [
54+
{
55+
"name": "enrich",
56+
"follows": "preset-ingester"
57+
},
58+
{
59+
"name": "send",
60+
"follows": "enrich"
61+
}
62+
]
63+
}

0 commit comments

Comments
 (0)