Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enip rust 3958 v13 #10186

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/userguide/configuration/suricata-yaml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,8 @@ incompatible with ``decode-mime``. If both are enabled,
Maximum transactions
~~~~~~~~~~~~~~~~~~~~

MQTT, FTP, PostgreSQL, SMB, DCERPC and NFS have each a `max-tx` parameter that can be customized.
MQTT, FTP, PostgreSQL, SMB, DCERPC, ENIP and NFS have each a `max-tx`
parameter that can be customized.
`max-tx` refers to the maximum number of live transactions for each flow.
An app-layer event `protocol.too_many_transactions` is triggered when this value is reached.
The point of this parameter is to find a balance between the completeness of analysis
Expand Down
6 changes: 6 additions & 0 deletions doc/userguide/rules/dhcp-keywords.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ dhcp.leasetime

DHCP lease time (integer).

dhcp.leasetime uses an :ref:`unsigned 64-bits integer <rules-integer-keywords>`.

Syntax::

dhcp.leasetime:[op]<number>
Expand All @@ -25,6 +27,8 @@ dhcp.rebinding_time

DHCP rebinding time (integer).

dhcp.rebinding_time uses an :ref:`unsigned 64-bits integer <rules-integer-keywords>`.

Syntax::

dhcp.rebinding_time:[op]<number>
Expand All @@ -44,6 +48,8 @@ dhcp.renewal_time

DHCP renewal time (integer).

dhcp.renewal_time uses an :ref:`unsigned 64-bits integer <rules-integer-keywords>`.

Syntax::

dhcp.renewal_time:[op]<number>
Expand Down
254 changes: 237 additions & 17 deletions doc/userguide/rules/enip-keyword.rst
Original file line number Diff line number Diff line change
@@ -1,40 +1,260 @@
ENIP/CIP Keywords
=================

The enip_command and cip_service keywords can be used for matching on various properties of
ENIP requests.
enip_command
------------

There are three ways of using this keyword:
For the ENIP command, we are matching against the command field found in the ENIP encapsulation.

Examples::

* matching on ENIP command with the setting "enip_command";
* matching on CIP Service with the setting "cip_service".
* matching both the ENIP command and the CIP Service with "enip_command" and "cip_service" together
enip_command:99;
enip_command:list_identity;

enip_command uses an :ref:`unsigned 16-bits integer <rules-integer-keywords>`.
It can also be specified by text from the enumeration.

For the ENIP command, we are matching against the command field found in the ENIP encapsulation.
cip_service
-----------

For the CIP Service, we use a maximum of 3 comma separated values representing the Service, Class and Attribute.
These values are described in the CIP specification. CIP Classes are associated with their Service, and CIP Attributes
are associated with their Service. If you only need to match up until the Service, then only provide the Service value.
If you want to match to the CIP Attribute, then you must provide all 3 values.


Syntax::

enip_command:<value>
cip_service:<value(s)>
enip_command:<value>, cip_service:<value(s)>


Examples::

enip_command:99
cip_service:75
cip_service:16,246,6
enip_command:111, cip_service:5


