This guide explains how to configure HAProxy and the OneFirewall Fluent Bit adapter to collect HTTP traffic logs, forward them to OneFirewall, and enable pattern detection aligned with MITRE ATT&CK techniques.Documentation Index
Fetch the complete documentation index at: https://docs.onefirewall.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The integration uses HAProxy as the ingress point and Fluent Bit as the log collection and forwarding layer.- HAProxy emits structured access logs with the
HAPROXY_LOGprefix. - Fluent Bit receives HAProxy syslog events over UDP.
- The OneFirewall Fluent Bit adapter parses the records using
catchall_parser. - OneFirewall analyzes the traffic for malicious behavior and pattern detection mapped to MITRE ATT&CK.
- Optional IPS reporting can send suspicious IP intelligence back to the OneFirewall cloud.
1. HAProxy Logging Configuration
Update theglobal section of your haproxy.cfg to send logs both to stdout and to the Fluent Bit adapter over UDP.
172.17.0.1:31514 and forwards UDP traffic to container port 514.
2. HAProxy Frontend Configuration
In the HAProxy frontend, capture the relevant request headers and define a log format that the OneFirewall Fluent Bit adapter can parse.http-request set-var(txn.xff) hdr(X-Forwarded-For)stores the original client IP from theX-Forwarded-Forheader.log-format "HAPROXY_LOG ..."emits a predictable log structure containing the original IP, connection metadata, HTTP protocol, raw request, and status code.
| Field | Description |
|---|---|
HAPROXY_LOG | Static prefix used by the parser |
%[var(txn.xff)] | Original client IP from X-Forwarded-For |
%ci | HAProxy client IP |
%cp | Client source port |
%fp | Frontend destination port |
%H | HTTP protocol version |
%r | Full HTTP request line |
%ST | HTTP response status code |
3. OneFirewall Fluent Bit Adapter
Add the OneFirewall Fluent Bit adapter to your Docker Compose stack.For
OFA_API_URL, provide only the protocol, host, and optional port, for example https://app.onefirewall.com or http://localhost:8080. Do not include the API path; the adapter resolves the required endpoint automatically.4. Environment Variables
| Variable | Purpose |
|---|---|
FIREWALL_PARSER | Selects the parser used by the adapter. Use catchall_parser for this HAProxy log format. |
OFA_JWT_TOKEN | Token used to authenticate with the target OneFirewall API. |
OFA_API_URL | OneFirewall API base URL cloud or local installation for clients. Use only protocol, host, and optional port. |
OFA_MIN_SCORE_TO_LOG | Minimum score required before events are logged by the adapter. |
OFA_MEMBER_ID | OneFirewall member identifier, used when sending data directly to Elasticsearch. |
OFA_API_URL_CLOUD | OneFirewall cloud URL used for IPS partner reporting, or local client installation if partner contribute or not to the OneFirewall Alliance |
OFA_JWT_TOKEN_CLOUD | Token used for IPS report submission to the OneFirewall cloud. |
OFA_AGENT | Agent type reported to OneFirewall. For HAProxy WAF deployments, use haproxy_waf. |
OFA_AGENT_LID | Local identifier for this reporting agent. |
OFA_AGENT_TAGS | Tags associated with the generated reports. |
OFA_CONTRIBUTE | Enables or disables contribution mode. Use 0 to disable contribution. |
OFA_IPS_FLUSH_INTERVAL | Interval, in seconds, used to flush IPS reports. |
OFA_IPS_LIMIT | Maximum number of IPS items sent per flush. |
OFA_IPS_WORDS | Keywords used to select IPS events. Values must be lowercase and comma-separated. |
OFA_IPS_PORTS | Ports associated with IPS reporting. |
SEND_TRAFFIC | Enables traffic forwarding to OneFirewall when set to yes. |
ENABLE_ELASTIC_OUTPUT | Enables or disables Elasticsearch output routing. |
ELASTIC_IP, ELASTIC_PORT, ELASTIC_INDEX | Elasticsearch destination settings when direct Elasticsearch output is enabled. |
5. MITRE ATT&CK Pattern Detection Flow
With this configuration, HAProxy provides enough context for OneFirewall to analyze web traffic and detect suspicious patterns. TheHAPROXY_LOG records allow OneFirewall to evaluate request behavior such as suspicious paths, attack tooling, anomalous source IPs, abusive request patterns, and other indicators associated with MITRE ATT&CK techniques.
6. Validation Checklist
After deploying the configuration, verify the following:- HAProxy starts successfully with the updated
globalandfrontendconfiguration. - UDP port
31514is bound on172.17.0.1by the Fluent Bit adapter. - HAProxy logs contain the
HAPROXY_LOGprefix. - The Fluent Bit adapter logs show parsed records matching
*_ofa_logs. - OneFirewall receives traffic events from the
haproxy_wafagent. - IPS reporting is enabled only when
OFA_API_URL_CLOUDandOFA_JWT_TOKEN_CLOUDare configured with valid cloud credentials.

