What AppID does
Theappid inspector provides:
- Network control: Exposes application identifiers (AppIds) as a matching condition in IPS rules. Rules can block, allow, or alert based on the application — not just port and protocol.
- Application usage statistics: Periodically writes application usage counts to the Snort log directory in unified2 format.
- Custom detectors: Administrators can write Lua detectors for proprietary or internal applications using a well-defined C-Lua API.
- Open Detector Package (ODP): A package of pre-built Lua detectors maintained by the Snort team, available from snort.org.
How it integrates with the detection pipeline
AppID is a passive inspector (IT_PASSIVE). It does not modify packets. Instead, it subscribes to inspection events published by other inspectors:
- HTTP inspector — provides URL, host, User-Agent, and response data for web application identification.
- SSL inspector — provides SNI and certificate fields for encrypted traffic identification.
- SIP inspector — provides call metadata for VoIP application identification.
- DCE/RPC inspector — provides interface UUIDs for Windows service identification.
Session application identifiers
AppID stores up to four identifiers per session:| Identifier | Description | Example |
|---|---|---|
serviceAppId | Application on the server side | HTTP server |
clientAppId | Application on the client side | Firefox |
payloadAppId | For services like HTTP: the web application being accessed | |
miscAppId | For encapsulated protocols: the highest encapsulated application | — |
appids fires, the AppIds are matched in this order for client-originating packets: payloadAppId, miscAppId, clientAppId, serviceAppId. For server-originating packets the order changes to place serviceAppId before clientAppId.
Dependency requirements
AppID requires stream tracking to be enabled at minimum. To identify specific transport protocol applications, the corresponding stream inspector must also be active:http_inspect must be configured. Without it, only non-HTTP applications are identified.
Configuration
Enable AppID with default settings:Using AppID in rules
The appids keyword
Use the appids keyword in an IPS rule body to restrict the rule to specific applications:
Protocol in the rule header
When AppID has identified the service on a flow, the service name can be used in place of the transport protocol in the rule header:Minimal working configuration
This is a completesnort.lua configuration sufficient to block flows based on a detected HTTP header:
Open Detector Package (ODP)
The ODP is a collection of Lua-based application detectors maintained by the Snort team. It can be downloaded from snort.org and installed in any directory.Install the package
Extract the package to a directory of your choice. ODP creates:Installing ODP will not modify any existing
custom/ subdirectory.User-created application detectors
Custom detectors are Lua scripts placed in thecustom/lua/ directory under app_detector_dir:
Using the detector creation tool
A helper script,appid_detector_builder.sh, generates Lua detector skeletons interactively:
- An application name (becomes the AppId and file name).
- An optional description (placed in comments).
- The protocol, port, and detection pattern.
.lua file must be placed in custom/lua/.
Application usage statistics
AppID periodically writes application network usage to the Snort log directory in unified2 format. The file name, reporting interval, and rollover behavior are controlled by AppID configuration options. Useu2spewfoo to read unified2 output files:

