29#include <libsmbclient.h>
30#include <sigc++/signal.h>
65 bool updateYaraRules(std::function<
void(
int,
int,
const std::string&)> progressCallback =
nullptr);
83 std::string
checkUrl(
const std::string& url);
96 bool updateSanesecurityDB(std::function<
void(
int,
int,
const std::string&)> progressCallback =
nullptr);
104 void saveSambaConfig(
bool enabled,
const std::vector<std::string>& dirs);
116 const char* srv,
const char* shr,
119 char* pw,
int pwlen);
121 static bool isValidSMB(
const std::string& url);
126 const std::string& user,
127 const std::string& pass);
129 std::pair<std::string,std::string>
getCreds(
const std::string& url);
135 const std::string& url,
136 std::vector<std::string>& out);
140 const std::string& url,
141 std::vector<std::string>& out);
144 const std::string& smbPath,
145 std::function<
bool(
const char*,
size_t)>);
148 const std::filesystem::path& dest);
168 std::vector<std::string>
log;
181 const std::vector<std::string>& blacklistLines
static void ensureQuarantinePath()
std::function< void(const std::string &, float)> samba_progress_callback
static std::string resolveSambaDir(const std::string &path)
AntiRansomEngine antiransom_
bool isFirewallEnabled() const
std::vector< std::string > whitelist_
void setGoogleSafeEnabled(bool enabled)
bool isSambaScanRunning()
bool isBankDomain(const std::string &host) const
bool removeSambaDir(const std::string &dir)
static std::vector< std::string > getOnAccessEvents()
static std::vector< std::string > getOnAccessPaths()
static std::vector< std::string > getClamonaccLogs()
std::string samba_last_temp_dir
bool smb_copy_file(const std::string &smbPath, const std::filesystem::path &dest)
void addToWhitelist(const std::string &domain)
void loadSMBCredentials()
void requestStopSambaScan()
bool enablePhishAutoUpdate(bool enable)
std::atomic< bool > samba_stop_requested
static bool isAntiransomActive()
void scheduleFirewallApply(const std::string &inputPath)
std::string getSambaCredsPath() const
static std::string getAppVersion()
void saveSambaConfig(bool enabled, const std::vector< std::string > &dirs)
void setFirewallEnabled(bool enabled)
float samba_last_progress
sigc::signal< void(const std::string &)> antiransom_signal_
void setSambaEnabled(bool enabled)
static std::string getQuarantinePath()
std::string checkUrl(const std::string &url)
static void smb_auth_fn(SMBCCTX *context, const char *srv, const char *shr, char *wg, int wglen, char *un, int unlen, char *pw, int pwlen)
void smb_collect_files(SMBCCTX *ctx, const std::string &url, std::vector< std::string > &out)
static void setQuarantinePath(const std::string &path)
std::function< void(int, int, const std::string &)> progressCallback_
bool updateYaraRules(std::function< void(int, int, const std::string &)> progressCallback=nullptr)
static Backend & instance()
bool addSambaDir(const std::string &dir)
int getPhishingPort() const
bool updateBankListFromURL(const std::string &source_url)
void loadFirewallConfig()
std::unique_ptr< WebProbe > webprobe_
void setupAlertListener()
static bool isValidSMB(const std::string &url)
sigc::signal< void(const std::string &)> & signal_antiphish_event()
void removeFromWhitelist(const std::string &domain)
std::string googleSafeApiKey_
void setPhishingPort(int port)
std::pair< std::string, std::string > getCreds(const std::string &url)
ScanStatus get_current_scan_files()
void sendRansomwareAlert(const std::string &path, const std::string &family)
Backend & operator=(const Backend &)=delete
SMBCCTX * createThreadSmbContext()
void applyFirewallFromBlacklist(const std::vector< std::string > &blacklistLines)
static std::string getClamonaccStatus()
static std::string getLastUpdateDate()
FirewallType getFirewallType() const
std::function< void(const std::string &)> onBankListReload
bool isGoogleSafeEnabled() const
SambaScanState get_current_scan_files() const
void moveToQuarantine(const std::string &)
bool updateSanesecurityDB(std::function< void(int, int, const std::string &)> progressCallback=nullptr)
void mergeWhitelistSources()
std::vector< std::string > getSambaDirs()
std::string getSambaConfigPath() const
void setFirewallType(FirewallType fw)
void saveSMBCredentials(const std::string &url, const std::string &user, const std::string &pass)
static bool isClamonaccActive()
std::map< std::string, std::pair< std::string, std::string > > smb_credentials
static bool disableClamonacc()
void scanSambaDir(const std::string &dir)
void saveWhitelist() const
void saveFirewallConfig() const
Backend(const Backend &)=delete
std::string getGoogleSafeApiKey() const
void setGoogleSafeApiKey(const std::string &key)
FirewallType firewallType_
sigc::signal< void(const std::string &)> & signal_antiransom_event()
bool isPhishAutoUpdateEnabled()
void applyFirewallFromPhishingBlacklist()
void saveGoogleSafeConfig()
bool smb_read_file_with_ctx(SMBCCTX *ctx, const std::string &smbPath, std::function< bool(const char *, size_t)>)
SambaScanState samba_scan_state
void smb_collect_files_impl(SMBCCTX *ctx, const std::string &url, std::vector< std::string > &out)
std::vector< std::string > getWhitelist() const
static bool enableClamonacc()
static bool installClamdIfMissing()
static std::string getDbVersion()
std::vector< std::string > log
std::vector< std::string > files
std::string current_scanning