-
Notifications
You must be signed in to change notification settings - Fork 587
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
Suricata improvements #330
Closed
securitym0nkey
wants to merge
5
commits into
pfsense:devel
from
securitym0nkey:suricata-improvements
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
6111c3c
Fixed wildcard SID modification
securitym0nkey 485d3d8
Fixed modified signatures missing the modify icon at the webgui
securitym0nkey 8f50b71
Fixed rule modification for multiple comma separated SIDs
securitym0nkey 9b0d73d
New feature for the SID Mgmt: rule content modification by category
securitym0nkey bf9b6f0
Improved regex for SID content mgmt
securitym0nkey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# example modifysid.conf | ||
# | ||
# formatting is simple | ||
# <sid or sid list> "what I'm replacing" "what I'm replacing it with" | ||
# <sid, category, list of sids&categories> "what I'm replacing" "what I'm replacing it with" | ||
# | ||
# Note that this will only work with GID:1 rules, simply because modifying | ||
# GID:3 SO stub rules would not actually affect the rule. | ||
|
@@ -19,5 +19,13 @@ | |
# "HTTP_PORTS" "HTTPS_PORTS" | ||
|
||
# multiple sids can be specified as noted below: | ||
# 302,429,1821 "\$EXTERNAL_NET" "\$HOME_NET" | ||
# 302,429,1821 "$EXTERNAL_NET" "$HOME_NET" | ||
|
||
# modify all signatures in a category. Example: replace "$EXTERNAL_NETS" with "any" to be alerts on insider threats as well | ||
# emerging-scan "$EXTERNAL_NET" "any" | ||
|
||
# modify all signatures in multiple categories | ||
# emerging-scan,emerging-sql "$EXTERNAL_NET" "any" | ||
|
||
# modify all signatures for a category and specific SIDs from other categories | ||
# emerging-sql,2100691,2009817 "$EXTERNAL_NET" "any" | ||
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. See previous comment. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Pretty sure these should remain escaped as it was before, and any added example should have those escaped, otherwise it's never going to match things in the rulesets. IOW, this it to replace the string
$EXTERNAL_NET
with a string$HOME_NET
for the matching SIDs, not to expand those things to whatever is defined there and stick that in the rules.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.
The code is escaping it itself. See line 2506. Actually that way you can't use regex for replacement. pulledpork supports replacement by regex in such case you need to escape it. I thought of removing the preg_quote so that the current example would be correct. But dropped that idea to no break the config for people who have noticed that escaping is not needed as displayed in the example.
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.
Yeah, currently the code performs internal escaping of the regex.