Audit Log

The audit log is managed by an event logger provided by MnoEnterprise (MnoEnterprise::EventLogger). 






1 - What is the MnoEnterprise::EventLogger?

The MnoEnterprise::EventLogger is responsible for the following:

  • Processing of various actions performed by end users (eg: signing in, adding an application, etc.). 
    • The actions or events that the event logger tracks are pre-defined and listed in the events section below. 
  • Creating a notification for each event and dispatching those notifications to various listeners.
    • Listeners are responsible for processing the events as they see fit. 

How it works: 

  1. A user does something that triggers a logged event. 
  2. As the action is processed by MnoEnterprise the event logger is notified.
  3. Each action or event is then sent to various listeners. 
  4. Each listener is responsible for processing the event/s as they see fit. 

1.1 - Listeners

Listeners are implemented in MnoEnterprise to process the events dispatched by the MnoEnterprise::EventLogger

  1. Audit Events Listener
    • The audit events listener creates a record or audit trail of events that can be accessed via the MnoEnterprise API.
  2. Intercom Events Listener
    • The Intercom events listener creates intercom events. 
  3. DIY Listeners
    • Listeners can be created and added to the event logger to adopt custom behaviors. 

                   TODO: Technical article on DIY listeners coming soon. 

1.2 - Events 

The following events and metadata are logged via the MnoEnterprise::EventLogger

App Events 

EventDescriptionMetadata
'app_add'Application added to dashboard
{
  id: 2,
  uid: 'cld-7y9h',
  name: 'AccountingPro',
  app_nid: 'account-pro-us'
}
'app_destroy'Application deleted from dashboard
{
  id: 7,
  uid: 'cld-89r7',
  name: 'DemoApplication',
  app_nid: 'demo-app'
}
'app_launch'Application launched/started
{
  id: 4,
  uid: 'cld-8y7f',
  name: 'Inventory Tracker',
  app_nid: 'inv-track'
}


Dashboard Events

EventDescriptionMetadata
'dashboard_create'Dashboard created
{
  name: 'Sales Dashboard'
}
'dashboard_delete'Dashboard deleted
{
  name: 'Sales Dashboard'
}


Organization Events

EventDescriptionMetadata
'organization_create'Organization created
{
id: 4,
uid: "org-fbjz",
name: "abc motors"
}


'organization_destroy'Organization deleted
{
id: 4,
uid: "org-fbjz",
name: "Example Financial"
}


User Events

EventDescriptionMetadata
'user_invite'User invited to team/organization
{
user_email: 'sample@example.com',
account_name: 'Example Company'
}
'user_login'User logged into platform
{
user_name: 'John Doe',
user_email: 'john.doe@example.com'
}
'user_logout'User logged out of platform
{
user_name: 'John Doe',
user_email: 'john.doe@example.com'
}
'user_update'User attributes changed
metadata contains updated user attributes
{
name: ['old name', 'new name'],
surname: ['old name', 'new name']
}
'user_confirm'Confirmed user account
{
user_name: 'Johnny Doe',
user_email: 'JD5575@example.com'
}
'user_timeout'User session expired
{
user_name: 'Johnny Doe',
user_email: 'JD5575@example.com'
}
'user_update_password'User changed password
{
user_name: 'John Doe',
user_email: 'john.doe@example.com'
}
'register_developer'User registered as a developer
{
user_name: 'John Doe',
user_email: 'john.doe@example.com'
}


Widget Events

EventDescriptionMetadata
'widget_create'Widget added to dashboard
{
name: 'Account Balance'
}
'widget_delete'Widget removed from dashboard
{
name: 'Invoices List'
}



Events Not Currently Logged

TODO: The following events are coming soon to the Audit Log

The following events are not currently tracked by the MnoEnterprise::EventLogger

About users:
Actions not tracked:

  • change of role
  • users accepted invitations
  • users removed from an org

About sign-up:
Information missing:

  • user sign-up
  • company created through sign-up

About teams:
Actions not tracked:

  • team created
  • team deleted
  • user assigned to team
  • user removed from team
  • app assigned to team
  • app removed from team

About apps:
Actions not tracked

  • App connected to the platform

About Impac!™:
Information not tracked for Impac!

  • missing name of company for all changes
  • missing name of widget when it is deleted

Actions not tracked for Impac!

  • there is not information for "name changed" for widgets


1.2.1 - Intercom Events 

If /wiki/spaces/UKB/pages/58065026 is enabled, the MnoEnterprise::EventLogger will also create Intercom events.

NOTE: Some events are named differently when being sent to Intercom. The following table illustrates the naming differences between MnoEnterprise and Intercom.

MnoEnterpriseIntercom
'user_confirm''finished-sign-up'
'dashboard_create''added-dashboard'
'dashboard_delete''removed-dashboard'
'widget_delete''removed-widget'
'widget_create''added-widget'
'app_launched'

'launched-app-{app_nid}'

Ex:

'launched-app-inv-tracker'

'app_destroy''deleted-app-{app_nid}'
'app_add''added-app-{app_nid}'


1.2.2 - Retrieving Events via the MnoHub API 

MnoHub API Documentation (Audit Events)

The Audit Log can be viewed from the admin panel: (Note: The 'Description' field can be customized; See Below)

The 'Description' field can be set to display custom messages via a config file: 

config/audit_log.yml
default: &DEFAULT
  events:
    app_add: "%{name} added"
    user_invite: "%{user_email} invited"
    dashboard_create: Dashboard '%{dashboard_name}' created
    dashboard_delete: Dashboard '%{dashboard_name}' deleted
    widget_create: Widget '%{widget_name}' added
    widget_delete: Widget '%{widget_name}' deleted

development:
  <<: *DEFAULT

uat:
  <<: *DEFAULT

production:
  <<: *DEFAULT

test:
  <<: *DEFAULT

The variables are the one from the event metadata.