File: pgsql-keywords.rst

package info (click to toggle)
suricata 1%3A8.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 240,704 kB
  • sloc: ansic: 357,736; python: 8,721; sh: 5,043; makefile: 2,411; perl: 570; php: 170
file content (33 lines) | stat: -rw-r--r-- 1,007 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
PGSQL Keywords
##############

.. role:: example-rule-emphasis

pgsql.query
***********

This keyword is a sticky buffer that allows matching on the contents of
PostgreSQL's `query` request messages parsed by the engine. Note that this
buffer inspects only the `string` portion of the PostgreSQL message, skipping
other fields such as identifier and length, and focusing on the query itself.

Currently, it exposes the contents of the ``pgsql.request.simple_query`` field
from EVE output.

``pgsql.query`` can be used as a ``fast_pattern``
(see :ref:`rules-keyword-fast_pattern`).

Use ``nocase`` with this keyword to avoid case sensitivity for the matches.

Examples
========

.. container:: example-rule

    alert pgsql any any -> any any (msg:"Simple SELECT rule";
    :example-rule-emphasis:`pgsql.query; content:"SELECT \*";` sid:1;)

.. container:: example-rule

    alert pgsql any any -> any any (msg:"Simple delete rule";
    :example-rule-emphasis:`pgsql.query; content:"delete"; nocase` sid:2;)