Leosac  0.8.0
Open Source Access Control
Leosac::Audit Namespace Reference

The Audit namespace provides classes and facilities to keep track of what's happening on the Leosac deamon. More...

Namespaces

 Serializer
 

Classes

class  AccessPointEvent
 Provides an implementation of IAccessPointEvent. More...
 
class  AuditEntry
 Implementation of IAuditEntry, backed by ODB. More...
 
struct  AuditEntryCount
 
class  AuditTracker
 Implementation of IAuditTracker, backed by ODB. More...
 
class  CredentialEvent
 Provides an implementation of ICredentialEvent. More...
 
class  DoorEvent
 Provides an implementation of IDoorEvent. More...
 
class  Factory
 Provide static methods to instanciate various Audit objects. More...
 
class  GroupEvent
 Provides an implementation of IGroupEvent. More...
 
class  IAccessPointEvent
 Interface that describes an Audit object for AccessPoint related event. More...
 
class  IAuditEntry
 Base interface to Audit object. More...
 
class  IAuditTracker
 The AuditTracker class provides the ability to "track" the audit log and acknowledge its entries. More...
 
class  ICredentialEvent
 Audit interface to Credential related events. More...
 
class  IDoorEvent
 Interface that describes an Audit object for door related event. More...
 
class  IGroupEvent
 Interface that describes an Audit object for group related event. More...
 
class  IScheduleEvent
 Audit interface to Schedule related events. More...
 
class  IUpdateEvent
 Interface for update-related event. More...
 
class  IUserEvent
 Interface that describes an Audit object when a user-related event happens. More...
 
class  IUserGroupMembershipEvent
 Interface to audit object that take care of tracking user/group membership change. More...
 
class  IWSAPICall
 An audit entry dedicated to tracing API call. More...
 
class  IZoneEvent
 Interface that describes an Audit object for zone related event. More...
 
class  ScheduleEvent
 Provides an implementation of IScheduleEvent. More...
 
class  UpdateEvent
 Provides an implementation of IUpdateEvent. More...
 
class  UserEvent
 Provides an implementation of IUserEvent. More...
 
class  UserGroupMembershipEvent
 Provides an implementation of IUserGroupMembershipEvent. More...
 
class  WSAPICall
 Provides the implementation of IWSAPICall. More...
 
class  ZoneEvent
 Provides an implementation of IZoneEvent. More...
 

Typedefs

using AuditEntryId = unsigned long
 
using IAuditEntryPtr = std::shared_ptr< IAuditEntry >
 
using IAuditTrackerPtr = std::shared_ptr< IAuditTracker >
 
using IUserEventPtr = std::shared_ptr< IUserEvent >
 
using IGroupEventPtr = std::shared_ptr< IGroupEvent >
 
using IWSAPICallPtr = std::shared_ptr< IWSAPICall >
 
using IUserGroupMembershipEventPtr = std::shared_ptr< IUserGroupMembershipEvent >
 
using ICredentialEventPtr = std::shared_ptr< ICredentialEvent >
 
using IScheduleEventPtr = std::shared_ptr< IScheduleEvent >
 
using IDoorEventPtr = std::shared_ptr< IDoorEvent >
 
using IAccessPointEventPtr = std::shared_ptr< IAccessPointEvent >
 
using IUpdateEventPtr = std::shared_ptr< IUpdateEvent >
 
using IZoneEventPtr = std::shared_ptr< IZoneEvent >
 
using AuditEntryLPtr = odb::lazy_shared_ptr< AuditEntry >
 
using AuditEntryPtr = std::shared_ptr< AuditEntry >
 
using AuditEntryWPtr = std::weak_ptr< AuditEntry >
 
using AuditTrackerPtr = std::shared_ptr< AuditTracker >
 
using AuditTrackerWPtr = std::weak_ptr< AuditTracker >
 
using WSAPICallUPtr = std::unique_ptr< WSAPICall >
 
using WSAPICallPtr = std::shared_ptr< WSAPICall >
 
using UserEventPtr = std::shared_ptr< UserEvent >
 
using GroupEventPtr = std::shared_ptr< GroupEvent >
 
using UserGroupMembershipEventPtr = std::shared_ptr< UserGroupMembershipEvent >
 
using CredentialEventPtr = std::shared_ptr< CredentialEvent >
 
using ScheduleEventPtr = std::shared_ptr< ScheduleEvent >
 
using DoorEventPtr = std::shared_ptr< DoorEvent >
 
using AccessPointEventPtr = std::shared_ptr< AccessPointEvent >
 
using UpdateEventPtr = std::shared_ptr< UpdateEvent >
 
using ZoneEventPtr = std::shared_ptr< ZoneEvent >
 
using EventMask = FlagSet< EventType >
 

