-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ndpi: ndpi as a plugin - v5 #12423
Open
jasonish
wants to merge
6
commits into
OISF:master
Choose a base branch
from
jasonish:ish/ndpi/plugin/v5
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+762
−35
Open
ndpi: ndpi as a plugin - v5 #12423
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3f5f16d
ndpi: initial implementation of nDPI plugin
cardigliano 2079242
github-ci: add ndpi build to the centos-stream9 build
jasonish b36597e
eve/schema: add top level ndpi object
jasonish 468464b
rust/transforms/hash: don't no_mangle non-pub functions
jasonish 70984d8
ndpi: check for flow earlier in eve callback
jasonish b7fa276
detect: split new keyword id from registration
jasonish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
nDPI Protocol Keyword | ||
===================== | ||
|
||
ndpi-protocol | ||
------------- | ||
|
||
Match on the Layer-7 protocol detected by nDPI. | ||
|
||
Suricata should be compiled with the nDPI support and the ``ndpi`` | ||
plugin must be loaded before it can be used. | ||
|
||
Example of configuring Suricata to be compiled with nDPI support: | ||
|
||
.. code-block:: console | ||
./configure --enable-ndpi --with-ndpi=/home/user/nDPI | ||
Example of suricata.yaml configuration file to load the ``ndpi`` plugin:: | ||
|
||
plugins: | ||
- /usr/lib/suricata/ndpi.so | ||
|
||
Syntax:: | ||
|
||
ndpi-protocol:[!]<protocol>; | ||
|
||
Where protocol is one of the application protocols detected by nDPI. | ||
Plase check ndpiReader -H for the full list. | ||
It is possible to specify the transport protocol, the application | ||
protocol, or both (dot-separated). | ||
|
||
Examples:: | ||
|
||
ndpi-protocol:HTTP; | ||
ndpi-protocol:!TLS; | ||
ndpi-protocol:TLS.YouTube; | ||
|
||
Here is an example of a rule matching TLS traffic on port 53: | ||
|
||
.. container:: example-rule | ||
|
||
alert tcp any any -> any 53 (msg:"TLS traffic over DNS standard port"; ndpi-protocol:TLS; sid:1;) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
nDPI Risk Keyword | ||
================= | ||
|
||
ndpi-risk | ||
--------- | ||
|
||
Match on the flow risks detected by nDPI. Risks are potential issues detected | ||
by nDPI during the packet dissection and include: | ||
|
||
- Known Proto on Non Std Port | ||
- Binary App Transfer | ||
- Self-signed Certificate | ||
- Susp DGA Domain name | ||
- Malware host contacted | ||
- and many other... | ||
|
||
Suricata should be compiled with the nDPI support and the ``ndpi`` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. requires support |
||
plugin must be loaded before it can be used. | ||
|
||
Example of configuring Suricata to be compiled with nDPI support: | ||
|
||
.. code-block:: console | ||
|
||
./configure --enable-ndpi --with-ndpi=/home/user/nDPI | ||
|
||
Example of suricata.yaml configuration file to load the ``ndpi`` plugin:: | ||
|
||
plugins: | ||
- /usr/lib/suricata/ndpi.so | ||
|
||
Syntax:: | ||
|
||
ndpi-risk:[!]<risk>; | ||
|
||
Where risk is one (or multiple comma-separated) of the risk codes supported by | ||
nDPI (e.g. NDPI_BINARY_APPLICATION_TRANSFER). Please check ndpiReader -H for the | ||
full list. | ||
|
||
Examples:: | ||
|
||
ndpi-risk:NDPI_BINARY_APPLICATION_TRANSFER; | ||
ndpi-risk:NDPI_TLS_OBSOLETE_VERSION,NDPI_TLS_WEAK_CIPHER; | ||
|
||
Here is an example of a rule matching HTTP traffic transferring a binary application: | ||
|
||
.. container:: example-rule | ||
|
||
alert tcp any any -> any any (msg:"Binary application transfer over HTTP"; ndpi-protocol:HTTP; ndpi-risk:NDPI_BINARY_APPLICATION_TRANSFER; sid:1;) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,7 @@ endif | |
if BUILD_NAPATECH | ||
SUBDIRS += napatech | ||
endif | ||
|
||
if BUILD_NDPI | ||
SUBDIRS += ndpi | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
pkglib_LTLIBRARIES = ndpi.la | ||
|
||
ndpi_la_LDFLAGS = -module -avoid-version -shared | ||
ndpi_la_LIBADD = @NDPI_LIB@ | ||
|
||
# Only required to find these headers when building plugins from the | ||
# source directory. | ||
ndpi_la_CFLAGS = -I../../rust/gen -I../../rust/dist | ||
|
||
ndpi_la_SOURCES = ndpi.c | ||
|
||
install-exec-hook: | ||
cd $(DESTDIR)$(pkglibdir) && $(RM) $(pkglib_LTLIBRARIES) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to mention the requires rule support here as well I think