# Configuring nDPI Flow Risk Exceptions | ntop

[Blog](https://www.ntop.org/blog/)[nDPI](https://www.ntop.org/category/ndpi/)

# Configuring nDPI Flow Risk Exceptions

August 4, 20211 min read

One of the newest features of nDPI 4 is the ability to identify [flow risks](https://www.ntop.org/how-to-spot-unsafe-communications-using-ndpi-flow-risk-score/). Unfortunately sometimes you need to add exceptions as some of those risks, while correct, need to be ignored. Examples include:

-   An old device that is speaking an outdate TLS version but that you cannot upgrade, and that you have done your best to protect.
-   A host name that looks like a [DGA](https://en.wikipedia.org/wiki/Domain_generation_algorithm) but that it isn’t.
-   A service running on a non-standard port but that works perfectly as is.

In order to address the need to specify exceptions to nDPI identified flow risks, you can define a mask for turning off specific flow risks for selected IP addresses ([CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) is supported) and hostnames. nDPI allows you to specify a file where you can [define custom protocols](https://github.com/ntop/nDPI/blob/dev/example/protos.txt) (please note that tools like ndpiReader, ntopng and nprobe all support custom protocols via this configuration file).

ip\_risk\_mask:192.168.1.0/24=0
ip\_risk\_mask:10.196.157.228=0
host\_risk\_mask:".local"=0
host\_risk\_mask:".msftconnecttest.com"=0

The syntax is pretty straightforward:

-   Token name: either ip\_risk\_mask (for IP addresses) or host\_risk\_mask (for hostnames).
-   Mask: the flow risk identified is put in AND with this mask before output. Note that in the above example a 0 mask is used meaning that no risks will be generated for the IPs specified (either flow source or destination) or for hostnames matching the names.

For instance the above examples silence flow risks for the specific hosts 192.168.1.0/24 and 10.196.157.228, as well for all hostnames ending with .local or .msftconnecttest.com.

You can define multiple rules, one per line, and nDPI will honour your choice. No more unwanted flow risk alerts.

Enjoy!

## Keep reading

AINov 7, 2026

### [Sharkfest 26EU: HowTo Detect Stealth VPN and AI Inference Traffic](https://www.ntop.org/sharkfest-26eu-howto-detect-stealth-vpn-and-ai-inference-traffic/)

Earlier this week we have presented at Sharkfest Europe 2026 a presentation of our work about traffic detection of Stealth VPNs and AI Inference. The presentation addresses the challenges of detecting modern obfuscated network traffic, specifically from stealth VPNs and custom/local artificial intel

nDPINov 7, 2026

### [Detecting CVE-2026-98432 using nDPI/ntopng](https://www.ntop.org/detecting-cve-2026-98432-using-ndpi-ntopng/)

CVE-2026-98432 is a critical, 9.8-severity use-after-free (UAF) vulnerability in the Linux kernel’s IPv4 TCP networking stack. It allows an unauthenticated remote attacker to potentially cause system crashes, memory corruption, or execute arbitrary commands with root privileges. From a network stand

nDPISep 29, 2026

### [Introducing the nDPI TCP Fingerprint: A Stable, Patent-Free Way to Fingerprint TCP Stacks](https://www.ntop.org/introducing-the-ndpi-tcp-fingerprint-a-stable-patent-free-way-to-fingerprint-tcp-stacks/)

Every TCP connection starts with a SYN, and that first packet says a lot about the machine that sent it. The Linux, Windows, macOS and Android stacks each set different flags, choose…

## Try it on your own network

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

[Download ntopng free](https://www.ntop.org/support/documentation/software-installation/)[Talk to an engineer](https://www.ntop.org/support/need-help/contacts/)
Source: https://www.ntop.org/configuring-ndpi-flow-risks-exceptions/