Tags in ntopng: Automatically Spot (and Track) Misconfigured Hosts

5 min read

Network administrators know the drill: somewhere on a network with hundreds or thousands of hosts, a handful of machines are still doing something they shouldn't — an old laptop still fetching mail over plaintext IMAP, a workstation still opening Telnet sessions to the routers, a device still talking an obsolete version of TLS. These misconfigurations rarely show up on a dashboard by themselves. Someone has to go looking for them, one flow at a time, and by the time they do, the issue may have been sitting there for months.

ntopng tags already let administrators label hosts — mark a set of servers as "Critical", a device as "IoT", a laptop as "BYOD" — and use those labels to filter traffic, route alerts and build an asset inventory. What tags couldn't do, until now, is watch the network and label hosts automatically, and forget the label when it is no longer true.

What's New

In the latest ntopng development builds (Enterprise L and above), a user-defined tag can be bound to one or more network applications and/or one or more flow risks, directly from the tag edit dialog. Once that binding exists, ntopng takes over: every time a flow is classified as one of the linked applications, or raises one of the linked risks, both the flow and its local client host are tagged automatically — no manual host-by-host triage required.

From that point on, the tag behaves exactly like any tag assigned by hand:

  • It shows up as a badge on the flow, in Live Flows and Historical Flows.
  • It shows up on the host, in the Hosts list and Host Details page.
  • It is copied to the host entry of the Assets Inventory, so the Assets page can be filtered by that tag to produce an always-up-to-date list of every device that has been observed doing the thing you're watching for.

That last point is the one worth dwelling on: instead of hunting through flow tables for misconfigured hosts, you check one filtered list on the Assets page and you're done.

There is one more piece that makes that list trustworthy over time. A tag can now have a TTL (Time To Live): if nothing confirms the tag on an asset for the configured number of days, ntopng removes it on its own. A host that stops doing the thing you're watching for quietly drops off the list — no manual cleanup required either.

Finding Hosts Still Sending Mail in the Clear

Here's a simple, concrete example: catching hosts that are still talking to a mail server over unencrypted IMAP, POP3 or SMTP instead of their TLS-protected counterparts. This is a surprisingly common finding — an old mail client that was never migrated, a script that sends its reports without TLS, a device whose configuration silently reverted after an update.

  1. Open Settings → Tags, pick one of the 32 user-defined tags (they start out named Customizable_Tag_32 through Customizable_Tag_63) and choose Edit Tag in its actions menu.

    Tags page listing built-in and user-defined tags

  2. Rename the tag to something descriptive — UnsafeMail works well — and pick a color.

  3. In the Applications field, add IMAP, POP3 and SMTP. Leave their encrypted counterparts (IMAPS, POPS, SMTPS) out, since those are exactly the protocols that should not be flagged. Then turn on the TTL switch and set it to 7 days — we'll come back to why in a moment.

    Tag edit dialog with the Applications field populated and a TTL of 7 days

  4. Save. No restart, no configuration file to edit — the binding is active immediately.

  5. Let normal traffic flow. As soon as any host on the network exchanges mail over one of the three plaintext protocols, ntopng tags both the flow and the client host UnsafeMail. Note that it is the client that gets the tag — the PC with the misconfigured mail client — not the mail server it talks to.

  6. Open that host's page: the tag appears as a badge as soon as the first matching flow is seen, next to the built-in tags ntopng assigns by itself (here the Operating System of the host).

    Host Details page showing the UnsafeMail tag badge

  7. Open the Assets page and filter by the UnsafeMail tag to get the full list network-wide.

    Assets page filtered by the UnsafeMail tag

That filtered list is exactly the set of machines to go fix.

...and Watching the List Shrink

So you start fixing them: one mail client reconfigured today, a script switched to TLS tomorrow. Here's where the TTL from step 3 earns its place. You don't have to go back to ntopng and untag anything:

  • A host that has really been fixed stops producing plaintext mail flows. Nothing refreshes its UnsafeMail tag anymore and, about 7 days after its last offending flow, the tag is removed from the asset. The host disappears from the filtered list by itself.
  • A host that was not fixed — or whose configuration silently reverted, again — keeps generating those flows, and every one of them refreshes the tag. It stays on the list for as long as it keeps misbehaving.

The result is that the filtered Assets page stops being "every host that has ever sent mail in the clear" and becomes "the hosts that are still doing it": a to-do list that gets shorter as the work gets done, and that tells you, a week later, whether a fix actually stuck.

Without a TTL the tag would stay on those assets forever. The list could only grow, and the only way to tell the fixed machines from the ones still waiting would be to remember — or to remove the tag by hand, one host at a time.

It Works with Flow Risks Too

Applications aren't the only thing a tag can watch for. The same edit dialog has a Flow Risks field that works identically: bind a tag to one or more of nDPI's flow risks — a self-signed certificate, an obsolete TLS version, clear-text credentials and dozens more — and any flow (and its client host) that raises one of those risks gets tagged the same way, with the same TTL behavior. Between applications and risks, a single tag can express almost any "find me hosts that do X" rule an administrator can think of, and ntopng keeps the answer current on its own.

Getting the Right People Notified

Since the tag is on the flows and on the hosts, it is also on the alerts they trigger, and tags are a handy way to decide who gets notified: a notification policy can be limited to the alerts carrying some tags. For instance, route the alerts of the hosts tagged UnsafeMail to the team that manages the mail clients, and leave the rest of the alerts where they are.

Enjoy!

Give it a try on your own network! All the details are in the Tags section of the ntopng User's Guide and, as always, feedback and questions are welcome on our GitHub or Telegram channels.

Try it on your own network

Download the free Community edition and see your first flows in five minutes.