mirror of
https://github.com/openappsec/openappsec.git
synced 2025-09-30 11:44:29 +03:00
My 11th 2023 update
This commit is contained in:
35
components/security_apps/ips/include/ips_metric.h
Normal file
35
components/security_apps/ips/include/ips_metric.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef __IPS_METRIC_H__
|
||||
#define __IPS_METRIC_H__
|
||||
|
||||
#include "ips_signatures.h"
|
||||
#include "generic_metric.h"
|
||||
|
||||
namespace IPSSignatureSubTypes
|
||||
{
|
||||
|
||||
class MatchEvent : public Event<MatchEvent>
|
||||
{
|
||||
public:
|
||||
MatchEvent(const std::shared_ptr<CompleteSignature> &sig, SignatureAction act) : signature(sig), action(act) {}
|
||||
|
||||
const SignatureAction & getAction() const { return action; }
|
||||
|
||||
private:
|
||||
std::shared_ptr<CompleteSignature> signature;
|
||||
SignatureAction action;
|
||||
};
|
||||
|
||||
class IPSMetric : public GenericMetric, public Listener<MatchEvent>
|
||||
{
|
||||
public:
|
||||
void upon(const MatchEvent &event) override;
|
||||
|
||||
private:
|
||||
MetricCalculations::Counter prevented{this, "preventEngineMatchesSample"};
|
||||
MetricCalculations::Counter detected{this, "detectEngineMatchesSample"};
|
||||
MetricCalculations::Counter ignored{this, "ignoreEngineMatchesSample"};
|
||||
};
|
||||
|
||||
} // IPSSignatureSubTypes
|
||||
|
||||
#endif // __IPS_METRIC_H__
|
Reference in New Issue
Block a user