Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Filebeat] AWS CloudTrail preserve eventCategory #22805

Merged
merged 3 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Add `event.category` "configuration" to o365 module events. {pull}23010[23010]
- Add `event.category` "configuration" to zoom module events. {pull}23010[23010]
- Add `network.direction` to auditd/log fileset. {pull}23041[23041]
- Preserve AWS CloudTrail eventCategory in aws.cloudtrail.event_category. {issue}22776[22776] {pull}22805[22805]

*Heartbeat*

Expand Down
13 changes: 13 additions & 0 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,19 @@ type: keyword

--

*`aws.cloudtrail.event_category`*::
+
--
Shows the event category that is used in LookupEvents calls.

- For management events, the value is management.
- For data events, the value is data.
- For Insights events, the value is insight.

type: keyword

--

[float]
=== console_login

Expand Down
8 changes: 8 additions & 0 deletions x-pack/filebeat/module/aws/cloudtrail/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@
description: >-
Identifies the VPC endpoint in which requests were made from a
VPC to another AWS service, such as Amazon S3.
- name: event_category
type: keyword
description: |-
Shows the event category that is used in LookupEvents calls.

- For management events, the value is management.
- For data events, the value is data.
- For Insights events, the value is insight.
leehinman marked this conversation as resolved.
Show resolved Hide resolved
- name: console_login
type: group
description: >-
Expand Down
7 changes: 3 additions & 4 deletions x-pack/filebeat/module/aws/cloudtrail/ingest/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,10 @@ processors:
value: "{{json.eventName}}"
ignore_failure: true
ignore_empty_value: true
- set:
field: "event.action"
value: "{{json.eventCategory}}"
- rename:
field: "json.eventCategory"
target_field: "aws.cloudtrail.event_category"
ignore_failure: true
ignore_empty_value: true
- rename:
field: "json.awsRegion"
target_field: "cloud.region"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"awsRegion":"us-east-1","eventCategory":"Management","eventID":"REDACTED","eventName":"DescribeConfigurationRecorders","eventSource":"config.amazonaws.com","eventTime":"2014-03-25T21:08:19Z","eventType":"AwsApiCall","eventVersion":"1.07","managementEvent":true,"readOnly":true,"recipientAccountId":"REDACTED","requestID":"REDACTED","requestParameters":null,"responseElements":null,"sourceIPAddress":"REDACTED","userAgent":"REDACTED","userIdentity":{"accessKeyId":"REDACTED","accountId":"REDACTED","arn":"arn:aws:iam::REDACTED:user/REDACTED","principalId":"REDACTED","sessionContext":{"attributes":{"creationDate":"REDACTED","mfaAuthenticated":"true"},"sessionIssuer":{},"webIdFederationData":{}},"type":"IAMUser","userName":"REDACTED"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[
{
"@timestamp": "2014-03-25T21:08:19.000Z",
"aws.cloudtrail.event_category": "Management",
"aws.cloudtrail.event_type": "AwsApiCall",
"aws.cloudtrail.event_version": "1.07",
"aws.cloudtrail.management_event": true,
"aws.cloudtrail.read_only": true,
"aws.cloudtrail.recipient_account_id": "REDACTED",
"aws.cloudtrail.user_identity.access_key_id": "REDACTED",
"aws.cloudtrail.user_identity.arn": "arn:aws:iam::REDACTED:user/REDACTED",
"aws.cloudtrail.user_identity.session_context.mfa_authenticated": "true",
"aws.cloudtrail.user_identity.type": "IAMUser",
"cloud.account.id": "REDACTED",
"cloud.region": "us-east-1",
"event.action": "DescribeConfigurationRecorders",
"event.dataset": "aws.cloudtrail",
"event.id": "REDACTED",
"event.kind": "event",
"event.module": "aws",
"event.original": "{\"awsRegion\":\"us-east-1\",\"eventCategory\":\"Management\",\"eventID\":\"REDACTED\",\"eventName\":\"DescribeConfigurationRecorders\",\"eventSource\":\"config.amazonaws.com\",\"eventTime\":\"2014-03-25T21:08:19Z\",\"eventType\":\"AwsApiCall\",\"eventVersion\":\"1.07\",\"managementEvent\":true,\"readOnly\":true,\"recipientAccountId\":\"REDACTED\",\"requestID\":\"REDACTED\",\"requestParameters\":null,\"responseElements\":null,\"sourceIPAddress\":\"REDACTED\",\"userAgent\":\"REDACTED\",\"userIdentity\":{\"accessKeyId\":\"REDACTED\",\"accountId\":\"REDACTED\",\"arn\":\"arn:aws:iam::REDACTED:user/REDACTED\",\"principalId\":\"REDACTED\",\"sessionContext\":{\"attributes\":{\"creationDate\":\"REDACTED\",\"mfaAuthenticated\":\"true\"},\"sessionIssuer\":{},\"webIdFederationData\":{}},\"type\":\"IAMUser\",\"userName\":\"REDACTED\"}}",
"event.outcome": "success",
"event.provider": "config.amazonaws.com",
"event.type": "info",
"fileset.name": "cloudtrail",
"input.type": "log",
"log.offset": 0,
"service.type": "aws",
"source.address": "REDACTED",
"tags": [
"forwarded"
],
"user.id": "REDACTED",
"user.name": "REDACTED",
"user_agent.device.name": "Other",
"user_agent.name": "Other",
"user_agent.original": "REDACTED"
}
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[
{
"@timestamp": "2020-09-09T23:00:00.000Z",
"aws.cloudtrail.event_category": "Insight",
"aws.cloudtrail.event_type": "AwsCloudTrailInsight",
"aws.cloudtrail.event_version": "1.07",
"aws.cloudtrail.insight_details.eventName": "AttachUserPolicy",
Expand Down Expand Up @@ -45,7 +46,6 @@
"aws.cloudtrail.insight_details.state": "End",
"aws.cloudtrail.recipient_account_id": "123456789012",
"cloud.region": "us-east-1",
"event.action": "Insight",
"event.dataset": "aws.cloudtrail",
"event.id": "41ed77ca-d659-b45a-8e9a-74e504300007",
"event.kind": "event",
Expand Down
2 changes: 1 addition & 1 deletion x-pack/filebeat/module/aws/fields.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.