#include <AutomaticResponseSink.hpp>
Classes | |
| struct | PendingService |
Public Member Functions | |
| AutomaticResponseSink (IEventSink &downstream, bool autoBlockSystemServices) | |
| ~AutomaticResponseSink () override | |
| AutomaticResponseSink (const AutomaticResponseSink &)=delete | |
| AutomaticResponseSink & | operator= (const AutomaticResponseSink &)=delete |
| void | onEvent (const rg_event &event) noexcept override |
| void | setAutoBlockSystemServices (bool enabled) noexcept |
| Public Member Functions inherited from bastionguard::rootguard::IEventSink | |
| virtual | ~IEventSink ()=default |
Private Member Functions | |
| void | workerLoop () noexcept |
| void | enqueueService (const std::filesystem::path &path, const rg_event &source) noexcept |
| void | emitServiceResult (const std::filesystem::path &path, const rg_event &source, bool success) noexcept |
Private Attributes | |
| IEventSink & | downstream_ |
| std::atomic< bool > | autoBlockSystemServices_ {true} |
| std::mutex | mutex_ |
| std::condition_variable | condition_ |
| std::deque< PendingService > | queue_ |
| std::set< std::string > | queuedPaths_ |
| bool | stopping_ {} |
| std::thread | worker_ |
Definition at line 16 of file AutomaticResponseSink.hpp.
|
explicit |
Definition at line 48 of file AutomaticResponseSink.cpp.
References autoBlockSystemServices_, AutomaticResponseSink(), downstream_, worker_, and workerLoop().
Referenced by AutomaticResponseSink(), AutomaticResponseSink(), and operator=().
|
override |
Definition at line 56 of file AutomaticResponseSink.cpp.
References condition_, mutex_, stopping_, and worker_.
|
delete |
References AutomaticResponseSink().
|
privatenoexcept |
Definition at line 132 of file AutomaticResponseSink.cpp.
References downstream_, rg_event::event_type, RG_EVENT_SERVICE_BLOCKED, RG_VERDICT_ALERT, and RG_VERDICT_BLOCKED.
Referenced by operator=(), and workerLoop().
|
privatenoexcept |
Definition at line 97 of file AutomaticResponseSink.cpp.
References condition_, mutex_, queue_, queuedPaths_, and stopping_.
Referenced by onEvent(), and operator=().
|
overridevirtualnoexcept |
Implements bastionguard::rootguard::IEventSink.
Definition at line 72 of file AutomaticResponseSink.cpp.
References autoBlockSystemServices_, downstream_, enqueueService(), and bastionguard::rootguard::identifySystemService().
Referenced by operator=().
|
delete |
|
noexcept |
Definition at line 67 of file AutomaticResponseSink.cpp.
References autoBlockSystemServices_.
Referenced by main(), and operator=().
|
privatenoexcept |
Definition at line 111 of file AutomaticResponseSink.cpp.
References bastionguard::rootguard::blockSystemService(), condition_, emitServiceResult(), mutex_, bastionguard::rootguard::AutomaticResponseSink::PendingService::path, queue_, queuedPaths_, bastionguard::rootguard::AutomaticResponseSink::PendingService::source, and stopping_.
Referenced by AutomaticResponseSink(), and operator=().
|
private |
Definition at line 42 of file AutomaticResponseSink.hpp.
Referenced by AutomaticResponseSink(), onEvent(), and setAutoBlockSystemServices().
|
private |
Definition at line 44 of file AutomaticResponseSink.hpp.
Referenced by enqueueService(), workerLoop(), and ~AutomaticResponseSink().
|
private |
Definition at line 41 of file AutomaticResponseSink.hpp.
Referenced by AutomaticResponseSink(), emitServiceResult(), and onEvent().
|
private |
Definition at line 43 of file AutomaticResponseSink.hpp.
Referenced by enqueueService(), workerLoop(), and ~AutomaticResponseSink().
|
private |
Definition at line 45 of file AutomaticResponseSink.hpp.
Referenced by enqueueService(), and workerLoop().
|
private |
Definition at line 46 of file AutomaticResponseSink.hpp.
Referenced by enqueueService(), and workerLoop().
|
private |
Definition at line 47 of file AutomaticResponseSink.hpp.
Referenced by enqueueService(), workerLoop(), and ~AutomaticResponseSink().
|
private |
Definition at line 48 of file AutomaticResponseSink.hpp.
Referenced by AutomaticResponseSink(), and ~AutomaticResponseSink().