suricata
|
This feature is used to reduce the number of logged alerts for noisy rules. This can be tuned to significantly reduce false alarms, and it can also be used to write a newer breed of rules. Thresholding commands limit the number of times a particular event is logged during a specified time interval. More...
Files | |
file | detect-engine-threshold.c |
file | detect-threshold.c |
file | util-threshold-config.c |
This feature is used to reduce the number of logged alerts for noisy rules. This can be tuned to significantly reduce false alarms, and it can also be used to write a newer breed of rules. Thresholding commands limit the number of times a particular event is logged during a specified time interval.
int PacketAlertThreshold | ( | DetectEngineCtx * | de_ctx, |
DetectEngineThreadCtx * | det_ctx, | ||
const DetectThresholdData * | td, | ||
Packet * | p, | ||
const Signature * | s, | ||
PacketAlert * | pa | ||
) |
Make the threshold logic for signatures.
de_ctx | Detection Context |
tsh_ptr | Threshold element |
p | Packet structure |
s | Signature structure |
2 | silent match (no alert but apply actions) |
1 | alert on this event |
0 | do not alert on this event |
Definition at line 602 of file detect-engine-threshold.c.
References SCEnter, SCReturnInt, DetectThresholdData_::type, and TYPE_SUPPRESS.
const DetectThresholdData* SigGetThresholdTypeIter | ( | const Signature * | sig, |
const SigMatchData ** | psm, | ||
int | list | ||
) |
Return next DetectThresholdData for signature.
sig | Signature pointer |
psm | Pointer to a Signature Match pointer |
list | List to return data from |
tsh | Return the threshold data from signature or NULL if not found |
Definition at line 112 of file detect-engine-threshold.c.
Referenced by ThresholdHashAllocate().
void ThresholdContextDestroy | ( | DetectEngineCtx * | de_ctx | ) |
Destroy threshold context hash tables.
de_ctx | Detection Context |
Definition at line 728 of file detect-engine-threshold.c.
References de_ctx, SCFree, SCMutexDestroy, ThresholdCtx_::th_entry, ThresholdCtx_::th_size, ThresholdCtx_::threshold_table_lock, and DetectEngineCtx_::ths_ctx.
Referenced by DetectEngineCtxFree().
void ThresholdHashAllocate | ( | DetectEngineCtx * | de_ctx | ) |
Allocate threshold context hash tables.
de_ctx | Detection Context |
Definition at line 659 of file detect-engine-threshold.c.
References de_ctx, DETECT_SM_LIST_SUPPRESS, DETECT_SM_LIST_THRESHOLD, FatalError, Signature_::next, Signature_::num, SCCalloc, DetectEngineCtx_::sig_list, SigGetThresholdTypeIter(), Signature_::sm_arrays, ThresholdCtx_::th_entry, ThresholdCtx_::th_size, DetectEngineCtx_::ths_ctx, DetectThresholdData_::track, and TRACK_RULE.
void ThresholdHashInit | ( | DetectEngineCtx * | de_ctx | ) |
Init threshold context hash tables.
de_ctx | Detection Context |
Definition at line 647 of file detect-engine-threshold.c.
References de_ctx, FatalError, SCMutexInit, ThresholdCtx_::threshold_table_lock, and DetectEngineCtx_::ths_ctx.
int ThresholdHostHasThreshold | ( | Host * | host | ) |
Definition at line 93 of file detect-engine-threshold.c.
References HostGetStorageById().
HostStorageId ThresholdHostStorageId | ( | void | ) |
Definition at line 76 of file detect-engine-threshold.c.
Definition at line 192 of file detect-engine-threshold.c.
References head, and HostGetStorageById().
void ThresholdInit | ( | void | ) |
Definition at line 81 of file detect-engine-threshold.c.
int ThresholdIPPairHasThreshold | ( | IPPair * | pair | ) |
Definition at line 98 of file detect-engine-threshold.c.
References IPPairGetStorageById().
Definition at line 202 of file detect-engine-threshold.c.
References head, and IPPairGetStorageById().
void ThresholdListFree | ( | void * | ptr | ) |
this function will free all the entries of a list DetectTagDataEntry
td | pointer to DetectTagDataEntryList |
Definition at line 747 of file detect-engine-threshold.c.
References DetectThresholdEntry_::next, and SCFree.