Skip to content

Commit

Permalink
dns events: support dns events over tcp (aquasecurity#1807)
Browse files Browse the repository at this point in the history
output dns events which are on top of tcp, not just udp.
  • Loading branch information
roikol authored Jun 7, 2022
1 parent 69c7765 commit 5626d26
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions pkg/ebpf/c/tracee.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -5378,16 +5378,10 @@ static __always_inline void set_net_event_id(net_packet_t *pkt)
DNS = 53,
};

switch (pkt->protocol) {
case IPPROTO_UDP:
if (pkt->dst_port == DNS)
pkt->event_id = DNS_REQUEST;
if (pkt->src_port == DNS)
pkt->event_id = DNS_RESPONSE;
break;
default:
pkt->event_id = NET_PACKET;
}
if (pkt->dst_port == DNS)
pkt->event_id = DNS_REQUEST;
if (pkt->src_port == DNS)
pkt->event_id = DNS_RESPONSE;
}

// some network events might need payload (even without capture)
Expand Down

0 comments on commit 5626d26

Please sign in to comment.