Go to the source code of this file.
Classes | |
| struct | DbInfo |
Namespaces | |
| namespace | anonymous_namespace{Backend.cpp} |
Typedefs | |
| using | json = nlohmann::json |
Functions | |
| static std::string | b64_encode (const std::string &s) |
| static std::string | b64_decode (const std::string &s) |
| static std::string | xor_crypt (const std::string &input) |
| static std::string | encrypt_pass (const std::string &pass) |
| static std::string | decrypt_pass (const std::string &enc) |
| static std::string | trim (const std::string &s) |
| static std::string | extract_path_from_clamav_line (const std::string &line) |
| static std::vector< std::string > | clamDbDirs () |
| static std::time_t | filetime_to_time_t (fs::file_time_type ft) |
| static bool | read_cvd_header (const std::string &path, DbInfo &out) |
| static std::string | first_existing (const std::vector< std::string > &names) |
| std::pair< int, int > | read_ports_from_conf () |
| static void | restart_clamd () |
| static bool | install_to_system_data (const std::string &src, const std::string &dest) |
| static std::string | getUserConfigDir () |
| static std::string | getConfigFilePath () |
| static void | persistQuarantinePath (const std::string &path) |
| static void | loadQuarantinePathFromConfig () |
| static void | ensureQuarantinePath () |
| static std::string | getRuntimeDataDir () |
| static bool | copy_to_final (const std::string &src, const std::string &dest) |
| static std::string | findClamonaccService () |
| static int | installPackages (const std::vector< std::string > &args) |
| static std::string | detectDistro () |
| static bool | isClamdInstalled () |
| static bool | run_phishing_updater_script (const std::string &staging_dir) |
| static bool | is_writable_dir (const std::filesystem::path &dir) |
| static std::filesystem::path | make_temp_scan_dir () |
| static size_t | write_cb (void *c, size_t s, size_t n, std::string *o) |
| bool | anonymous_namespace{Backend.cpp}::create_secure_firewall_input (const std::vector< std::string > &blacklistLines, std::string &outPath) |
| int | anonymous_namespace{Backend.cpp}::run_firewall_helper (const std::string &inputPath) |
Variables | |
| static const std::string | SMB_KEY = "BastionGuard0101SecretKey" |
| static std::string | quarantinePath = Glib::get_home_dir() + "/.local/share/BastionGuard/quarantine" |
| static const char * | CLAMONACC_SERVICES [] |
| sigc::signal< void(const std::string &)> | antiphish_signal_ |
| using json = nlohmann::json |
Definition at line 2908 of file Backend.cpp.
|
static |
Definition at line 90 of file Backend.cpp.
References b64_decode().
Referenced by b64_decode(), decrypt_pass(), Backend::getCreds(), Backend::loadSMBCredentials(), and Backend::saveSMBCredentials().
|
static |
Definition at line 86 of file Backend.cpp.
References b64_encode().
Referenced by b64_encode(), encrypt_pass(), and Backend::saveSMBCredentials().
|
static |
Definition at line 132 of file Backend.cpp.
References clamDbDirs().
Referenced by clamDbDirs(), and first_existing().
|
static |
Definition at line 431 of file Backend.cpp.
References _, and copy_to_final().
Referenced by copy_to_final(), Backend::updatePhishLists(), and Backend::updateSanesecurityDB().
|
static |
Definition at line 107 of file Backend.cpp.
References b64_decode(), decrypt_pass(), and xor_crypt().
Referenced by decrypt_pass(), Backend::getCreds(), and Backend::saveSMBCredentials().
|
static |
Definition at line 653 of file Backend.cpp.
References detectDistro(), and BastionGuard::Platform::distribution_id().
Referenced by detectDistro(), and Backend::installClamdIfMissing().
|
static |
Definition at line 103 of file Backend.cpp.
References b64_encode(), encrypt_pass(), and xor_crypt().
Referenced by encrypt_pass(), and Backend::saveSMBCredentials().
|
static |
Definition at line 399 of file Backend.cpp.
References _, ensureQuarantinePath(), and quarantinePath.
Referenced by ensureQuarantinePath().
|
static |
Definition at line 122 of file Backend.cpp.
References extract_path_from_clamav_line().
Referenced by extract_path_from_clamav_line().
|
static |
Definition at line 149 of file Backend.cpp.
References filetime_to_time_t().
Referenced by filetime_to_time_t(), and read_cvd_header().
|
static |
Definition at line 443 of file Backend.cpp.
References CLAMONACC_SERVICES, findClamonaccService(), bg_process::Result::ok(), and bg_process::run().
Referenced by Backend::disableClamonacc(), Backend::enableClamonacc(), and findClamonaccService().
|
static |
Definition at line 227 of file Backend.cpp.
References clamDbDirs(), and first_existing().
Referenced by first_existing().
|
static |
Definition at line 351 of file Backend.cpp.
References getConfigFilePath(), and getUserConfigDir().
Referenced by getConfigFilePath(), and loadQuarantinePathFromConfig().
|
static |
Definition at line 413 of file Backend.cpp.
References getRuntimeDataDir().
Referenced by getRuntimeDataDir(), Backend::updatePhishLists(), Backend::updateSanesecurityDB(), and Backend::updateYaraRules().
|
static |
Definition at line 341 of file Backend.cpp.
References getUserConfigDir().
Referenced by getConfigFilePath(), getUserConfigDir(), and persistQuarantinePath().
|
static |
Definition at line 321 of file Backend.cpp.
References _, install_to_system_data(), restart_clamd(), and bg_process::run().
Referenced by install_to_system_data(), and Backend::updateSanesecurityDB().
|
static |
Definition at line 646 of file Backend.cpp.
References bg_process::Result::exit_code, installPackages(), and bg_process::run().
Referenced by Backend::installClamdIfMissing(), and installPackages().
|
static |
Definition at line 1783 of file Backend.cpp.
References is_writable_dir().
Referenced by is_writable_dir(), and make_temp_scan_dir().
|
static |
Definition at line 658 of file Backend.cpp.
References bg_process::exists_on_path(), and isClamdInstalled().
Referenced by Backend::installClamdIfMissing(), and isClamdInstalled().
|
static |
Definition at line 378 of file Backend.cpp.
References getConfigFilePath(), loadQuarantinePathFromConfig(), and quarantinePath.
Referenced by Backend::Backend(), Backend::getQuarantinePath(), and loadQuarantinePathFromConfig().
|
static |
Definition at line 1803 of file Backend.cpp.
References is_writable_dir(), and make_temp_scan_dir().
Referenced by make_temp_scan_dir(), and Backend::scanSambaDir().
|
static |
Definition at line 355 of file Backend.cpp.
References _, getUserConfigDir(), and persistQuarantinePath().
Referenced by persistQuarantinePath(), and Backend::setQuarantinePath().
|
static |
Definition at line 159 of file Backend.cpp.
References DbInfo::epoch, DbInfo::file, filetime_to_time_t(), read_cvd_header(), and DbInfo::version.
Referenced by read_cvd_header().
| std::pair< int, int > read_ports_from_conf | ( | ) |
Definition at line 288 of file Backend.cpp.
References read_ports_from_conf().
Referenced by Backend::Backend(), and read_ports_from_conf().
|
static |
Definition at line 308 of file Backend.cpp.
References _, bg_process::Result::exit_code, restart_clamd(), and bg_process::run().
Referenced by install_to_system_data(), and restart_clamd().
|
static |
Definition at line 1005 of file Backend.cpp.
References _, and run_phishing_updater_script().
Referenced by run_phishing_updater_script(), and Backend::updatePhishLists().
|
inlinestatic |
Definition at line 112 of file Backend.cpp.
References trim().
Referenced by fill_ext_set(), Backend::getSambaDirs(), load_allowlist(), load_config(), load_samba_dirs(), Backend::saveSambaConfig(), Backend::scanSambaDir(), split_semicolon_list(), trim(), trim(), trim(), trim(), and Backend::updatePhishLists().
|
static |
Definition at line 2799 of file Backend.cpp.
References write_cb().
Referenced by write_cb().
|
static |
Definition at line 96 of file Backend.cpp.
References SMB_KEY, and xor_crypt().
Referenced by decrypt_pass(), encrypt_pass(), and xor_crypt().
| sigc::signal<void(const std::string&)> antiphish_signal_ |
Definition at line 1627 of file Backend.cpp.
Referenced by Backend::checkUrl(), and Backend::signal_antiphish_event().
|
static |
Definition at line 407 of file Backend.cpp.
Referenced by findClamonaccService(), Backend::getClamonaccLogs(), Backend::getOnAccessEvents(), and Backend::isClamonaccActive().
|
static |
Definition at line 339 of file Backend.cpp.
Referenced by ensureQuarantinePath(), Backend::getQuarantinePath(), loadQuarantinePathFromConfig(), and Backend::setQuarantinePath().
|
static |
Definition at line 94 of file Backend.cpp.
Referenced by xor_crypt().