fw sam_policy del
Description
The "g_fw sam_policy del" and "g_fw6 sam_policy del" commands delete one configured Rate Limiting rule Set of traffic parameters and other conditions in a Rule Base (Security Policy) that cause specified actions to be taken for a communication session. at a time.
|
Notes:
|
|
Best Practice - SAM Policy rules consume some CPU resources on Security Group Members. Set an expiration for rules that gives you time to investigate, but does not affect performance. Keep only the required SAM Policy rules. If you confirm that an activity is risky, edit the Security Policy |
Syntax for IPv4
|
Syntax for IPv6
|
Parameters
Parameter |
Description |
||
---|---|---|---|
|
Runs the command in debug mode. Use only if you troubleshoot the command itself.
|
||
|
Specifies the UID of the rule you wish to delete.
|
Procedure
-
List all the existing rules in the Suspicious Activity Monitoring policy database
List all the existing rules in the Suspicious Activity Monitoring policy database.
-
For IPv4, run:
g_fw sam_policy get
-
For IPv6, run:
g_fw6 sam_policy get
The rules show in this format:
operation=add uid=<Value1,Value2,Value3,Value4> target=... timeout=... action=... log= ... name= ... comment=... originator= ... src_ip_addr=... req_tpe=...
Example for IPv4:
operation=add uid=<5ac3965f,00000000,3403a8c0,0000264a> target=all timeout=300 action=notify log=log name=Test\ Rule comment=Notify\ about\ traffic\ from\ 1.1.1.1 originator=John\ Doe src_ip_addr=1.1.1.1 req_tpe=ip
-
-
Delete a rule from the list by its UID
-
For IPv4, run:
g_fw [-d] sam_policy del '<Rule UID>'
-
For IPv6, run:
g_fw6 [-d] sam_policy del '<Rule UID>'
Example for IPv4:
g_fw samp del '<5ac3965f,00000000,3403a8c0,0000264a>'
-
-
Add the flush-only rule
-
For IPv4, run:
g_fw samp add -t 2 quota flush true
-
For IPv6, run:
g_fw6 samp add -t 2 quota flush true
Explanation:
The "
g_fw samp del
" and "g_fw6 samp del
" commands only remove a rule from the persistent database. The Security Group Members continue to enforce the deleted rule until the next time you compiled and load a policy. To force the rule deletion immediately, you must enter a flush-only rule right after the "g_fw samp del
" and "g_fw6 samp del
" command. This flush-only rule immediately deletes the rule you specified in the previous step, and times out in 2 seconds.Best Practice - Specify a short timeout period for the flush-only rules. This prevents accumulation of rules that are obsolete in the database.
-