Enumerations

enum  EventType {
  EventType::WSAPI_CALL, EventType::USER_CREATED, EventType::USER_DELETED, EventType::USER_EDITED,
  EventType::USER_PASSWORD_CHANGED, EventType::USER_PASSWORD_CHANGE_FAILURE, EventType::GROUP_CREATED, EventType::GROUP_UPDATED,
  EventType::GROUP_DELETED, EventType::GROUP_MEMBERSHIP_JOINED, EventType::GROUP_MEMBERSHIP_LEFT, EventType::CREDENTIAL_DELETED,
  EventType::CREDENTIAL_CREATED, EventType::CREDENTIAL_UPDATED, EventType::SCHEDULE_CREATED, EventType::SCHEDULE_DELETED,
  EventType::SCHEDULE_UPDATED, EventType::DOOR_CREATED, EventType::DOOR_UPDATED, EventType::DOOR_DELETED,
  EventType::MAPPING_MAY_HAVE_CHANGED, EventType::ACCESS_POINT_CREATED, EventType::ACCESS_POINT_UPDATED, EventType::ACCESS_POINT_DELETED,
  EventType::UPDATE_CREATED, EventType::UPDATE_ACKED, EventType::UPDATE_CANCELLED, EventType::ZONE_CREATED,
  EventType::ZONE_UPDATED, EventType::ZONE_DELETED, EventType::LAST__
}
 

Detailed Description

The Audit namespace provides classes and facilities to keep track of what's happening on the Leosac deamon.

Through this collection of classes, Leosac is able to keep an Audit Trail of what has happened. This can be rather useful, either to generate differential update wrt configuration, or simply from a security point of view.

Note
This namespace is a bit particular, because its class are closely tied to the underlying database and consistency is really important for those objects.
The Audit namespace and its class can be more intensive wrt the database than other object. Read below for more info.

The audit classes cannot be instanciated manually. The static methods of Audit::Factory must be used instead. The factory ensure that certains step are taken before handling you back a instance of an audit object.

About the audit objects lifecycle:

  1. Call Audit::Factory::UserEvent(...) or any other valid factory method.
  2. The factory method will instanciate, then persist (in an independant database transaction) the object. Calling finalized() will return false.
  3. You have the object. Call various setter to populate it.
  4. In a database transaction, call finalize(). This will update the object state in the database. It is YOUR responsiblity to commit the transaction in which the call to finalize() happened.

Typedef Documentation

◆ AccessPointEventPtr

using Leosac::Audit::AccessPointEventPtr = typedef std::shared_ptr<AccessPointEvent>

Definition at line 111 of file AuditFwd.hpp.

◆ AuditEntryId

using Leosac::Audit::AuditEntryId = typedef unsigned long

Definition at line 31 of file AuditFwd.hpp.

◆ AuditEntryLPtr

using Leosac::Audit::AuditEntryLPtr = typedef odb::lazy_shared_ptr<AuditEntry>

Definition at line 80 of file AuditFwd.hpp.

◆ AuditEntryPtr

using Leosac::Audit::AuditEntryPtr = typedef std::shared_ptr<AuditEntry>

Definition at line 81 of file AuditFwd.hpp.

◆ AuditEntryWPtr

using Leosac::Audit::AuditEntryWPtr = typedef std::weak_ptr<AuditEntry>

Definition at line 82 of file AuditFwd.hpp.

◆ AuditTrackerPtr

using Leosac::Audit::AuditTrackerPtr = typedef std::shared_ptr<AuditTracker>

Definition at line 85 of file AuditFwd.hpp.

◆ AuditTrackerWPtr

using Leosac::Audit::AuditTrackerWPtr = typedef std::weak_ptr<AuditTracker>

Definition at line 86 of file AuditFwd.hpp.

◆ CredentialEventPtr

using Leosac::Audit::CredentialEventPtr = typedef std::shared_ptr<CredentialEvent>

Definition at line 102 of file AuditFwd.hpp.

◆ DoorEventPtr

using Leosac::Audit::DoorEventPtr = typedef std::shared_ptr<DoorEvent>

Definition at line 108 of file AuditFwd.hpp.

◆ EventMask

using Leosac::Audit::EventMask = typedef FlagSet<EventType>

Definition at line 179 of file AuditFwd.hpp.

◆ GroupEventPtr

using Leosac::Audit::GroupEventPtr = typedef std::shared_ptr<GroupEvent>

Definition at line 96 of file AuditFwd.hpp.

◆ IAccessPointEventPtr

using Leosac::Audit::IAccessPointEventPtr = typedef std::shared_ptr<IAccessPointEvent>

Definition at line 67 of file AuditFwd.hpp.

◆ IAuditEntryPtr

