I'm writing my own parser for transforming the syslog output from the ASA firewall into CSV for deeper analysis. What I don't get, is why the "for" and "to" machines are switched when the traffic is outbound.
Let's say I have a DMZ interface which is the "out" zone and a LAN interface which is the "in" zone.
When I RDP from an outside pc into an inside PC I see this:
%ASA-6-302013: Built inbound TCP connection 21955057 for DMZ:192.168.1.110/56388 (192.168.1.110/56388) to LAN:192.168.2.110/3389 (192.168.2.110/3389)
As expected the computer 192.168.1.110 in the DMZ is making a RDP connection from a random port to TCP/3389 of the computer 192.168.2.110 in the LAN network. The connection is inbound because it comes from the outer interface the firewall into the network protected by it.
What happens though when I make a connection from the computer inside the LAN to a computer in the DMZ?
%ASA-6-302013: Built outbound TCP connection 13538633 for DMZ:192.168.1.110/3389 (192.168.1.110/3389) to LAN:192.168.2.110/50927 (192.168.2.110/50927)
The "for" and "to" stay the same and the only way to know that the communication started from the "to" host is the outbound keyword in the message (other than the ports, but it's not always obvious).
So what I did in my parser is writing regular expressions to extract the address and port after the "for" and put it in my "source" columns, same for the "to" and label them as "destination" and switch the source with the destination if the communication is inbound
Am I doing this right? Isn't this syntax convoluted and misleading? Things get even worse with ICMP as there are echo request and echo replies and finding out who's pinging who gets even more complicated.