The WorksAudit Book
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode

AC Legacy Log Synchronization

AC Legacy Log Synchronization

Following diagram summarizes the process synchronizing AC access log from COMPANY AC system to WorksAudit central bucket:

AC Log Synchronization

Referring to the diagram above, the process can be explained as follows:

  1. There is an EventBridge rule wap-audit-lambda-data-ec2-scheduler-cw-event-rule-{env} that will trigger a lambda wap-audit-lambda-data-ec2-scheduler-{env} every hour. This lambda source code is here.
  2. The lambda checks following environment variables to query EC2 instances that should be started (if any):
    1. target_ec2_instances_tag_key
    2. target_ec2_instances_tag_value
  3. For example, if target_ec2_instances_tag_key=group and target_ec2_instances_tag_value=ac-log-sync-instances, all EC2 instances that is has tag group=ac-log-sync-instances will be started.
  4. The EC2 instances for this operation will have some other tags for specifying how the synchronizer should behave (e.g. which AC server to use).
  5. Once the EC2 instance is started a local NodeJS script will be started with the logic as shown above.
  6. This script invokes two Ruby scripts provided by AC team to access AC service.