WACElib loads model plugins as Go shared objects (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tilsor/ModSecIntl_wace_lib/llms.txt
Use this file to discover all available pages before exploring further.
.so files) at startup. The PluginManager uses Go’s plugin package to look up exported symbols by name. A model plugin must export either the sync or async entry points depending on its configured mode. The correct interface is determined by the mode and remote fields in the plugin configuration: sync non-remote plugins export InitPlugin and Process; async plugins and remote-sync plugins export InitPluginAsync.
Entry points by mode
- Sync (mode: sync, remote: false)
- Async / remote-sync (mode: async or remote: true)
Sync plugins are called directly in-process. The Called once when the plugin is loaded. Use this function to load model weights, open connections, or perform any one-time initialisation. Return a non-nil error to signal a fatal initialisation failure; the
Called once per transaction for each call to
Returns a Build command:
PluginManager calls InitPlugin once at startup and then calls Process for every transaction that targets this plugin.InitPlugin
PluginManager logs a warning and skips the plugin.| Parameter | Type | Description |
|---|---|---|
params | map[string]string | Key-value pairs from the plugin’s params block in the configuration YAML. |
meter | metric.Meter | OpenTelemetry meter for recording plugin-level metrics. |
Process
wace.Analyze that names this plugin. Runs in its own goroutine; the PluginManager waits on a channel for the result.| Parameter | Type | Description |
|---|---|---|
input | pluginmanager.ModelInput | Contains the TransactionId and the HTTPPayload to score. |
ModelResults with ProbAttack in [0.0, 1.0] and optional Data. Return a non-nil error if the plugin cannot process the input; the error is logged and the transaction continues without this plugin’s result.Minimal sync plugin
Configuration reference
WACElib skips (logs a warning for) any plugin whose exported symbol does not
match the expected function signature. If a sync plugin is accidentally
compiled with the wrong
Process signature, it will not be invoked but
Init will not return an error.