Skip to content

Commit 72a45ee

Browse files
committed
Added risk for detecting on PQC flows
1 parent 24d88cf commit 72a45ee

5 files changed

Lines changed: 18 additions & 1 deletion

File tree

doc/flow_risks.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,3 +352,9 @@ This risk is triggered when a connection is likely using some obfuscation techni
352352
NDPI_SLOW_DOS
353353
=======================
354354
This risk is triggered when a TCP connection is likely subject to slow DoS attacks
355+
356+
.. _Risk 058:
357+
358+
NDPI_NON_OQC
359+
============
360+
This risk is triggered when an encrypted stream (e.g. TLS, QUIC, SSH, IPSEC) is not using post-quantum cryptography algorithms.

src/include/ndpi_typedefs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ typedef enum {
170170
NDPI_PROBING_ATTEMPT, /* Probing attempt (e.g. TCP connection with no data exchanged or unidirection traffic for bidirectional flows such as SSH) */
171171
NDPI_OBFUSCATED_TRAFFIC,
172172
NDPI_SLOW_DOS,
173+
NDPI_NON_PQC, /* Set in case an encryped traffic stream does not comply with post-quantum encryotion */
173174
/* Before allocating a new risk here, check if there are FREE entries above */
174175

175176
/* Leave this as last member */

src/lib/ndpi_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ static ndpi_risk_info ndpi_known_risks[] = {
220220
{ NDPI_PROBING_ATTEMPT, NDPI_RISK_MEDIUM, CLIENT_FAIR_RISK_PERCENTAGE, NDPI_CLIENT_ACCOUNTABLE },
221221
{ NDPI_OBFUSCATED_TRAFFIC, NDPI_RISK_HIGH, CLIENT_HIGH_RISK_PERCENTAGE, NDPI_BOTH_ACCOUNTABLE },
222222
{ NDPI_SLOW_DOS, NDPI_RISK_HIGH, CLIENT_HIGH_RISK_PERCENTAGE, NDPI_CLIENT_ACCOUNTABLE },
223+
{ NDPI_NON_PQC, NDPI_RISK_MEDIUM, CLIENT_FAIR_RISK_PERCENTAGE, NDPI_BOTH_ACCOUNTABLE },
223224

224225
/* Leave this as last member */
225226
{ NDPI_MAX_RISK, NDPI_RISK_LOW, CLIENT_FAIR_RISK_PERCENTAGE, NDPI_NO_ACCOUNTABILITY }

src/lib/ndpi_utils.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2734,6 +2734,9 @@ const char* ndpi_risk2str(ndpi_risk_enum risk) {
27342734
case NDPI_SLOW_DOS:
27352735
return("(Possible) Slow DoS");
27362736

2737+
case NDPI_NON_PQC:
2738+
return("Non PQC Compliant Flow");
2739+
27372740
default:
27382741
ndpi_snprintf(buf, sizeof(buf), "%d", (int)risk);
27392742
return(buf);
@@ -2862,6 +2865,8 @@ const char* ndpi_risk2code(ndpi_risk_enum risk) {
28622865
return STRINGIFY(NDPI_OBFUSCATED_TRAFFIC);
28632866
case NDPI_SLOW_DOS:
28642867
return STRINGIFY(NDPI_SLOW_DOS);
2868+
case NDPI_NON_PQC:
2869+
return STRINGIFY(NDPI_NON_PQC);
28652870

28662871
default:
28672872
return("Unknown risk");
@@ -2987,6 +2992,8 @@ ndpi_risk_enum ndpi_code2risk(const char* risk) {
29872992
return(NDPI_OBFUSCATED_TRAFFIC);
29882993
else if(strcmp(STRINGIFY(NDPI_SLOW_DOS), risk) == 0)
29892994
return(NDPI_SLOW_DOS);
2995+
else if(strcmp(STRINGIFY(NDPI_NON_PQC), risk) == 0)
2996+
return(NDPI_NON_PQC);
29902997
else
29912998
return(NDPI_MAX_RISK);
29922999
}
@@ -3130,7 +3137,8 @@ const char *ndpi_risk_shortnames[NDPI_MAX_RISK] = {
31303137
"binary_data_transfer",
31313138
"probing",
31323139
"obfuscated",
3133-
"slow_DoS"
3140+
"slow_DoS",
3141+
"non_PQC"
31343142
};
31353143

31363144
/* ******************************************************************** */

wireshark/ndpi.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ flow_risks[54] = ProtoField.bool("ndpi.flow_risk.binary_data_transfer", "Attempt
141141
flow_risks[55] = ProtoField.bool("ndpi.flow_risk.probing_attempt", "Probing attempt", num_bits_flow_risks, nil, bit(55), "nDPI Flow Risk: probing attempt")
142142
flow_risks[56] = ProtoField.bool("ndpi.flow_risk.obfuscated_traffic", "Obfuscated Traffic", num_bits_flow_risks, nil, bit(56), "nDPI Flow Risk: obfuscated traffic")
143143
flow_risks[57] = ProtoField.bool("ndpi.flow_risk.slow_dos", "Slow DoS", num_bits_flow_risks, nil, bit(56), "nDPI Flow Risk: slow DoS attempt")
144+
flow_risks[57] = ProtoField.bool("ndpi.flow_risk.non_pqc", "Non PQC", num_bits_flow_risks, nil, bit(56), "nDPI Flow Risk: non PQC traffic)
144145

145146
-- Last one: keep in sync the bitmask when adding new risks!!
146147
flow_risks[64] = ProtoField.new("Unused", "ndpi.flow_risk.unused", ftypes.UINT64, nil, base.HEX, bit(64) - bit(57))

0 commit comments

Comments
 (0)