How do I send WAF logs to a SIEM; which formats carry attack information in a structured way (CEF, JSON)?
Short answer
For SIEM integration, WAF records are sent over syslog with a Logs profile assigned to the vService: the profile is created with Load Balancer → Profiles → Logs → Add, and Log Addresses (UDP or TCP, address, port), Log Standard and Line Format are selected; in the edit form of the vService, LOG is checked, the profile is selected in the Log Profile field and Save is clicked. The formats that carry the attack information (WAF info) in a structured way: CEF Format (isWafAttack and wafInfo fields), TR7 JSON Format ("isWafAttack" and "wafInfo" keys), TR7 WAF Log (the whole line is the JSON of the attack information; only blocked requests) and, with the %WAFINFO variable, Manual JSON Format, Manual CEF Format or Manual Log Line Format. The Standard Log Format, Apache Combined Log Format and Apache VHost Log Format formats do not carry attack information. CEF and TR7 JSON send all requests; if there is no attack, wafInfo is an empty object ({}), and isWafAttack becomes 1 only in blocked requests. The content of the attack information (fields, payload, language) is determined in the SIEM & Attack Details card on WAF Management.
Problem: WAF Records Are Wanted in the SIEM
Event Logs records are kept on the device and are deleted by the Disk Management rules. For the attacks to be monitored together with the other sources, correlated and stored for a long time in the organization's SIEM, the records must be sent out with syslog. In TR7, WAF records are sent by the same path as the access logs of the vService, with the log profile; the attack information is added to the line according to the format of the profile.
Solution: Three Methods
| Your situation | Suitable method |
|---|---|
| All requests in the SIEM, the attack information on the same line | Method 1: CEF Format or TR7 JSON Format |
| Only blocked attacks to the SIEM | Method 2: TR7 WAF Log |
| A special line structure that the SIEM expects | Method 3: Manual formats and %WAFINFO |
Method 1: CEF Format or TR7 JSON Format Recommended
- How it works One line is sent for each HTTP request; the line contains the
isWafAttackandwafInfofields together with the information of the request. In requests in which an attack is found (blocked, passed in Monitor mode, recognized by Teacher, or staying below the threshold and triggering a signature in the Monitor state),wafInfocarries the attack list (CEF · WAF Information). - Where it is openedLoad Balancer → Profiles → Logs · vService edit form → Details → LOG
- Requirement Modify permission in the Load Balancer area (the Logs profile and the vService form are on Load Balancer screens); syslog access from TR7 to the SIEM (UDP or TCP); WAF protection on the vService; modify permission in the WAF area for the SIEM & Attack Details card
- vService type HTTP
Step-by-Step Configuration
The profile form is opened with Load Balancer → Profiles → Logs → Add (how to add).
Name is entered. In the Log Addresses row, the protocol (UDP or TCP), the address of the SIEM (e.g. 192.0.2.50) and its port (e.g. 514) are entered; another target can be added with +.
Log Standard is selected according to the header that the SIEM expects (e.g. rfc5424). CEF Format or TR7 JSON Format is selected as the Line Format.
Add in the form is clicked.
On the Load Balancer → Load Balancer vService List screen, the vService is right-clicked and Edit is selected (how to add to a vService).
Save is clicked. In a cluster setup, the change is also sent to the peer device with the default auto-sync, and the two devices send the lines of their own traffic to the same addresses; if Manual Sync Mode is on, it is sent to the peer device manually.
On the WAF Management tab of the vService, in the window opened with the pencil icon of the SIEM & Attack Details card, Attack Payload in WAF Info, Attack Details in WAF Info and WAF Info Language are selected and Edit is clicked (Which attack fields are sent to the SIEM (score, severity, scope, name, category, CWE, MITRE, CAPEC, OWASP, target)?).
Verification
A test request that contains an attack is sent to the vService, and the line is searched for in the SIEM by the vService name.
Command: curl -s -o /dev/null -w '%{http_code}' 'https://www.example.com/cmd.exe'
CEF:0|TR7|TR7 ASP|… isWafAttack=1 wafInfo={"uid":…,"action":"block",…}Method 2: TR7 WAF Log
- How it works In the TR7 WAF Log format, only the requests that WAF blocked produce a line; the whole line is the JSON of the attack information. Requests passed in Monitor mode and requests recognized by Teacher are not sent.
- Where it is openedLoad Balancer → Profiles → Logs → Line Format = TR7 WAF Log
- Requirement Modify permission in the Load Balancer area (the Logs profile and the vService form are on Load Balancer screens); WAF on in the vService (on a vService whose WAF box is not checked, this format produces no lines at all)
- vService type HTTP
Step-by-Step Configuration
Steps 1–4 of Method 1 are followed; TR7 WAF Log is selected as the Line Format. To parse the line directly as JSON, Log Standard = raw is selected (log parsing example).
With steps 5–7 of Method 1, the profile is selected under LOG on the vService and Save is clicked. Details: Can I send only attack records to the SIEM?
Verification
After a blocked test request, the line in the SIEM is examined.
{"uid":"…","totalScore":8,"action":"block","attacks":[{"id":130005,…}],"wafTime":1.485}Method 3: Manual Formats and %WAFINFO
- How it works In the Manual JSON Format, Manual CEF Format and Manual Log Line Format formats, the line is built manually; the attack information is added at the desired place with the
%WAFINFOsmart variable (Smart Variables). - Where it is openedLoad Balancer → Profiles → Logs → Line Format = one of the Manual formats
- Requirement Modify permission in the Load Balancer area (the Logs profile and the vService form are on Load Balancer screens); the field structure that the SIEM expects
- vService type HTTP
Step-by-Step Configuration
Steps 1–2 of Method 1 are followed; one of the Manual formats is selected as the Line Format and the line structure is entered. For the attack information, the %WAFINFO variable is added (formats).
The profile is saved with Add; it is bound to the vService with steps 5–7 of Method 1.
Verification
In the SIEM, the %WAFINFO position in the line is examined.
{} if there is no attack, the JSON of the attack information if there is an attackCommon Mistakes
- Selecting the TR7 WAF Log format in Monitor mode. This format sends only the blocked requests; if the host group is in Monitor mode, no line goes to the SIEM because the requests that contain attacks are not blocked. For monitored attacks, CEF Format or TR7 JSON Format is used.
- Looking for attack information in the Standard or Apache formats. The Standard Log Format, Apache Combined Log Format and Apache VHost Log Format formats have no
wafInfo. - Not binding the profile to the vService. Even though the profile has been created, if LOG is not checked on the vService or the built-in Stream Log has stayed selected, the records are not sent out.
- Taking the
isWafAttackfield as the sign of every attack. The field becomes1only in blocked requests; in Monitor and Teacher records, the verdict of the request is read from theactionkey inwafInfo(monitor,fpc). - Using the Log Forwarding screen. Log Forwarding forwards system logs (User Logs, Notification Logs …); WAF records are sent with the log profile.
How it is done in the documentation
