Setting up integration with SIEM systems

In order to configure sending logs to a third-party SIEM system, you need to create a sending template in the web interface (Applications tab -> Settings -> Asynchronous transaction export

-> “Add”) (see screenshot 135).

image129

Screenshot 135 - Creating a template for sending logs to a third-party SIEM system

Template examples:

  1. LEEF format template:

'{{time}} {{host_ip}} LEEF:2.0|iBatyr WAF|1.0|{{req.obj_id}}|src={{req.src_ip}}\tspt={{req.src_port}}\tdst={{req.dst_ip}}\tdpt={{req.dst_port}}\trequest_time={{req.time}}\tresponse_time={{resp.time}}\turl={{req.raw_uri}}\tsev={{severity}}\treq_tree.headers.cookie={{req_tree.tree.headers.cookie}}\trequestMethod={{req.method}}\treq_tree.url.path={{req_tree.tree.url.path}}\tdstBytes={{req_tree.tree.headers["content-length"]}}\tsrcBytes={{resp_tree.tree.headers["content-length"]}}'
  1. CEF format template:

'{{req.time.strftime("%b %d %H:%M:%S")}} localhost CEF:0|iBatyr WAF|1.0|{{req.obj_id}}|HTTP Transaction|{{severity}}|src={{req.src_ip}} scrPort={{req.src_port}} dst={{req.dst_ip}} dstPort={{req.dst_port}} request_time={{time}} response_time={{resp.time}} request={{req.raw_uri}} requestCookies={{req_tree.tree.headers.cookie}} requestMethod={{req.method}} file_path={{req_tree.tree.url.path}} in={{req_tree.tree.headers["content_length"]}} out={{resp_tree.tree.headers["content_length"]}}'

Below is a description of the parameters and possible field values for sending:

  1. Mode:

    • ALL – Sends a log of all transactions.

    • BLOCKED – only the log of blocked transactions is sent.

  2. Retraining interval – how often transactions will be sampled from the database and sent to SIEM.

  3. Address:

    • tcp://siem_ip:514 – sending via TCP connection;

    • udp://siem_ip:514 – sending via UDP connection;

    • file:///dev/log – writes a log to the local file system on the WAF node.

  4. Acceptable placeholders:

    • time - transaction timestamp;

    • host_ip - address of the host from which the log is sent;

    • severity – severity of the event;

    • req – request data:

      • obj_id – transaction identifier on WAF;

      • src_ip – request source address;

      • src_port – request source port;

      • dst_ip – request destination address;

      • dst_port – request destination port;

      • time – request timestamp;

      • raw_uri – address of the requested page;

      • method – HTTP method;

      • protocol – transmission protocol.

    • resp – response data:

      • time – timestamp of the response.

    • req_tree – data about the parsed query tree:

      • tree:

        • time – request timestamp;

        • src_ip – request source address;

        • src_port – request source port;

        • dst_ip – request destination address;

        • dst_port – request destination port;

        • protocol – transmission protocol;

        • method – HTTP method;

        • url – address of the requested page;

        • headers – headers.

  5. Cookie – Cookie header.

  6. … – other headings.

    • resp_tree – data about the parsed response tree (by default, response tree parsing is disabled):

      • tree:

        • time – time stamp of the response;

        • src_port – request source port;

        • dst_ip – request destination address;

        • dst_port – request destination port;

        • protocol – transmission protocol;

        • method – HTTP method;

        • url – address of the requested page;

        • headers – response headers.

  7. Cookie:

    • req_decision – WAF decision (pass/block):

      • decision – decision on the request;

      • rule – the rule triggered on the request:

        • name – name of the rule;

        • obj_id – rule identifier.

    • resp_decision – the rule triggered on the response:

      • decision – decision on the answer;

      • rule – the rule triggered on the response:

        • name – name of the rule;

        • obj_id – rule identifier.

    • webapp_id – identifier of the protected application on the WAF;

    • webapp_name – application name;

    • action_id – action identifier of the positive business logic model (for details, see the operator’s manual);

    • action_name – action name of the business logic model;

    • action_parameters – action parameters of the business logic model;

    • request_session_id – request session identifier;

    • response_session_id – response session identifier.

Since Jinja is used as templates, it is possible to write expressions of the following type in the templates.

  1. Sample:

block_rule_name={{req_decision.rule_name if req_decision.decision ==
"BLOCK" else resp_decision.rule_name}}

Result:

block_rule_name=Name of the request blocking rule (if the reason was blocking the request), or the response (if the reason was blocking the response)

  1. Sample:

{% for rule in req_decision.reason.matching_rules %}
rule={{rule.name}} {% endfor %}

Result:

rule=Parameter does not match the model rule=Inject javascript code into pages rule=Other signatures