forked from opensearch-project/dashboards-observability
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added cloudtrail, waf, vpc_flow integrations
Signed-off-by: Amardeepsingh Siglani <[email protected]>
- Loading branch information
Showing
7 changed files
with
207 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
...ns/__data__/repository/amazon_vpc_flow/assets/aws_vpc_flow_security_lake_2_0-1.0.0.ndjson
Large diffs are not rendered by default.
Oops, something went wrong.
40 changes: 40 additions & 0 deletions
40
.../__data__/repository/amazon_vpc_flow/assets/aws_vpc_mv_schema_security_lake_2_0-1.0.0.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
CREATE MATERIALIZED VIEW {table_name}__live_mview_2 AS | ||
SELECT | ||
CAST(IFNULL(`src_endpoint.port`, 0) AS LONG) AS `aws.vpc.srcport`, | ||
CAST(IFNULL(`src_endpoint.ip`, 'Unknown') AS STRING) AS `aws.vpc.pkt-src-aws-service`, | ||
CAST(IFNULL(`src_endpoint.ip`, '0.0.0.0') AS STRING) AS `aws.vpc.srcaddr`, | ||
CAST(IFNULL(`src_endpoint.interface_uid`, 'Unknown') AS STRING) AS `aws.vpc.src-interface_uid`, | ||
CAST(IFNULL(src_endpoint.vpc_uid, 'Unknown') AS STRING) AS `aws.vpc.src-vpc_uid`, | ||
CAST(IFNULL(src_endpoint.instance_uid, 'Unknown') AS STRING) AS `aws.vpc.src-instance_uid`, | ||
CAST(IFNULL(src_endpoint.subnet_uid, 'Unknown') AS STRING) AS `aws.vpc.src-subnet_uid`, | ||
CAST(IFNULL(dst_endpoint.port, 0) AS LONG) AS `aws.vpc.dstport`, | ||
CAST(IFNULL(dst_endpoint.ip, 'Unknown') AS STRING) AS `aws.vpc.pkt-dst-aws-service`, | ||
CAST(IFNULL(dst_endpoint.ip, '0.0.0.0') AS STRING) AS `aws.vpc.dstaddr`, | ||
CAST(IFNULL(connection_info.direction, 'Unknown') AS STRING) AS `aws.vpc.flow-direction`, | ||
CAST(IFNULL(connection_info.tcp_flags, '0') AS STRING) AS `aws.vpc.connection.tcp_flags`, | ||
CAST(IFNULL(traffic.packets, 0) AS LONG) AS `aws.vpc.packets`, | ||
CAST(IFNULL(traffic.bytes, 0) AS LONG) AS `aws.vpc.bytes`, | ||
CAST(start_time_dt AS TIMESTAMP) AS `@timestamp`, | ||
CAST(start_time_dt AS TIMESTAMP) AS `start_time`, | ||
CAST(start_time_dt AS TIMESTAMP) AS `interval_start_time`, | ||
CAST(end_time_dt AS TIMESTAMP) AS `end_time`, | ||
CAST(IFNULL(status_code, 'Unknown') AS STRING) AS `aws.vpc.status_code`, | ||
CAST(IFNULL(metadata.product.version, 0) AS LONG) AS `aws.vpc.version`, | ||
CAST(IFNULL(connection_info.protocol_ver, 'Unknown') AS STRING) AS `aws.vpc.type_name`, | ||
CAST(IFNULL(connection_info.boundary_id, 0) AS LONG) AS `aws.vpc.traffic_path`, | ||
CAST(IFNULL(cloud.zone, 'Unknown') AS STRING) AS `aws.vpc.az_id`, | ||
CAST(IFNULL(activity_name, 'Unknown') AS STRING) AS `aws.vpc.action`, | ||
CAST(IFNULL(cloud.region, 'Unknown') AS STRING) AS `aws.vpc.region`, | ||
CAST(IFNULL(cloud.account.uid, 'Unknown') AS STRING) AS `aws.vpc.account-id`, | ||
CAST(IFNULL(unmapped['sublocation_type'], 'Unknown') AS STRING) AS `aws.vpc.sublocation_type`, | ||
CAST(IFNULL(unmapped['sublocation_id'], 'Unknown') AS STRING) AS `aws.vpc.sublocation_id` | ||
|
||
FROM | ||
{table_name} | ||
WITH ( | ||
auto_refresh = true, | ||
refresh_interval = '15 Minute', | ||
checkpoint_location = '{s3_checkpoint_location}', | ||
watermark_delay = '1 Minute', | ||
extra_options = '{ "{table_name}": { "maxFilesPerTrigger": "10" }}' | ||
) |
53 changes: 53 additions & 0 deletions
53
...data__/repository/aws_cloudtrail/assets/create_mv_cloud-trail_security_lake_2_0-1.0.0.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
CREATE MATERIALIZED VIEW {table_name}__mview AS | ||
SELECT | ||
CAST(IFNULL(`actor.user.type`, 'Unknown') AS STRING) AS `aws.cloudtrail.userIdentity.type`, | ||
CAST(IFNULL(`actor.user.uid_alt`, 'Unknown') AS STRING) AS `aws.cloudtrail.userIdentity.principalId`, | ||
CAST(IFNULL(`actor.user.uid`, 'Unknown') AS STRING) AS `aws.cloudtrail.userIdentity.arn`, | ||
CAST(IFNULL(`actor.user.account.uid`, 'Unknown') AS STRING) AS `aws.cloudtrail.userIdentity.accountId`, | ||
CAST(IFNULL(`actor.invoked_by`, 'Unknown') AS STRING) AS `aws.cloudtrail.userIdentity.invokedBy`, | ||
CAST(IFNULL(`actor.user.credential_uid`, 'Unknown') AS STRING) AS `aws.cloudtrail.userIdentity.accessKeyId`, | ||
CAST(IFNULL(`actor.user.name`, 'Unknown') AS STRING) AS `aws.cloudtrail.userIdentity.userName`, | ||
CAST(IFNULL(`actor.session.is_mfa`, False) AS BOOLEAN) AS `aws.cloudtrail.userIdentity.sessionContext.attributes.mfaAuthenticated`, | ||
CAST( actor.session.created_time_dt AS TIMESTAMP) AS `aws.cloudtrail.userIdentity.sessionContext.attributes.creationDate`, | ||
CAST(IFNULL(unmapped['userIdentity.sessionContext.sessionIssuer.type'], 'Unknown') AS STRING) AS `aws.cloudtrail.userIdentity.sessionContext.sessionIssuer.type`, | ||
CAST(IFNULL(unmapped['userIdentity.sessionContext.sessionIssuer.principalId'], 'Unknown') AS STRING) AS `aws.cloudtrail.userIdentity.sessionContext.sessionIssuer.principalId`, | ||
CAST(IFNULL(`actor.session.issuer`, 'Unknown') AS STRING) AS `aws.cloudtrail.userIdentity.sessionContext.sessionIssuer.arn`, | ||
CAST(IFNULL(unmapped['userIdentity.sessionContext.sessionIssuer.accountId'], 'Unknown') AS STRING) AS `aws.cloudtrail.userIdentity.sessionContext.sessionIssuer.accountId`, | ||
CAST(IFNULL(unmapped['userIdentity.sessionContext.sessionIssuer.userName'], 'Unknown') AS STRING) AS `aws.cloudtrail.userIdentity.sessionContext.sessionIssuer.userName`, | ||
CAST(IFNULL(unmapped['userIdentity.sessionContext.ec2RoleDelivery'], 'Unknown') AS STRING) AS `aws.cloudtrail.userIdentity.sessionContext.ec2RoleDelivery`, | ||
|
||
CAST(IFNULL(`metadata.product.version`, 'Unknown') AS STRING) AS `aws.cloudtrail.eventVersion`, | ||
CAST( time AS TIMESTAMP) AS `@timestamp`, | ||
CAST(IFNULL(`api.service.name`, 'Unknown') AS STRING) AS `aws.cloudtrail.eventSource`, | ||
CAST(IFNULL(`api.operation`, 'Unknown') AS STRING) AS `aws.cloudtrail.eventName`, | ||
CAST(IFNULL(`metadata.product.feature.name`, 'Unknown') AS STRING) AS `aws.cloudtrail.eventCategory`, | ||
CAST(IFNULL(`metadata.event_code`, 'Unknown') AS STRING) AS `aws.cloudtrail.eventType`, | ||
CAST(IFNULL(`metadata.uid`, 'Unknown') AS STRING) AS `aws.cloudtrail.eventId`, | ||
|
||
CAST(IFNULL(`cloud.region`, 'Unknown') AS STRING) AS `aws.cloudtrail.awsRegion`, | ||
CAST(IFNULL(`src_endpoint.ip`, '0.0.0.0') AS STRING) AS `aws.cloudtrail.sourceIPAddress`, | ||
CAST(IFNULL(`http_request.user_agent`, 'Unknown') AS STRING) AS `aws.cloudtrail.userAgent`, | ||
CAST(IFNULL(`api.response.error`, 'Unknown') AS STRING) AS `errorCode`, | ||
CAST(IFNULL(`api.response.message`, 'Unknown') AS STRING) AS `errorMessage`, | ||
CAST(IFNULL(`api.request.data`, 'Unknown') AS STRING) AS `aws.cloudtrail.requestParameter`, | ||
CAST(IFNULL(`api.response.data`, 'Unknown') AS STRING) AS `aws.cloudtrail.responseElements`, | ||
CAST(IFNULL(`dst_endpoint.svc_name`, 'Unknown') AS STRING) AS `aws.cloudtrail.additionalEventData`, | ||
CAST(IFNULL(`api.request.uid`, 'Unknown') AS STRING) AS `aws.cloudtrail.requestId`, | ||
resources AS `aws.cloudtrail.resources`, | ||
CAST(IFNULL(`api.version`, 'Unknown') AS STRING) AS `aws.cloudtrail.apiVersion`, | ||
CAST(IFNULL(unmapped['readOnly'], False) AS BOOLEAN) AS `aws.cloudtrail.readOnly`, | ||
CAST(IFNULL(unmapped['recipientAccountId'], 0) AS LONG) AS `aws.cloudtrail.recipientAccountId`, | ||
CAST(IFNULL(unmapped['sharedEventId'], 'Unknown') AS STRING) AS `aws.cloudtrail.sharedEventId`, | ||
CAST(IFNULL(`src_endpoint.uid`, 'Unknown') AS STRING) AS `aws.cloudtrail.vpcEndpointId`, | ||
CAST(IFNULL(unmapped['tlsDetails.tlsVersion'], 'Unknown') AS STRING) AS `aws.cloudtrail.tlsDetails.tls_version`, | ||
CAST(IFNULL(unmapped['tlsDetails.cipherSuite'], 'Unknown') AS STRING) AS `aws.cloudtrail.tlsDetailscipher_suite`, | ||
CAST(IFNULL(unmapped['tlsDetails.clientProvidedHostHeader'], 'Unknown') AS STRING) AS `aws.cloudtrail.tlsDetailsclient_provided_host_header` | ||
FROM | ||
{table_name} | ||
WITH ( | ||
auto_refresh = true, | ||
refresh_interval = '15 Minute', | ||
checkpoint_location = '{s3_checkpoint_location}', | ||
watermark_delay = '1 Minute', | ||
extra_options = '{ "{table_name}": { "maxFilesPerTrigger": "10" }}' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...ors/integrations/__data__/repository/aws_waf/assets/create_mv_security_lake_2_0-1.0.0.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
CREATE MATERIALIZED VIEW {table_name}__mview AS | ||
SELECT | ||
CAST(FROM_UNIXTIME(`time`/ 1000) AS TIMESTAMP) AS `@timestamp`, | ||
CAST(IFNULL(`metadata.product.version`, 'Unknown') AS STRING) AS `aws.waf.formatVersion`, | ||
CAST(IFNULL(`metadata.product.feature.uid`, 'Unknown') AS STRING) AS `aws.waf.webaclId`, | ||
CAST(IFNULL(`firewall_rule.uid`, 'Unknown') AS STRING) AS `aws.waf.terminatingRuleId`, | ||
CAST(IFNULL(`firewall_rule.type`, 'Unknown') AS STRING) AS `aws.waf.terminatingRuleType`, | ||
CAST(IFNULL(action, 'Unknown') AS STRING) AS `aws.waf.action`, | ||
CAST(IFNULL(`src_endpoint.svc_name`, 'Unknown') AS STRING) AS `aws.waf.httpSourceName`, | ||
CAST(IFNULL(`src_endpoint.uid`, 'Unknown') AS STRING) AS `aws.waf.httpSourceId`, | ||
ruleGroupList AS `aws.waf.ruleGroupList`, | ||
unmapped['rateBasedRuleList'] AS `aws.waf.rateBasedRuleList`, | ||
nonTerminatingMatchingRules AS `aws.waf.nonTerminatingMatchingRules`, | ||
CAST(IFNULL(`http_status`, 0) AS LONG) AS `aws.waf.responseCodeSent`, | ||
httpRequest AS `aws.waf.httpRequest`, | ||
metadata.labels AS `aws.waf.labels`, | ||
unmapped['captchaResponse'] AS `aws.waf.captchaResponse` | ||
FROM | ||
{table_name} | ||
WITH ( | ||
auto_refresh = true, | ||
refresh_interval = '15 Minute', | ||
checkpoint_location = '{s3_checkpoint_location}', | ||
watermark_delay = '1 Minute', | ||
extra_options = '{ "{table_name}": { "maxFilesPerTrigger": "10" }}' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters