USBGuard
Software framework that protects your computer against rogue USB devices by implementing basic whitelisting and blacklisting capabilities.
|
Generates audit events for given policy or device events. More...
#include <Audit.hpp>
Public Member Functions | |
Audit (const AuditIdentity &identity) | |
Constructs new audit object with given AuditIdentity and hidePII set to false. More... | |
void | setBackend (std::unique_ptr< AuditBackend > backend) |
Sets AuditBackend that will be used to commit generated audit events. More... | |
void | setHidePII (bool hide_pii) |
Sets whether personally identifiable information such as device serial numbers and hashes of the descriptors (which include the serial number) should be excluded from audit entries. More... | |
AuditEvent | policyEvent (std::shared_ptr< Rule > rule, Policy::EventType event) |
Constructs new AuditEvent for given policy event. More... | |
AuditEvent | policyEvent (std::shared_ptr< Rule > new_rule, std::shared_ptr< Rule > old_rule) |
Constructs new AuditEvent for given policy event. More... | |
AuditEvent | policyEvent (std::shared_ptr< Device > device, Policy::EventType event) |
Constructs new AuditEvent for given policy event. More... | |
AuditEvent | policyEvent (std::shared_ptr< Device > device, Rule::Target old_target, Rule::Target new_target) |
Constructs new AuditEvent for given policy event. More... | |
AuditEvent | deviceEvent (std::shared_ptr< Device > device, DeviceManager::EventType event) |
Constructs new AuditEvent for given device event. More... | |
AuditEvent | deviceEvent (std::shared_ptr< Device > new_device, std::shared_ptr< Device > old_device) |
Constructs new AuditEvent for given device event. More... | |
AuditEvent | policyEvent (const AuditIdentity &identity, std::shared_ptr< Rule > rule, Policy::EventType event) |
Constructs new AuditEvent for given policy event. More... | |
AuditEvent | policyEvent (const AuditIdentity &identity, std::shared_ptr< Rule > new_rule, std::shared_ptr< Rule > old_rule) |
Constructs new AuditEvent for given policy event. More... | |
AuditEvent | policyEvent (const AuditIdentity &identity, std::shared_ptr< Device > device, Policy::EventType event) |
Constructs new AuditEvent for given policy event. More... | |
AuditEvent | policyEvent (const AuditIdentity &identity, std::shared_ptr< Device > device, Rule::Target old_target, Rule::Target new_target) |
Constructs new AuditEvent for given policy event. More... | |
AuditEvent | deviceEvent (const AuditIdentity &identity, std::shared_ptr< Device > device, DeviceManager::EventType event) |
Constructs new AuditEvent for given device event. More... | |
AuditEvent | deviceEvent (const AuditIdentity &identity, std::shared_ptr< Device > new_device, std::shared_ptr< Device > old_device) |
Constructs new AuditEvent for given device event. More... | |
Generates audit events for given policy or device events.
usbguard::Audit::Audit | ( | const AuditIdentity & | identity | ) |
Constructs new audit object with given AuditIdentity and hidePII set to false.
identity | Audit identity. |
AuditEvent usbguard::Audit::deviceEvent | ( | std::shared_ptr< Device > | device, |
DeviceManager::EventType | event | ||
) |
Constructs new AuditEvent for given device event.
Sets audit event keys:
Audit device changes:
Audit data:
device | Device where the event occured. |
event | Device event type. |
AuditEvent usbguard::Audit::deviceEvent | ( | std::shared_ptr< Device > | new_device, |
std::shared_ptr< Device > | old_device | ||
) |
Constructs new AuditEvent for given device event.
Sets audit event keys:
Audit device changes:
Audit data:
new_device | New device. |
old_device | Old device. |
AuditEvent usbguard::Audit::deviceEvent | ( | const AuditIdentity & | identity, |
std::shared_ptr< Device > | device, | ||
DeviceManager::EventType | event | ||
) |
Constructs new AuditEvent for given device event.
Sets audit event keys:
Audit device changes:
Audit data:
identity | Audit identity. |
device | Device where the event occured. |
event | Device event type. |
AuditEvent usbguard::Audit::deviceEvent | ( | const AuditIdentity & | identity, |
std::shared_ptr< Device > | new_device, | ||
std::shared_ptr< Device > | old_device | ||
) |
Constructs new AuditEvent for given device event.
Sets audit event keys:
Audit device changes:
Audit data:
identity | Audit identity. |
new_device | New device. |
old_device | Old device. |
AuditEvent usbguard::Audit::policyEvent | ( | std::shared_ptr< Rule > | rule, |
Policy::EventType | event | ||
) |
Constructs new AuditEvent for given policy event.
Sets audit event keys:
Audit policy changes:
Audit data:
rule | Rule to audit. |
event | Event to audit. |
AuditEvent usbguard::Audit::policyEvent | ( | std::shared_ptr< Rule > | new_rule, |
std::shared_ptr< Rule > | old_rule | ||
) |
Constructs new AuditEvent for given policy event.
Sets audit event keys:
Audit policy changes:
Audit data:
new_rule | New rule to audit. |
old_rule | Old rule to audit. |
AuditEvent usbguard::Audit::policyEvent | ( | std::shared_ptr< Device > | device, |
Policy::EventType | event | ||
) |
Constructs new AuditEvent for given policy event.
Sets audit event keys:
Audit policy changes:
Audit data:
device | Device where the event occured. |
event | Event to audit. |
AuditEvent usbguard::Audit::policyEvent | ( | std::shared_ptr< Device > | device, |
Rule::Target | old_target, | ||
Rule::Target | new_target | ||
) |
Constructs new AuditEvent for given policy event.
Sets audit event keys:
Audit policy changes:
Audit data:
device | Device where the rule target has changed. |
old_target | Old rule target. |
new_target | New rule target. |
AuditEvent usbguard::Audit::policyEvent | ( | const AuditIdentity & | identity, |
std::shared_ptr< Rule > | rule, | ||
Policy::EventType | event | ||
) |
Constructs new AuditEvent for given policy event.
Sets audit event keys:
Audit policy changes:
Audit data:
identity | Audit identity. |
rule | Rule to audit. |
event | Event to audit. |
AuditEvent usbguard::Audit::policyEvent | ( | const AuditIdentity & | identity, |
std::shared_ptr< Rule > | new_rule, | ||
std::shared_ptr< Rule > | old_rule | ||
) |
Constructs new AuditEvent for given policy event.
Sets audit event keys:
Audit policy changes:
Audit data:
identity | Audit identity. |
new_rule | New rule to audit. |
old_rule | Old rule to audit. |
AuditEvent usbguard::Audit::policyEvent | ( | const AuditIdentity & | identity, |
std::shared_ptr< Device > | device, | ||
Policy::EventType | event | ||
) |
Constructs new AuditEvent for given policy event.
Sets audit event keys:
Audit policy changes:
Audit data:
identity | Audit identity. |
device | Device where the event occured. |
event | Event to audit. |
AuditEvent usbguard::Audit::policyEvent | ( | const AuditIdentity & | identity, |
std::shared_ptr< Device > | device, | ||
Rule::Target | old_target, | ||
Rule::Target | new_target | ||
) |
Constructs new AuditEvent for given policy event.
Sets audit event keys:
Audit policy changes:
Audit data:
identity | Audit identity. |
device | Device where the rule target has changed. |
old_target | Old rule target. |
new_target | New rule target. |
void usbguard::Audit::setBackend | ( | std::unique_ptr< AuditBackend > | backend | ) |
Sets AuditBackend that will be used to commit generated audit events.
backend | AuditBackend to use for commiting audit events. |
void usbguard::Audit::setHidePII | ( | bool | hide_pii | ) |
Sets whether personally identifiable information such as device serial numbers and hashes of the descriptors (which include the serial number) should be excluded from audit entries.
hide_pii | If true then personally identifiable information will be excluded from audit entries. |