Go to the source code of this file.
Classes | |
| struct | SessionEntry |
| struct | TunnelSession |
| struct | ParsedRequest |
| class | BastionApp |
Macros | |
| #define | LOCALEDIR "/usr/share/BastionGuard/locale" |
| #define | BG_WARNING_HTTP_PORT 81 |
| #define | BG_WARNING_HTTPS_PORT 444 |
| #define | BG_WARNING_ADDR "127.0.0.2" |
Typedefs | |
| using | tcp = asio::ip::tcp |
| using | Clock = std::chrono::steady_clock |
Functions | |
| static std::string | root_domain (const std::string &host) |
| static void | sandbox_close (const std::string &root) |
| static void | sandbox_bind_pid (const std::string &root, pid_t pid) |
| static void | sandbox_close_if_pid (const std::string &root, pid_t pid) |
| static bool | session_active (const std::string &root, std::string &out_type) |
| static bool | session_try_open (const std::string &root, const std::string &type) |
| static void | session_bind_pid (const std::string &root, pid_t pid) |
| static void | session_close (const std::string &root) |
| static void | session_close_if_pid (const std::string &root, pid_t pid) |
| static void | launch_sandbox (const std::string &url, bool is_bank, const std::string &root) |
| static bool | parse_request (const std::string &first_line, ParsedRequest &out) |
| static void | async_tunnel (tcp::socket sock, const std::string &host, const std::string &port) |
| static void | async_forward_http (tcp::socket sock, const ParsedRequest &req, const std::string &full_request) |
| static std::string | warning_url_for (const std::string &host, const std::string &type) |
| static std::string | local_warning_url_for (const std::string &host, const std::string &type) |
| static void | open_notify_window (const std::string &root, const std::string &host, const std::string &type, int argc, char **argv) |
| static bool | sandbox_try_open (const std::string &root) |
| static void | block_active_session (std::shared_ptr< tcp::socket > sock, const ParsedRequest &req, const std::string &type) |
| static void | block_secure_request (std::shared_ptr< tcp::socket > sock, const ParsedRequest &req, const std::string &type, const std::string &root, int argc, char **argv) |
| static void | handle_client (tcp::socket client, int argc, char **argv) |
| static void | do_accept (tcp::acceptor &acceptor, int argc, char **argv) |
| static bool | running_confined () |
| static bool | parse_args (int argc, char **argv, std::string &listen_host, int &listen_port) |
| int | main (int argc, char **argv) |
Variables | |
| static constexpr auto | SESSION_TTL = std::chrono::minutes(30) |
| static const unsigned int | IO_THREADS |
| static asio::io_context | g_io {static_cast<int>(IO_THREADS)} |
| static std::mutex | g_session_mutex |
| static std::unordered_map< std::string, SessionEntry > | g_sessions |
| static std::mutex | g_notify_mutex |
| static std::unordered_set< std::string > | g_notify_open |
| static std::mutex | g_sandbox_mutex |
| static std::unordered_set< std::string > | g_sandbox_open |
| static std::unordered_map< std::string, pid_t > | g_sandbox_pid |
| #define BG_WARNING_ADDR "127.0.0.2" |
Definition at line 76 of file bastionguard_cef.cpp.
Referenced by local_warning_url_for(), and main().
| #define BG_WARNING_HTTP_PORT 81 |
Definition at line 70 of file bastionguard_cef.cpp.
Referenced by local_warning_url_for(), and main().
| #define BG_WARNING_HTTPS_PORT 444 |
Definition at line 73 of file bastionguard_cef.cpp.
Referenced by main().
| #define LOCALEDIR "/usr/share/BastionGuard/locale" |
Definition at line 67 of file bastionguard_cef.cpp.
Referenced by bastionguard_mo_exists(), init_i18n(), main(), main(), and main().
| using Clock = std::chrono::steady_clock |
Definition at line 86 of file bastionguard_cef.cpp.
| using tcp = asio::ip::tcp |
Definition at line 85 of file bastionguard_cef.cpp.
|
static |
Definition at line 385 of file bastionguard_cef.cpp.
References async_forward_http(), g_io, ParsedRequest::host, ParsedRequest::method, ParsedRequest::path, and ParsedRequest::port.
Referenced by async_forward_http(), and handle_client().
|
static |
Definition at line 348 of file bastionguard_cef.cpp.
References async_tunnel(), and g_io.
Referenced by async_tunnel(), and handle_client().
|
static |
Definition at line 541 of file bastionguard_cef.cpp.
References block_active_session(), ParsedRequest::host, ParsedRequest::is_connect, and warning_url_for().
Referenced by block_active_session(), and handle_client().
|
static |
Definition at line 576 of file bastionguard_cef.cpp.
References block_secure_request(), ParsedRequest::host, ParsedRequest::is_connect, launch_sandbox(), open_notify_window(), ParsedRequest::path, sandbox_try_open(), session_close(), session_try_open(), and warning_url_for().
Referenced by block_secure_request(), and handle_client().
|
static |
Definition at line 776 of file bastionguard_cef.cpp.
References _, do_accept(), g_io, and handle_client().
Referenced by do_accept(), and main().
|
static |
Definition at line 647 of file bastionguard_cef.cpp.
References _, async_forward_http(), async_tunnel(), block_active_session(), block_secure_request(), domain_filter(), handle_client(), ParsedRequest::host, DomainFilter::is_bank(), ParsedRequest::is_connect, DomainFilter::is_local_network(), DomainFilter::is_proxy_bypass(), DomainFilter::is_secure(), ParsedRequest::method, parse_request(), ParsedRequest::port, root_domain(), and session_active().
Referenced by accept_loop(), do_accept(), and handle_client().
|
static |
Definition at line 233 of file bastionguard_cef.cpp.
References _, launch_sandbox(), sandbox_bind_pid(), sandbox_close(), sandbox_close_if_pid(), session_bind_pid(), session_close(), and session_close_if_pid().
Referenced by block_secure_request(), and launch_sandbox().
|
static |
Definition at line 467 of file bastionguard_cef.cpp.
References BG_WARNING_ADDR, BG_WARNING_HTTP_PORT, and local_warning_url_for().
Referenced by local_warning_url_for().
| int main | ( | int | argc, |
| char ** | argv ) |
Definition at line 955 of file bastionguard_cef.cpp.
References _, SettingsStore::apply_language(), BastionApp::BastionApp(), BG_WARNING_ADDR, BG_WARNING_HTTP_PORT, BG_WARNING_HTTPS_PORT, BastionGuard::Platform::cef_available(), do_accept(), domain_filter(), g_io, IO_THREADS, DomainFilter::load(), LOCALEDIR, main(), parse_args(), running_confined(), LocalWarningServer::start(), and LocalWarningServer::stop().
|
static |
Definition at line 477 of file bastionguard_cef.cpp.
References _, g_notify_mutex, g_notify_open, SecureBrowser::open_notify(), open_notify_window(), and warning_url_for().
Referenced by block_secure_request(), and open_notify_window().
|
static |
Definition at line 843 of file bastionguard_cef.cpp.
References _, and parse_args().
Referenced by main(), main(), parse_args(), and parse_args().
|
static |
Definition at line 309 of file bastionguard_cef.cpp.
References ParsedRequest::host, ParsedRequest::is_connect, ParsedRequest::is_http_plain, ParsedRequest::method, parse_request(), ParsedRequest::path, and ParsedRequest::port.
Referenced by handle_client(), and parse_request().
|
static |
Definition at line 90 of file bastionguard_cef.cpp.
References root_domain().
Referenced by handle_client(), and root_domain().
|
static |
Definition at line 887 of file bastionguard_cef.cpp.
References running_confined(), and S_ISUID.
Referenced by BastionApp::BastionApp(), main(), and running_confined().
|
static |
Definition at line 520 of file bastionguard_cef.cpp.
References g_sandbox_mutex, g_sandbox_open, g_sandbox_pid, and sandbox_bind_pid().
Referenced by launch_sandbox(), and sandbox_bind_pid().
|
static |
Definition at line 535 of file bastionguard_cef.cpp.
References g_sandbox_mutex, g_sandbox_open, g_sandbox_pid, and sandbox_close().
Referenced by launch_sandbox(), sandbox_close(), and session_active().
|
static |
Definition at line 526 of file bastionguard_cef.cpp.
References g_sandbox_mutex, g_sandbox_open, g_sandbox_pid, and sandbox_close_if_pid().
Referenced by launch_sandbox(), and sandbox_close_if_pid().
|
static |
Definition at line 512 of file bastionguard_cef.cpp.
References g_sandbox_mutex, g_sandbox_open, g_sandbox_pid, and sandbox_try_open().
Referenced by block_secure_request(), and sandbox_try_open().
|
static |
Definition at line 115 of file bastionguard_cef.cpp.
References g_session_mutex, g_sessions, sandbox_close(), session_active(), and SESSION_TTL.
Referenced by handle_client(), and session_active().
|
static |
Definition at line 144 of file bastionguard_cef.cpp.
References g_session_mutex, g_sessions, and session_bind_pid().
Referenced by launch_sandbox(), and session_bind_pid().
|
static |
Definition at line 151 of file bastionguard_cef.cpp.
References _, g_session_mutex, g_sessions, and session_close().
Referenced by block_secure_request(), launch_sandbox(), and session_close().
|
static |
Definition at line 166 of file bastionguard_cef.cpp.
References _, g_session_mutex, g_sessions, and session_close_if_pid().
Referenced by launch_sandbox(), and session_close_if_pid().
|
static |
Definition at line 137 of file bastionguard_cef.cpp.
References g_session_mutex, g_sessions, and session_try_open().
Referenced by block_secure_request(), and session_try_open().
|
static |
Definition at line 463 of file bastionguard_cef.cpp.
References warning_url_for().
Referenced by block_active_session(), block_secure_request(), open_notify_window(), and warning_url_for().
|
static |
Definition at line 88 of file bastionguard_cef.cpp.
Referenced by async_forward_http(), async_tunnel(), do_accept(), and main().
|
static |
Definition at line 474 of file bastionguard_cef.cpp.
Referenced by open_notify_window().
|
static |
Definition at line 475 of file bastionguard_cef.cpp.
Referenced by open_notify_window().
|
static |
Definition at line 508 of file bastionguard_cef.cpp.
Referenced by sandbox_bind_pid(), sandbox_close(), sandbox_close_if_pid(), and sandbox_try_open().
|
static |
Definition at line 509 of file bastionguard_cef.cpp.
Referenced by sandbox_bind_pid(), sandbox_close(), sandbox_close_if_pid(), and sandbox_try_open().
|
static |
Definition at line 510 of file bastionguard_cef.cpp.
Referenced by sandbox_bind_pid(), sandbox_close(), sandbox_close_if_pid(), and sandbox_try_open().
|
static |
Definition at line 104 of file bastionguard_cef.cpp.
Referenced by session_active(), session_bind_pid(), session_close(), session_close_if_pid(), and session_try_open().
|
static |
Definition at line 105 of file bastionguard_cef.cpp.
Referenced by session_active(), session_bind_pid(), session_close(), session_close_if_pid(), and session_try_open().
|
static |
Definition at line 81 of file bastionguard_cef.cpp.
Referenced by main().
|
staticconstexpr |
Definition at line 79 of file bastionguard_cef.cpp.
Referenced by session_active().