mirror of
https://github.com/openappsec/openappsec.git
synced 2025-09-29 11:16:30 +03:00
My 11th 2023 update
This commit is contained in:
@@ -39,6 +39,8 @@ public:
|
||||
Package::ChecksumTypes checksum_type,
|
||||
const std::string &service_name
|
||||
) const = 0;
|
||||
|
||||
virtual std::string getProfileFromMap(const std::string &tenant_id) const = 0;
|
||||
};
|
||||
|
||||
#endif // __I_DOWNLOADER_H__
|
||||
|
30
components/include/i_keywords_rule.h
Normal file
30
components/include/i_keywords_rule.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#ifndef ___I_KEYWORDS_RULE_H__
|
||||
#define ___I_KEYWORDS_RULE_H__
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "maybe_res.h"
|
||||
|
||||
class I_KeywordsRule
|
||||
{
|
||||
public:
|
||||
class VirtualRule
|
||||
{
|
||||
public:
|
||||
virtual ~VirtualRule() {};
|
||||
virtual bool isMatch() const = 0;
|
||||
};
|
||||
|
||||
virtual Maybe<std::shared_ptr<VirtualRule>> genRule(const std::string &rule) = 0;
|
||||
|
||||
static const std::string & getKeywordsRuleTag() { return keywords_tag; }
|
||||
|
||||
protected:
|
||||
virtual ~I_KeywordsRule() {}
|
||||
|
||||
private:
|
||||
static std::string keywords_tag;
|
||||
};
|
||||
|
||||
#endif // ___I_KEYWORDS_RULE_H__
|
@@ -111,6 +111,10 @@ public:
|
||||
virtual bool removeFile(const std::string &path) const = 0;
|
||||
virtual bool copyFile(const std::string &src_path, const std::string &dst_path) const = 0;
|
||||
virtual bool doesFileExist(const std::string &file_path) const = 0;
|
||||
virtual void fillKeyInJson(
|
||||
const std::string &filename,
|
||||
const std::string &_key,
|
||||
const std::string &_val) const = 0;
|
||||
virtual bool createDirectory(const std::string &directory_path) const = 0;
|
||||
virtual bool doesDirectoryExist(const std::string &dir_path) const = 0;
|
||||
virtual bool executeCmd(const std::string &cmd) const = 0;
|
||||
|
35
components/include/ips_comp.h
Normal file
35
components/include/ips_comp.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef __IPS_COMP_H__
|
||||
#define __IPS_COMP_H__
|
||||
|
||||
#include "singleton.h"
|
||||
#include "i_keywords_rule.h"
|
||||
#include "i_table.h"
|
||||
#include "i_http_manager.h"
|
||||
#include "i_environment.h"
|
||||
#include "http_inspection_events.h"
|
||||
#include "i_generic_rulebase.h"
|
||||
#include "component.h"
|
||||
|
||||
class IPSComp
|
||||
:
|
||||
public Component,
|
||||
Singleton::Consume<I_KeywordsRule>,
|
||||
Singleton::Consume<I_Table>,
|
||||
Singleton::Consume<I_Environment>,
|
||||
Singleton::Consume<I_GenericRulebase>
|
||||
{
|
||||
public:
|
||||
IPSComp();
|
||||
~IPSComp();
|
||||
|
||||
void preload();
|
||||
|
||||
void init();
|
||||
void fini();
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
std::unique_ptr<Impl> pimpl;
|
||||
};
|
||||
|
||||
#endif // __IPS_COMP_H__
|
28
components/include/keyword_comp.h
Normal file
28
components/include/keyword_comp.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef __KEYWORD_COMP__
|
||||
#define __KEYWORD_COMP__
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "singleton.h"
|
||||
#include "i_environment.h"
|
||||
#include "i_table.h"
|
||||
#include "i_keywords_rule.h"
|
||||
#include "component.h"
|
||||
|
||||
class KeywordComp
|
||||
:
|
||||
public Component,
|
||||
Singleton::Provide<I_KeywordsRule>,
|
||||
Singleton::Consume<I_Table>,
|
||||
Singleton::Consume<I_Environment>
|
||||
{
|
||||
public:
|
||||
KeywordComp();
|
||||
~KeywordComp();
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
std::unique_ptr<Impl> pimpl;
|
||||
};
|
||||
|
||||
#endif // __KEYWORD_COMP__
|
13
components/include/output.h
Normal file
13
components/include/output.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef __OUTPUT_H__
|
||||
#define __OUTPUT_H__
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace infra
|
||||
{
|
||||
|
||||
std::string printChar(char ch);
|
||||
|
||||
} // namespace infra
|
||||
|
||||
#endif // __OUTPUT_H__
|
Reference in New Issue
Block a user