-
Notifications
You must be signed in to change notification settings - Fork 1.7k
detect: add keywords for LDAPDN - v3 #12556
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -163,3 +163,83 @@ Example of a signature that would alert if a packet has more than 2 LDAP respons | |||||||||||||||||
| .. container:: example-rule | ||||||||||||||||||
|
|
||||||||||||||||||
| alert ip any any -> any any (msg:"Packet has more than 2 LDAP responses"; :example-rule-emphasis:`ldap.responses.count:>2;` sid:1;) | ||||||||||||||||||
|
|
||||||||||||||||||
| ldap.request.dn | ||||||||||||||||||
| --------------- | ||||||||||||||||||
|
|
||||||||||||||||||
| Matches on LDAP distinguished names from request operations. | ||||||||||||||||||
|
|
||||||||||||||||||
| Comparison is case-sensitive. | ||||||||||||||||||
|
|
||||||||||||||||||
| Syntax:: | ||||||||||||||||||
|
|
||||||||||||||||||
| ldap.request.dn; content:dc=example,dc=com; | ||||||||||||||||||
|
|
||||||||||||||||||
| ``ldap.request.dn`` is a 'sticky buffer' and can be used as a ``fast_pattern``. | ||||||||||||||||||
|
|
||||||||||||||||||
| This keyword maps to the eve fields: | ||||||||||||||||||
| ``ldap.request.bind_request.name`` | ||||||||||||||||||
| ``ldap.request.add_request.entry`` | ||||||||||||||||||
| ``ldap.request.search_request.base_object`` | ||||||||||||||||||
| ``ldap.request.modify_request.object`` | ||||||||||||||||||
| ``ldap.request.del_request.dn`` | ||||||||||||||||||
| ``ldap.request.mod_dn_request.entry`` | ||||||||||||||||||
| ``ldap.request.compare_request.entry`` | ||||||||||||||||||
|
|
||||||||||||||||||
| Example | ||||||||||||||||||
| ^^^^^^^ | ||||||||||||||||||
|
|
||||||||||||||||||
| Example of a signature that would alert if a packet has the LDAP distinguished name ``uid=jdoe,ou=People,dc=example,dc=com``: | ||||||||||||||||||
|
|
||||||||||||||||||
| .. container:: example-rule | ||||||||||||||||||
|
|
||||||||||||||||||
| alert tcp any any -> any any (msg:"Test LDAPDN"; :example-rule-emphasis:`ldap.request.dn:uid=jdoe,ou=People,dc=example,dc=com;` sid:1;) | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could be more explicit |
||||||||||||||||||
|
|
||||||||||||||||||
| It is possible to use the keyword ``ldap.request.operation`` in the same rule to specify the operation to match. | ||||||||||||||||||
| Here is an example of a signature that would alert if a packet has an LDAP search request operation and contains the LDAP distinguished name ``dc=example,dc=com``. | ||||||||||||||||||
|
Comment on lines
+198
to
+199
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nits to remove extra space and to conform line length to ideal character limits :P
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same idea applies to the other section. |
||||||||||||||||||
|
|
||||||||||||||||||
| .. container:: example-rule | ||||||||||||||||||
|
|
||||||||||||||||||
| alert tcp any any -> any any (msg:"Test LDAPDN and operation"; :example-rule-emphasis:`ldap.request.operation:search_request; ldap.request.dn:dc=example,dc=com;` sid:1;) | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same applies to the other examples, right? |
||||||||||||||||||
|
|
||||||||||||||||||
| ldap.responses.dn | ||||||||||||||||||
| ----------------- | ||||||||||||||||||
|
|
||||||||||||||||||
| Matches on LDAP distinguished names from response operations. | ||||||||||||||||||
|
|
||||||||||||||||||
| Comparison is case-sensitive. | ||||||||||||||||||
|
|
||||||||||||||||||
| Syntax:: | ||||||||||||||||||
|
|
||||||||||||||||||
| ldap.responses.dn; content:dc=example,dc=com; | ||||||||||||||||||
|
|
||||||||||||||||||
| ``ldap.responses.dn`` is a 'sticky buffer' and can be used as a ``fast_pattern``. | ||||||||||||||||||
|
|
||||||||||||||||||
| ``ldap.responses.dn`` supports multiple buffer matching, see :doc:`multi-buffer-matching`. | ||||||||||||||||||
|
|
||||||||||||||||||
| This keyword maps to the eve fields: | ||||||||||||||||||
| ``ldap.responses[].search_result_entry.base_object`` | ||||||||||||||||||
| ``ldap.responses[].bind_response.matched_dn`` | ||||||||||||||||||
| ``ldap.responses[].search_result_done.matched_dn`` | ||||||||||||||||||
| ``ldap.responses[].modify_response.matched_dn`` | ||||||||||||||||||
| ``ldap.responses[].add_response.matched_dn`` | ||||||||||||||||||
| ``ldap.responses[].del_response.matched_dn`` | ||||||||||||||||||
| ``ldap.responses[].mod_dn_response.matched_dn`` | ||||||||||||||||||
| ``ldap.responses[].compare_response.matched_dn`` | ||||||||||||||||||
| ``ldap.responses[].extended_response.matched_dn`` | ||||||||||||||||||
|
|
||||||||||||||||||
| Example | ||||||||||||||||||
| ^^^^^^^ | ||||||||||||||||||
|
|
||||||||||||||||||
| Example of a signature that would alert if a packet has the LDAP distinguished name ``dc=example,dc=com``: | ||||||||||||||||||
|
|
||||||||||||||||||
| .. container:: example-rule | ||||||||||||||||||
|
|
||||||||||||||||||
| alert tcp any any -> any any (msg:"Test LDAPDN"; :example-rule-emphasis:`ldap.responses.dn:dc=example,dc=com;` sid:1;) | ||||||||||||||||||
|
|
||||||||||||||||||
| It is possible to use the keyword ``ldap.responses.operation`` in the same rule to specify the operation to match. | ||||||||||||||||||
| Here is an example of a signature that would alert if a packet has an LDAP search result entry operation and contains the LDAP distinguished name ``dc=example,dc=com``. | ||||||||||||||||||
|
|
||||||||||||||||||
| .. container:: example-rule | ||||||||||||||||||
|
|
||||||||||||||||||
| alert tcp any any -> any any (msg:"Test LDAPDN and operation"; :example-rule-emphasis:`ldap.responses.operation:search_result_entry; ldap.responses.dn:dc=example,dc=com;` sid:1;) | ||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that these may be in different response like ldap.responses[0] has operation:search_result_entry and ldap.reponses[1] has dn:dc=example,dc=com
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be added as a note in this section? |
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: