lib/ah/lograge/audit_logger.rb
#
# Save audit log containing information about user accessing sensitive resource.
#
# @param [Resource] resource - accessed resource by user
# @param [Symbol] action - type of operation performed on sensitive resource (GET/DELETE/UPDATE/CREATE)
# @param [String] requester - unique user ID - e.g. OAUTHID (if action is triggered by external application,
#                              user ID must be passed (client application must also add
#                              "user" field in the request) so it can be logged in
#                              destination application - situation when user name is lost
#                              and only external_application_name is logged is unacceptable)
#
# @param [String] app - source of the request - if it is external request (from external application)
#                       name of that application must be placed / when request is local "self" must be placed
#
Save audit log containing information about user accessing sensitive resource.
Save audit log containing information about user accessing sensitive resource .
def log_resource_action(resource:, action:, requester:, customer_uid:, app: DEFAULT_APP)
          logger.tagged(AUDIT_TAG) do
            logger.info(
              audit_requester_uid: requester,
              audit_action: SYMBOL_TO_ACTION[action],
              audit_request_source: app,
              audit_resource: resource.as_json,
              audit_customer_uid: customer_uid
            )
          end
        end
def log_resource_action ( resource : , action : , requester : , customer_uid : , app : DEFAULT_APP ) logger . tagged ( AUDIT_TAG ) do logger . info ( audit_requester_uid : requester , audit_action : SYMBOL_TO_ACTION [ action ] , audit_request_source : app , audit_resource : resource . as_json , audit_customer_uid : customer_uid ) end end
Save audit log containing information about user accessing sensitive resource.
Save audit log containing information about user accessing sensitive resource .
resource
action
requester
customer_uid
app
source of the request - if it is external request (from external application) name of that application must be placed / when request is local "self" must be placed
source of the request - if it is external request ( from external application ) name of that application must be placed / when request is local " self " must be placed