(cf. http://read.pudn.com/downloads166/ebook/763211/EIP-CIP-V1-1.0.pdf)

Information on the protocol can be found here:
`<http://literature.rockwellautomation.com/idc/groups/literature/documents/wp/enet-wp001_-en-p.pdf>`_

enip.status
-----------

For the ENIP status, we are matching against the status field found in the ENIP encapsulation.
It uses a 32-bit unsigned integer as value.

enip.status uses an :ref:`unsigned 32-bits integer <rules-integer-keywords>`.
It can also be specified by text from the enumeration.

Examples::

enip.status:100;
enip.status:>106;
enip.status:invalid_cmd;

enip.protocol_version
---------------------

Match on the protocol version in different messages.
It uses a 16-bit unsigned integer as value.

enip.protocol_version uses an :ref:`unsigned 16-bits integer <rules-integer-keywords>`.

Examples::

enip.protocol_version:1;
enip.protocol_version:>1;

enip.cip_attribute
------------------

Match on the cip attribute in different messages.
It uses a 32-bit unsigned integer as value.

This allows to match without needing to match on cip.service.

enip.cip_attribute uses an :ref:`unsigned 32-bits integer <rules-integer-keywords>`.

Examples::

enip.cip_attribute:1;
enip.cip_attribute:>1;

enip.cip_instance
-----------------

Match on the cip instance in CIP request path.
It uses a 32-bit unsigned integer as value.

enip.cip_instance uses an :ref:`unsigned 32-bits integer <rules-integer-keywords>`.

Examples::

enip.cip_instance:1;
enip.cip_instance:>1;

enip.cip_class
--------------

Match on the cip class in CIP request path.
It uses a 32-bit unsigned integer as value.

enip.cip_class uses an :ref:`unsigned 32-bits integer <rules-integer-keywords>`.

This allows to match without needing to match on cip.service.

Examples::

enip.cip_class:1;
enip.cip_class:>1;

enip.cip_extendedstatus
-----------------------

Match on the cip extended status, if any is present.
For multiple service packet, will match on any of the seen statuses.
It uses a 16-bit unsigned integer as value.

enip.cip_extendedstatus uses an :ref:`unsigned 16-bits integer <rules-integer-keywords>`.

Examples::

enip.cip_extendedstatus:1;
enip.cip_extendedstatus:>1;

enip.revision
-------------

Match on the revision in identity message.
It uses a 16-bit unsigned integer as value.

enip.revision uses an :ref:`unsigned 16-bits integer <rules-integer-keywords>`.

Examples::

enip.revision:1;
enip.revision:>1;

enip.identity_status
--------------------

Match on the status in identity message (not in ENIP header).
It uses a 16-bit unsigned integer as value.

enip.identity_status uses an :ref:`unsigned 16-bits integer <rules-integer-keywords>`.

Examples::

enip.identity_status:1;
enip.identity_status:>1;

enip.state
----------

Match on the state in identity message.
It uses an 8-bit unsigned integer as value.

enip.state uses an :ref:`unsigned 8-bits integer <rules-integer-keywords>`.

Examples::

enip.state:1;
enip.state:>1;

enip.serial
-----------

Match on the serial in identity message.
It uses a 32-bit unsigned integer as value.

enip.serial uses an :ref:`unsigned 32-bits integer <rules-integer-keywords>`.

Examples::

enip.serial:1;
enip.serial:>1;

enip.product_code
-----------------

Match on the product code in identity message.
It uses a 16-bit unsigned integer as value.

enip.product_code uses an :ref:`unsigned 16-bits integer <rules-integer-keywords>`.

Examples::

enip.product_code:1;
enip.product_code:>1;

enip.device_type
----------------

Match on the device type in identity message.
It uses a 16-bit unsigned integer as value.

enip.device_type uses an :ref:`unsigned 16-bits integer <rules-integer-keywords>`.

Examples::

enip.device_type:1;
enip.device_type:>1;

enip.vendor_id
--------------

Match on the vendor id in identity message.
It uses a 16-bit unsigned integer as value.

enip.vendor_id uses an :ref:`unsigned 16-bits integer <rules-integer-keywords>`.

Examples::

enip.vendor_id:1;
enip.vendor_id:>1;

enip.product_name
-----------------

Match on the product name in identity message.

Examples::

enip.product_name; pcre:"/^123[0-9]*/";
enip.product_name; content:"swordfish";

``enip.product_name`` is a 'sticky buffer' and can be used as ``fast_pattern``.

enip.service_name
-----------------

Match on the service name in list services message.

Examples::

enip.service_name; pcre:"/^123[0-9]*/";
enip.service_name; content:"swordfish";

``enip.service_name`` is a 'sticky buffer' and can be used as ``fast_pattern``.

enip.capabilities
-----------------

Match on the capabilities in list services message.
It uses a 16-bit unsigned integer as value.

enip.capabilities uses an :ref:`unsigned 16-bits integer <rules-integer-keywords>`.

Examples::

enip.capabilities:1;
enip.capabilities:>1;

enip.cip_status
---------------

Match on the cip status (one of them in case of multiple service packet).
It uses an 8-bit unsigned integer as value.

enip.cip_status uses an :ref:`unsigned 8-bits integer <rules-integer-keywords>`.

Examples::

enip.cip_status:1;
enip.cip_status:>1;
2 changes: 2 additions & 0 deletions doc/userguide/rules/file-keywords.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ filesize

Match on the size of the file as it is being transferred.

filesize uses an :ref:`unsigned 64-bits integer <rules-integer-keywords>`.

Syntax::

filesize:<value>;
Expand Down
10 changes: 10 additions & 0 deletions doc/userguide/rules/flow-keywords.rst
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ flow.age
Flow age in seconds (integer)
This keyword does not wait for the end of the flow, but will be checked at each packet.

flow.age uses an :ref:`unsigned 32-bits integer <rules-integer-keywords>`.

Syntax::

flow.age: [op]<number>
Expand All @@ -314,6 +316,8 @@ flow.pkts_toclient
Flow number of packets to client (integer)
This keyword does not wait for the end of the flow, but will be checked at each packet.

flow.pkts_toclient uses an :ref:`unsigned 32-bits integer <rules-integer-keywords>`.

Syntax::

flow.pkts_toclient: [op]<number>
Expand All @@ -334,6 +338,8 @@ flow.pkts_toserver
Flow number of packets to server (integer)
This keyword does not wait for the end of the flow, but will be checked at each packet.

flow.pkts_toserver uses an :ref:`unsigned 32-bits integer <rules-integer-keywords>`.

Syntax::

flow.pkts_toserver: [op]<number>
Expand All @@ -354,6 +360,8 @@ flow.bytes_toclient
Flow number of bytes to client (integer)
This keyword does not wait for the end of the flow, but will be checked at each packet.

flow.bytes_toclient uses an :ref:`unsigned 64-bits integer <rules-integer-keywords>`.

Syntax::

flow.bytes_toclient: [op]<number>
Expand All @@ -374,6 +382,8 @@ flow.bytes_toserver
Flow number of bytes to server (integer)
This keyword does not wait for the end of the flow, but will be checked at each packet.

flow.bytes_toserver uses an :ref:`unsigned 64-bits integer <rules-integer-keywords>`.

Syntax::

flow.bytes_toserver: [op]<number>
Expand Down
Loading
Loading