@@ -61,7 +61,8 @@ func (c *AgentController) bpfmanAttachNetobserv(ctx context.Context, fc *flowsla
6161func prepareBpfApplication (bpfApp * bpfmaniov1alpha1.ClusterBpfApplication , fc * flowslatest.FlowCollector , netobservBCImage string ) {
6262 samplingValue := make ([]byte , 4 )
6363 dnsPortValue := make ([]byte , 2 )
64- var enableDNSValue , enableRTTValue , enableFLowFilterValue , enableNetworkEvents , traceValue , networkEventsGroupIDValue , enablePktTranslation , enableIPSecValue []byte
64+ var enableDNSValue , enableRTTValue , enableFLowFilterValue , enableNetworkEvents , traceValue , networkEventsGroupIDValue , enablePktTranslation , enableIPSecValue , enableOpenSSLValue []byte
65+ openSSLPath := defaultOpenSSLPath
6566
6667 binary .NativeEndian .PutUint32 (samplingValue , uint32 (* fc .Spec .Agent .EBPF .Sampling ))
6768
@@ -93,6 +94,10 @@ func prepareBpfApplication(bpfApp *bpfmaniov1alpha1.ClusterBpfApplication, fc *f
9394 enableIPSecValue = append (enableIPSecValue , uint8 (1 ))
9495 }
9596
97+ if fc .Spec .Agent .EBPF .IsOpenSSLTrackingEnabled () {
98+ enableOpenSSLValue = append (enableOpenSSLValue , uint8 (1 ))
99+ }
100+
96101 bpfApp .Labels = map [string ]string {
97102 "app" : netobservApp ,
98103 }
@@ -105,6 +110,8 @@ func prepareBpfApplication(bpfApp *bpfmaniov1alpha1.ClusterBpfApplication, fc *f
105110 dnsPortValue = []byte (v )
106111 } else if k == envNetworkEventsGroupID {
107112 networkEventsGroupIDValue = []byte (v )
113+ } else if k == envOpenSSLPath {
114+ openSSLPath = v
108115 }
109116 }
110117
@@ -124,6 +131,7 @@ func prepareBpfApplication(bpfApp *bpfmaniov1alpha1.ClusterBpfApplication, fc *f
124131 "network_events_monitoring_groupid" : networkEventsGroupIDValue ,
125132 "enable_pkt_translation_tracking" : enablePktTranslation ,
126133 "enable_ipsec" : enableIPSecValue ,
134+ "enable_openssl_tracking" : enableOpenSSLValue ,
127135 }
128136
129137 bpfApp .Spec .BpfAppCommon .ByteCode = bpfmaniov1alpha1.ByteCodeSelector {
@@ -286,6 +294,23 @@ func prepareBpfApplication(bpfApp *bpfmaniov1alpha1.ClusterBpfApplication, fc *f
286294 },
287295 }... )
288296 }
297+
298+ if fc .Spec .Agent .EBPF .IsOpenSSLTrackingEnabled () {
299+ bpfApp .Spec .Programs = append (bpfApp .Spec .Programs , []bpfmaniov1alpha1.ClBpfApplicationProgram {
300+ {
301+ Name : "probe_entry_SSL_write" ,
302+ Type : bpfmaniov1alpha1 .ProgTypeUprobe ,
303+ UProbe : & bpfmaniov1alpha1.ClUprobeProgramInfo {
304+ Links : []bpfmaniov1alpha1.ClUprobeAttachInfo {
305+ {
306+ Target : openSSLPath ,
307+ Function : "SSL_write" ,
308+ },
309+ },
310+ },
311+ },
312+ }... )
313+ }
289314}
290315
291316func (c * AgentController ) createBpfApplication (ctx context.Context , bpfApp * bpfmaniov1alpha1.ClusterBpfApplication ) error {
0 commit comments