doc/flow: updates and cleanups to flow section

pull/3514/head
Victor Julien 8 years ago
parent 2ae8d1a208
commit 5afeebf884

@ -19,17 +19,21 @@ well.
Flowbits have different actions. These are: Flowbits have different actions. These are:
:: flowbits: set, name
Will set the condition/'name', if present, in the flow.
flowbits: set, name Will set the condition/'name', if present, in the flow. flowbits: isset, name
flowbits: isset, name Can be used in the rule to make sure it generates an alert Can be used in the rule to make sure it generates an alert when the
when the rule matches and the condition is set in the flow. rule matches and the condition is set in the flow.
flowbits: toggle, name Reverses the present setting. So for example if a condition is set, flowbits: toggle, name
it will be unset and vice-versa. Reverses the present setting. So for example if a condition is set,
flowbits: unset, name Can be used to unset the condition in the flow. it will be unset and vice-versa.
flowbits: isnotset, name Can be used in the rule to make sure it generates an alert flowbits: unset, name
when it matches and the condition is not set in the flow. Can be used to unset the condition in the flow.
flowbits: noalert No alert will be generated by this rule. flowbits: isnotset, name
Can be used in the rule to make sure it generates an alert when it
matches and the condition is not set in the flow.
flowbits: noalert
No alert will be generated by this rule.
Example: Example:
@ -106,11 +110,6 @@ The determination of *established* depends on the protocol:
flowint flowint
------- -------
Flowint is a precursor to the Global Variables task we will be adding
to the engine very soon, which will allow the capture, storage and
comparison of data in a variable. It will be as the name implies
Global. So you can compare data from packets in unrelated streams.
Flowint allows storage and mathematical operations using variables. It Flowint allows storage and mathematical operations using variables. It
operates much like flowbits but with the addition of mathematical operates much like flowbits but with the addition of mathematical
capabilities and the fact that an integer can be stored and capabilities and the fact that an integer can be stored and
@ -120,15 +119,16 @@ occurrences, or doing thresholding within a stream in relation to
multiple factors. This will be expanded to a global context very soon, multiple factors. This will be expanded to a global context very soon,
so users can perform these operations between streams. so users can perform these operations between streams.
The syntax is as follows: The syntax is as follows::
flowint: , ; flowint: name, modifier[, value];
Define a var (not required), or check that one is set or not set. Define a var (not required), or check that one is set or not set.
flowint: , , ; ::
flowint: , < +,-,=,>,<,>=,<=,==, != >, ; flowint: name, < +,-,=,>,<,>=,<=,==, != >, value;
flowint: name, (isset|isnotset);
Compare or alter a var. Add, subtract, compare greater than or less Compare or alter a var. Add, subtract, compare greater than or less
than, greater than or equal to, and less than or equal to are than, greater than or equal to, and less than or equal to are
@ -210,16 +210,17 @@ logins and a failed login after that.
:: ::
alert tcp any any -> any any (msg:"Counting Good Logins"; content:"login successful"; \ alert tcp any any -> any any (msg:"Counting Good Logins"; \
flowint:loginsuccess, +, 1; noalert;) content:"login successful"; flowint:loginsuccess, +, 1; noalert;)
Here we're counting good logins, so now we'll count good logins Here we're counting good logins, so now we'll count good logins
relevant to fails: relevant to fails:
:: ::
alert tcp any any -> any any (msg:"Login fail after two successes"; \ alert tcp any any -> any any (msg:"Login fail after two successes"; \
content:"login failed"; flowint:loginsuccess, isset; flowint:loginsuccess, =, 2;) content:"login failed"; flowint:loginsuccess, isset; \
flowint:loginsuccess, =, 2;)
Here are some other general examples: Here are some other general examples:
@ -236,7 +237,7 @@ Here are some other general examples:
:: ::
alert tcp any any -> any any (msg:"if the flowint counter is 3 create a new counter"; \ alert tcp any any -> any any (msg:"when flowint counter is 3 create new counter"; \
content:"Unauthorized"; flowint:myvar, isset; flowint:myvar,==,3; \ content:"Unauthorized"; flowint:myvar, isset; flowint:myvar,==,3; \
flowint:cntpackets,notset; flowint:cntpackets, =, 0;) flowint:cntpackets,notset; flowint:cntpackets, =, 0;)
@ -274,4 +275,6 @@ Format
stream_size:<server|client|both|either>, <modifier>, <number>; stream_size:<server|client|both|either>, <modifier>, <number>;
Example of the stream-size keyword in a rule: Example of the stream-size keyword in a rule::
alert tcp any any -> any any (stream_size:both, >, 5000; sid:1;)

Loading…
Cancel
Save