using Leosac::Audit::IAuditEntryPtr = typedef std::shared_ptr<IAuditEntry>

Definition at line 40 of file AuditFwd.hpp.

◆ IAuditTrackerPtr

using Leosac::Audit::IAuditTrackerPtr = typedef std::shared_ptr<IAuditTracker>

Definition at line 43 of file AuditFwd.hpp.

◆ ICredentialEventPtr

using Leosac::Audit::ICredentialEventPtr = typedef std::shared_ptr<ICredentialEvent>

Definition at line 58 of file AuditFwd.hpp.

◆ IDoorEventPtr

using Leosac::Audit::IDoorEventPtr = typedef std::shared_ptr<IDoorEvent>

Definition at line 64 of file AuditFwd.hpp.

◆ IGroupEventPtr

using Leosac::Audit::IGroupEventPtr = typedef std::shared_ptr<IGroupEvent>

Definition at line 49 of file AuditFwd.hpp.

◆ IScheduleEventPtr

using Leosac::Audit::IScheduleEventPtr = typedef std::shared_ptr<IScheduleEvent>

Definition at line 61 of file AuditFwd.hpp.

◆ IUpdateEventPtr

using Leosac::Audit::IUpdateEventPtr = typedef std::shared_ptr<IUpdateEvent>

Definition at line 70 of file AuditFwd.hpp.

◆ IUserEventPtr

using Leosac::Audit::IUserEventPtr = typedef std::shared_ptr<IUserEvent>

Definition at line 46 of file AuditFwd.hpp.

◆ IUserGroupMembershipEventPtr

Definition at line 55 of file AuditFwd.hpp.

◆ IWSAPICallPtr

using Leosac::Audit::IWSAPICallPtr = typedef std::shared_ptr<IWSAPICall>

Definition at line 52 of file AuditFwd.hpp.

◆ IZoneEventPtr

using Leosac::Audit::IZoneEventPtr = typedef std::shared_ptr<IZoneEvent>

Definition at line 73 of file AuditFwd.hpp.

◆ ScheduleEventPtr

using Leosac::Audit::ScheduleEventPtr = typedef std::shared_ptr<ScheduleEvent>

Definition at line 105 of file AuditFwd.hpp.

◆ UpdateEventPtr

using Leosac::Audit::UpdateEventPtr = typedef std::shared_ptr<UpdateEvent>

Definition at line 114 of file AuditFwd.hpp.

◆ UserEventPtr

using Leosac::Audit::UserEventPtr = typedef std::shared_ptr<UserEvent>

Definition at line 93 of file AuditFwd.hpp.

◆ UserGroupMembershipEventPtr

Definition at line 99 of file AuditFwd.hpp.

◆ WSAPICallPtr

using Leosac::Audit::WSAPICallPtr = typedef std::shared_ptr<WSAPICall>

Definition at line 90 of file AuditFwd.hpp.

◆ WSAPICallUPtr

using Leosac::Audit::WSAPICallUPtr = typedef std::unique_ptr<WSAPICall>

Definition at line 89 of file AuditFwd.hpp.

◆ ZoneEventPtr

using Leosac::Audit::ZoneEventPtr = typedef std::shared_ptr<ZoneEvent>

Definition at line 117 of file AuditFwd.hpp.

Enumeration Type Documentation

◆ EventType

Enumerator
WSAPI_CALL 
USER_CREATED 
USER_DELETED 
USER_EDITED 
USER_PASSWORD_CHANGED 
USER_PASSWORD_CHANGE_FAILURE 

An attempt to change the password failed.

GROUP_CREATED 
GROUP_UPDATED 
GROUP_DELETED 
GROUP_MEMBERSHIP_JOINED 

Someone joined the group.

GROUP_MEMBERSHIP_LEFT 

Someone left the group.

CREDENTIAL_DELETED 
CREDENTIAL_CREATED 
CREDENTIAL_UPDATED 
SCHEDULE_CREATED 
SCHEDULE_DELETED 
SCHEDULE_UPDATED 
DOOR_CREATED 
DOOR_UPDATED 
DOOR_DELETED 
MAPPING_MAY_HAVE_CHANGED 

This event is linked to door.

It is generated by the Schedule CRUD manager. It's used to let a door know that it may have been removed from a mapping.

Fixme: Currently this event is triggered for every door in a mapping everytime a schedule is updated.

ACCESS_POINT_CREATED 
ACCESS_POINT_UPDATED 
ACCESS_POINT_DELETED 
UPDATE_CREATED 
UPDATE_ACKED 
UPDATE_CANCELLED 
ZONE_CREATED 
ZONE_UPDATED 
ZONE_DELETED 
LAST__ 

Definition at line 119 of file AuditFwd.hpp.