# HowTo Define nDPI Risk Exceptions for Networks and Domains | ntop

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

# HowTo Define nDPI Risk Exceptions for Networks and Domains

January 14, 20222 min read

In the past couple of years we have added the concept of flow risk in nDPI that allows issues with flows to be detected (for instance expired TLS certificates). Unfortunately we need to silence some of these risk exceptions as some hosts/domain names produce risks that need to be ignored (for instance an outdated device that cannot be replaced and that has been properly protected by the security policies). In ntopng you can disable them clicking on the flow alert that will open a window as the one below,

![](/images/2022/01/Screen_Shot_2022-01-14_at_22_08_50.webp)

and review exclusions from the settings menu:

![](/images/2022/01/Screen-Shot-2022-01-14-at-22.11.20.webp)

This feature is useful when a few exceptions need to be silenced, but it is limited when you want to set more exceptions based on domain names or networks (CIDR). Not to mention that other nDPI-based tools such as nProbe don’t feature this mechanism.

In order to address this need, you can specify a [nDPI protocol file](https://github.com/ntop/nDPI/blob/dev/example/protos.txt) that contains exceptions as follows:

#
# Risk Exceptions
#
# ip\_risk\_mask:   used to mask flow risks for IP addresses
# host\_risk\_mask: used to mask exceptions for domain names and hosts
#
# Syntax: <name>=<64 bit mask to be put in AND with the risk
#
# For IPs, the flow risk is put in AND (source IP mask OR destination IP mask)
# For Flows with a hostname (e.g. TLS) the risk is also put in AND with the host\_risk\_mask
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

where you can specify a list of networks and domain names for which risks can be masked. A 0 mask means all risks are masked, whereas you can specify a bitmap for masking specific risks. [Here](https://github.com/ntop/nDPI/blob/dev/src/include/ndpi_typedefs.h#L77) you can find the list of known risks so if you want to mask for CIDR 192.168.1.0/24 the risk TLS Certificate Mismatch (id 10), you need to create a 64 bit mask with bit 10 set to zero and all bits set to 1 (i.e. 0xFFFFFFFFFFFFFDFF in hex).

You can pass this protocol file to ntopng as

\[--ndpi-protocols|-p\] <file>.protos | Specify a nDPI protocol file
                                    | (eg. protos.txt)

and as

\--ndpi-custom-protos <path>         | Custom nDPI protocols path.

in nProbe.

In addition to this, it is also possible to specify trusted CA certification authorities, often used to issue TLS certificates used in company networks. This can be defined in the protocols file as follows:

\# Custom certification autorities we trust
trusted\_issuer\_dn:"CN=813845657003339838, O=Code42, OU=TEST, ST=MN, C=US"

so that nDPI will not generate TLS Certificate self-signed for the above CA.

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/howto-define-ndpi-risk-exceptions-for-networks-and-domains/