sipcapture / homer-app

HOMER 7.x Front-End and API Server
http://sipcapture.io
GNU Affero General Public License v3.0
204 stars 79 forks source link

Aliases seemingly not taking captureID into account #447

Closed gedia closed 2 years ago

gedia commented 2 years ago

Hello all,

I don't expect this to affect that many people, but I thought I'd open an issue anyway. There seems to be an issue when determining aliases for IP addresses, more specifically when an IP address appears more than once in the flow (e.g. when capturing from two different VRFs each of which contains a host with the same IP). Here's an example:

                                                                         │                       
          alias proxA              alias myB2BUA                    alias proxB
                                                                         │                       
           ┼─────────┼            ┼──────────────┼                  ┼─────────┼   
           │         │            │              │                  │         │                 
           │         │            │              │                  │         │                 
    1.1.1.1┼         ┼10.10.10.1  │ 10.10.10.100 │      10.10.10.200┼         ┼1.1.1.1               
           │         │            │              │                  │         │                 
           │nodeid: 1│            │   nodeid: 2  │                  │nodeid: 3│                
           ┼─────────┼            ┼──────────────┼                  ┼─────────┼                 
                                                                         │                       
                                                                         │                       
                                                                         │                       
                                                              global VRF │ red VRF              
─────────────────────────────────────────────────────────────────────────┼───────────────────────

In the above example, ProxA and ProxB are multihomed, each with two interfaces. The "public" interface of either is configured with the same IP address, which is legitimate as they reside on different VRFs. Non-globally routable IP addresses are unique across all hosts. myB2BUA is single-homed.

Now if ProxA and ProxB are configured to mirror their SIP traffic to homer via hep, and each is configured with a distinct captureID, there should be a way of assigning a proper alias to either when displaying the flow diagrams in homer-ui. However, this appears not to be the case in my experience:

Alias           IP Address          Port            Mask            CaptureID
ProxA           1.1.1.1             5060            32              1
ProxB           1.1.1.1             5060            32              3

In such a configuration, aliases seem to be randomly assigned to hosts in SIP flows, so that IP 1.1.1.1 will sometimes be assigned the alias "ProxA" and "ProxB" at other times. I was wondering whether there could be an easy fix for this? Ideally, captID should only be taken into account when there are more than one aliases matching for a set of (ippadr,port,mask), and ignored if these criteria can determine a single alias by themselves.

adubovikov commented 2 years ago

@gedia please install 1.4.18

and add this setting to your webapp.json

"api_settings": {
    "add_captid_to_resolve": true
  }
gedia commented 2 years ago

Hello again. This appears to be working!

However, I'm experiencing some regressions with stability and UI robustness with the latest versions. I'll try to figure out if there's some reproducibility and open a new issue.

adubovikov commented 2 years ago

@gedia thank you! Let us know and we will be happy to fix it.