Skip to content

Commit

Permalink
feat(#3339): Add schema for custom table
Browse files Browse the repository at this point in the history
  • Loading branch information
nico-stefani committed Jan 9, 2023
1 parent 0fdddf3 commit 970c8c0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions deps/wazuh_testing/wazuh_testing/modules/aws/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
# Bucket types
CLOUD_TRAIL_TYPE = 'cloudtrail'
VPC_FLOW_TYPE = 'vpcflow'
ALB_TYPE = 'alb'
KMS_TYPE = 'kms'
TRUSTED_ADVISOR_TYPE = 'trusted'
CUSTOM_TYPE = 'custom'
15 changes: 13 additions & 2 deletions deps/wazuh_testing/wazuh_testing/modules/aws/db_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
from pathlib import Path
from typing import Iterator, Type

from .constants import S3_CLOUDTRAIL_DB_PATH, CLOUD_TRAIL_TYPE, ALB_TYPE
from .constants import (
ALB_TYPE,
CLOUD_TRAIL_TYPE,
CUSTOM_TYPE,
KMS_TYPE,
S3_CLOUDTRAIL_DB_PATH,
)

SELECT_QUERY_TEMPLATE = 'SELECT * FROM {table_name}'

Expand All @@ -15,9 +21,14 @@
'S3ALBFlowRow', 'bucket_path aws_account_id log_key processed_date created_date'
)

S3CustomRow = namedtuple(
'S3CustomRow', 'bucket_path aws_account_id log_key processed_date created_date'
)

s3_rows_map = {
CLOUD_TRAIL_TYPE: S3CloudTrailRow,
ALB_TYPE: S3ALBFlowRow
ALB_TYPE: S3ALBFlowRow,
CUSTOM_TYPE: S3CustomRow
}


Expand Down

0 comments on commit 970c8c0

Please sign in to comment.