Skip to content
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
8 changes: 8 additions & 0 deletions doc/userguide/firewall/firewall-design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ alert
action in firewall rules. The effect will be the creation of an alert event when the
firewall rule matches.

config
~~~~~~

``config`` is a primary firewall action used to apply the setting of the ``config``
rule keyword when the rule matches, see :doc:`../rules/config`.
The ``config`` action does not issue a verdict for the packet or the flow, so the
other tables are still evaluated. It is not available as a secondary action.
Comment thread
lukashino marked this conversation as resolved.

Multi action rules
~~~~~~~~~~~~~~~~~~

Expand Down
17 changes: 17 additions & 0 deletions src/detect-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,6 +1822,10 @@ static int SigParseActionDo(const char *action_in, const int idx, const bool fw_
"rules");
return -1;
}
if (idx > 0 && (flags & ACTION_PASS) && !(*action_out & ACTION_ACCEPT)) {
SCLogError("'pass' is only supported as a secondary action for 'accept'");
return -1;
}
Comment thread
lukashino marked this conversation as resolved.
}

/* parse scope, if any */
Expand Down Expand Up @@ -1873,6 +1877,14 @@ static int SigParseActionDo(const char *action_in, const int idx, const bool fw_
return -1;
}
*scope_out = scope_flags;
} else if (*scope_out != 0 && (flags & ACTION_PASS)) {
/* No scope given, this action inherits the scope set by the preceding
* actions of a multi-action rule. */
if (*scope_out != ACTION_SCOPE_PACKET && *scope_out != ACTION_SCOPE_FLOW) {
SCLogError("invalid action scope '%s' in action '%s': only 'packet' and 'flow' allowed",
ActionScopeToString((enum ActionScope) * scope_out), action_in);
return -1;
}
}

/* require explicit action scope for fw rules */
Expand Down Expand Up @@ -4201,6 +4213,11 @@ static int DoParsePolicy(const char *policy_name, struct DetectFirewallPolicy *p
return -1;
idx++;
}

if (action & ACTION_CONFIG) {
SCLogError("%s: 'config' is not a valid default policy action", policy_name);
return -1;
}
pol->action = action;
pol->action_scope = action_scope;
return 1;
Expand Down
Loading