Skip to content

Commit

Permalink
doc: add http.connection ref and fix location
Browse files Browse the repository at this point in the history
Signed-off-by: jason taylor <jtfas90@gmail.com>
  • Loading branch information
jmtaylor90 authored and victorjulien committed May 6, 2024
1 parent 329ac61 commit 5dacf4d
Showing 1 changed file with 29 additions and 28 deletions.
57 changes: 29 additions & 28 deletions doc/userguide/rules/http-keywords.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Response Keywords:

Request or Response Keywords:
* :ref:`file.data`
* :ref:`http.connection`
* :ref:`http.content_len`
* :ref:`http.content_type`
* :ref:`http.cookie`
Expand Down Expand Up @@ -195,34 +196,6 @@ Example HTTP Request::
.. note:: ``http.accept_lang`` does not include the leading space or
trailing \\r\\n

.. _http.connection:

http.connection
---------------

The ``http.connection`` keyword is used to match on the Connection field that
can be present in HTTP request headers.

It is possible to use any of the :doc:`payload-keywords` with the
``http.connection`` keyword.

Example HTTP Request::

GET /index.html HTTP/1.1
User-Agent: Mozilla/5.0
Accept-Language: en-US
Host: suricata.io
Connection: Keep-Alive

.. container:: example-rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"HTTP Connection Example"; \
flow:established,to_server; :example-rule-options:`http.connection; \
content:"Keep-Alive";` bsize:10; classtype:bad-unknown; sid:94; rev:1;)

.. note:: ``http.connection`` does not include the leading space or trailing
\\r\\n

.. _http.host:

http.host
Expand Down Expand Up @@ -915,6 +888,34 @@ setting.
.. note:: ``file.data`` supports multiple buffer matching, see
:doc:`multi-buffer-matching`.

.. _http.connection:

http.connection
---------------

The ``http.connection`` keyword is used to match on the Connection field that
can be present in HTTP request or response headers.

It is possible to use any of the :doc:`payload-keywords` with the
``http.connection`` keyword.

Example HTTP Request::

GET /index.html HTTP/1.1
User-Agent: Mozilla/5.0
Accept-Language: en-US
Host: suricata.io
Connection: Keep-Alive

.. container:: example-rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"HTTP Connection Example"; \
flow:established,to_server; :example-rule-options:`http.connection; \
content:"Keep-Alive";` bsize:10; classtype:bad-unknown; sid:94; rev:1;)

.. note:: ``http.connection`` does not include the leading space or trailing
\\r\\n

.. _http.content_len:

http.content_len
Expand Down

0 comments on commit 5dacf4d

Please sign in to comment.