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

userguide: explain rule types and categorization - v4 #12111

Closed

Conversation

jufajardini
Copy link
Contributor

Add documentation about the rule types introduced by 2696fda.

Add doc tags around code definitions that are referenced in the docs.

Link to ticket: https://redmine.openinfosecfoundation.org/issues/
I guess this covers https://redmine.openinfosecfoundation.org/issues/7031

Built docs: https://suri-rtd-test.readthedocs.io/en/doc-sigtypes-et-properties-v4/rules/intro.html#rule-s-types-and-categorization

Previous PR: #12107

Describe changes: (tried to) address feedback:

  • better explain Scope, and tie explanations to other Table columns as well
  • add code excerpts for SignatureType and SignatureProperties
  • Fix explanations that were wrong or unclear
  • Get a stab at trying to explain when do app-layer protocol rules are inspected
  • associate commit with ticket that seems related

Add documentation about the rule types introduced by 2696fda.

Add doc tags around code definitions that are referenced in the docs.

Task #https://redmine.openinfosecfoundation.org/issues/7031
@jufajardini jufajardini added the typo/doc update No code change : only doc or typo fixes label Nov 12, 2024
- 'tcp-stream' in protocol field; simple 'content'; 'byte_extract'
* - Application Layer Protocol
- Flow
- Per-packet basis
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this more correct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think so, ya

- Flow
- Once per direction
- On the flow, on IP address level (negated addresses)
- Source/ Destination field of a rule, containing negated address
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this, not sure if good to have or not

Once parsed, Suricata rules are categorized for performance and further
processing (as different rule types will be handled by specific engine modules).
The signature types are defined in `src/detect.h
<https://github.com/OISF/suricata/blob/master/src/detect.h>`_:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed the line references here, to make this more time resilient


alert tcp-pkt [192.168.0.0/16,10.0.0.0/8,172.16.0.0/12] any -> any any (msg:"tcp-pkt, no content"; sid:201;)

IP Only (negated address)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it also be contains negated address here, to ensure people are seeing it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps another example as well, e.g. [10.0.0.0/8,!10.10.10.10]

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.27%. Comparing base (278dc24) to head (d7b8a58).

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12111      +/-   ##
==========================================
+ Coverage   83.23%   83.27%   +0.04%     
==========================================
  Files         906      906              
  Lines      257647   257647              
==========================================
+ Hits       214458   214567     +109     
+ Misses      43189    43080     -109     
Flag Coverage Δ
fuzzcorpus 61.32% <ø> (+0.11%) ⬆️
livemode 19.43% <ø> (+<0.01%) ⬆️
pcap 44.01% <ø> (-0.42%) ⬇️
suricata-verify 62.71% <ø> (+<0.01%) ⬆️
unittests 59.27% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline 23303

@jufajardini
Copy link
Contributor Author

New PR incoming to fix clang failure

Copy link
Member

@victorjulien victorjulien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments inline

:header-rows: 1

* - Type
- Scope
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

action scope?

- Flow, if stateful, per-packet if not
- Against the reassembled stream. If stream unavailable, match per-packet
(packet payload and stream payload)
- 'content' with 'starts with' or 'depth'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

startswith is a keyword w/o space

Copy link
Contributor Author

@jufajardini jufajardini Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

. >_<'

- 'tcp-stream' in protocol field; simple 'content'; 'byte_extract'
* - Application Layer Protocol
- Flow
- Per-packet basis
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think so, ya


alert tcp-pkt [192.168.0.0/16,10.0.0.0/8,172.16.0.0/12] any -> any any (msg:"tcp-pkt, no content"; sid:201;)

IP Only (negated address)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps another example as well, e.g. [10.0.0.0/8,!10.10.10.10]

@jufajardini
Copy link
Contributor Author

New version: #12112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typo/doc update No code change : only doc or typo fixes
Development

Successfully merging this pull request may close these issues.

3 participants