Skip to content

Commit 27e6321

Browse files
committed
Addressed comments given by @kcreddy.
1 parent eab5632 commit 27e6321

File tree

10 files changed

+61
-60
lines changed

10 files changed

+61
-60
lines changed

packages/aws/data_stream/config/_dev/test/pipeline/test-event.log-expected.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,18 +95,18 @@
9595
]
9696
},
9797
"resource": {
98-
"id": "i-0a4468fbfafee6a8f",
98+
"id": "arn:aws:config:us-east-1:329599655752:config-rule/config-rule-rwpvuz",
9999
"type": "AWS::EC2::Instance"
100100
},
101101
"result": {
102-
"evaluation": "COMPLIANT"
102+
"evaluation": "passed"
103103
},
104104
"rule": {
105105
"description": "Checks whether the active access keys are rotated within the number of days specified in maxAccessKeyAge. The rule is non-compliant if the access keys have not been rotated for more than maxAccessKeyAge number of days.",
106+
"id": "config-rule-rwpvuz",
106107
"name": "access-keys-rotated",
107108
"reference": "arn:aws:config:us-east-1:329599655752:config-rule/config-rule-rwpvuz",
108-
"tags": "string",
109-
"uuid": "config-rule-rwpvuz"
109+
"tags": "string"
110110
},
111111
"tags": [
112112
"preserve_duplicate_custom_fields"

packages/aws/data_stream/config/elasticsearch/ingest_pipeline/default.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ processors:
8989
target_field: aws.config.rule_info.config_rule_id
9090
ignore_missing: true
9191
- set:
92-
field: rule.uuid
92+
field: rule.id
9393
tag: set_rule_id_from_config_config_rule_info_config_rule_id
9494
copy_from: aws.config.rule_info.config_rule_id
9595
ignore_empty_value: true
@@ -311,8 +311,8 @@ processors:
311311
ignore_missing: true
312312
- set:
313313
field: resource.id
314-
tag: set_resource_id_from_config_evaluation_result_identifier_evaluation_result_qualifier_resource_id
315-
copy_from: aws.config.evaluation_result_identifier.evaluation_result_qualifier.resource_id
314+
tag: set_resource_id_from_config_config_rule_info_config_rule_arn
315+
copy_from: aws.config.rule_info.config_rule_arn
316316
ignore_empty_value: true
317317
- rename:
318318
field: json.EvaluationResultIdentifier.EvaluationResultQualifier.ResourceType
@@ -329,15 +329,10 @@ processors:
329329
tag: rename_ComplianceType
330330
target_field: aws.config.compliance_type
331331
ignore_missing: true
332-
- set:
333-
field: result.evaluation
334-
tag: set_result_evaluation_from_aws_config_compliance_type
335-
copy_from: aws.config.compliance_type
336-
ignore_empty_value: true
337332
- script:
338-
tag: set_event_outcome_from_aws_config_compliance_type
333+
tag: set_event_outcome_and_result_evaluation_from_aws_config_compliance_type
339334
lang: painless
340-
description: set event.outcome from aws.config.compliance_type
335+
description: set event.outcome and result.evaluation from compliance_type
341336
if : ctx.aws?.config?.compliance_type instanceof String
342337
source: >-
343338
if (ctx.aws.config.compliance_type == 'NON_COMPLIANT') {
@@ -347,6 +342,24 @@ processors:
347342
} else {
348343
ctx.event.outcome = 'unknown';
349344
}
345+
- set:
346+
field: result.evaluation
347+
tag: set_result_evaluation_passed
348+
value: passed
349+
if: ctx.aws?.config?.compliance_type == 'COMPLIANT'
350+
ignore_empty_value: true
351+
- set:
352+
field: result.evaluation
353+
tag: set_result_evaluation_failed
354+
value: failed
355+
if: ctx.aws?.config?.compliance_type == 'NON_COMPLIANT'
356+
ignore_empty_value: true
357+
- set:
358+
field: result.evaluation
359+
tag: set_result_evaluation_unknown
360+
value: unknown
361+
if: ctx.result?.evaluation == null
362+
ignore_empty_value: true
350363
- rename:
351364
field: json.ConfigRuleInfo.Scope.TagValue
352365
tag: rename_ConfigRuleInfo_Scope_TagValue
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: cloud.provider
2+
type: constant_keyword
3+
- name: observer.vendor
4+
type: constant_keyword

packages/aws/data_stream/config/fields/is-transform-source-true.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/aws/data_stream/config/sample_event.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"@timestamp": "2025-05-15T07:58:22.984Z",
2+
"@timestamp": "2025-05-16T07:58:23.791Z",
33
"agent": {
4-
"ephemeral_id": "d0c3ee19-2392-4043-b593-6b17777af11d",
5-
"id": "5be90210-85df-4e5b-85b6-88ffdd10983e",
6-
"name": "elastic-agent-81980",
4+
"ephemeral_id": "6fbe87e6-993e-4c40-abbe-bbe39ee3591c",
5+
"id": "7d2ce287-1db4-4b2d-99f9-a00c406e3c06",
6+
"name": "elastic-agent-65400",
77
"type": "filebeat",
88
"version": "8.18.0"
99
},
@@ -52,14 +52,14 @@
5252
},
5353
"data_stream": {
5454
"dataset": "aws.config",
55-
"namespace": "98805",
55+
"namespace": "55739",
5656
"type": "logs"
5757
},
5858
"ecs": {
5959
"version": "8.17.0"
6060
},
6161
"elastic_agent": {
62-
"id": "5be90210-85df-4e5b-85b6-88ffdd10983e",
62+
"id": "7d2ce287-1db4-4b2d-99f9-a00c406e3c06",
6363
"snapshot": false,
6464
"version": "8.18.0"
6565
},
@@ -70,7 +70,7 @@
7070
],
7171
"created": "2015-09-29T15:52:31.883Z",
7272
"dataset": "aws.config",
73-
"ingested": "2025-05-15T07:58:25Z",
73+
"ingested": "2025-05-16T07:58:26Z",
7474
"kind": "event",
7575
"original": "{\"ComplianceType\":\"COMPLIANT\",\"ConfigRuleInfo\":{\"ConfigRuleArn\":\"arn:aws:config:us-east-1:11223344556:config-rule/config-rule-id1\",\"ConfigRuleId\":\"config-rule-id1\",\"ConfigRuleName\":\"access-keys-rotated\",\"ConfigRuleState\":\"ACTIVE\",\"Description\":\"Checks whether the active access keys are rotated within the number of days specified in maxAccessKeyAge. The rule is non-compliant if the access keys have not been rotated for more than maxAccessKeyAge number of days.\",\"EvaluationModes\":[{\"Mode\":\"DETECTIVE\"}],\"InputParameters\":\"{\\\"maxAccessKeyAge\\\":\\\"90\\\"}\",\"MaximumExecutionFrequency\":\"TwentyFour_Hours\",\"Source\":{\"Owner\":\"AWS\",\"SourceIdentifier\":\"ACCESS_KEYS_ROTATED\"}},\"ConfigRuleInvokedTime\":1444799479.852,\"EvaluationResultIdentifier\":{\"EvaluationResultQualifier\":{\"ConfigRuleName\":\"access-keys-rotated\",\"EvaluationMode\":\"DETECTIVE\",\"ResourceId\":\"i-0a4468fbfafeeg20h\",\"ResourceType\":\"AWS::EC2::Instance\"},\"OrderingTimestamp\":1443541951.883},\"ResultRecordedTime\":1444799480.061}",
7676
"outcome": "success",
@@ -87,17 +87,17 @@
8787
"vendor": "Amazon"
8888
},
8989
"resource": {
90-
"id": "i-0a4468fbfafeeg20h",
90+
"id": "arn:aws:config:us-east-1:11223344556:config-rule/config-rule-id1",
9191
"type": "AWS::EC2::Instance"
9292
},
9393
"result": {
94-
"evaluation": "COMPLIANT"
94+
"evaluation": "passed"
9595
},
9696
"rule": {
9797
"description": "Checks whether the active access keys are rotated within the number of days specified in maxAccessKeyAge. The rule is non-compliant if the access keys have not been rotated for more than maxAccessKeyAge number of days.",
98+
"id": "config-rule-id1",
9899
"name": "access-keys-rotated",
99-
"reference": "arn:aws:config:us-east-1:11223344556:config-rule/config-rule-id1",
100-
"uuid": "config-rule-id1"
100+
"reference": "arn:aws:config:us-east-1:11223344556:config-rule/config-rule-id1"
101101
},
102102
"tags": [
103103
"preserve_original_event",

packages/aws/docs/config.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ An example event for `config` looks as following:
7272

7373
```json
7474
{
75-
"@timestamp": "2025-05-15T07:58:22.984Z",
75+
"@timestamp": "2025-05-16T07:58:23.791Z",
7676
"agent": {
77-
"ephemeral_id": "d0c3ee19-2392-4043-b593-6b17777af11d",
78-
"id": "5be90210-85df-4e5b-85b6-88ffdd10983e",
79-
"name": "elastic-agent-81980",
77+
"ephemeral_id": "6fbe87e6-993e-4c40-abbe-bbe39ee3591c",
78+
"id": "7d2ce287-1db4-4b2d-99f9-a00c406e3c06",
79+
"name": "elastic-agent-65400",
8080
"type": "filebeat",
8181
"version": "8.18.0"
8282
},
@@ -125,14 +125,14 @@ An example event for `config` looks as following:
125125
},
126126
"data_stream": {
127127
"dataset": "aws.config",
128-
"namespace": "98805",
128+
"namespace": "55739",
129129
"type": "logs"
130130
},
131131
"ecs": {
132132
"version": "8.17.0"
133133
},
134134
"elastic_agent": {
135-
"id": "5be90210-85df-4e5b-85b6-88ffdd10983e",
135+
"id": "7d2ce287-1db4-4b2d-99f9-a00c406e3c06",
136136
"snapshot": false,
137137
"version": "8.18.0"
138138
},
@@ -143,7 +143,7 @@ An example event for `config` looks as following:
143143
],
144144
"created": "2015-09-29T15:52:31.883Z",
145145
"dataset": "aws.config",
146-
"ingested": "2025-05-15T07:58:25Z",
146+
"ingested": "2025-05-16T07:58:26Z",
147147
"kind": "event",
148148
"original": "{\"ComplianceType\":\"COMPLIANT\",\"ConfigRuleInfo\":{\"ConfigRuleArn\":\"arn:aws:config:us-east-1:11223344556:config-rule/config-rule-id1\",\"ConfigRuleId\":\"config-rule-id1\",\"ConfigRuleName\":\"access-keys-rotated\",\"ConfigRuleState\":\"ACTIVE\",\"Description\":\"Checks whether the active access keys are rotated within the number of days specified in maxAccessKeyAge. The rule is non-compliant if the access keys have not been rotated for more than maxAccessKeyAge number of days.\",\"EvaluationModes\":[{\"Mode\":\"DETECTIVE\"}],\"InputParameters\":\"{\\\"maxAccessKeyAge\\\":\\\"90\\\"}\",\"MaximumExecutionFrequency\":\"TwentyFour_Hours\",\"Source\":{\"Owner\":\"AWS\",\"SourceIdentifier\":\"ACCESS_KEYS_ROTATED\"}},\"ConfigRuleInvokedTime\":1444799479.852,\"EvaluationResultIdentifier\":{\"EvaluationResultQualifier\":{\"ConfigRuleName\":\"access-keys-rotated\",\"EvaluationMode\":\"DETECTIVE\",\"ResourceId\":\"i-0a4468fbfafeeg20h\",\"ResourceType\":\"AWS::EC2::Instance\"},\"OrderingTimestamp\":1443541951.883},\"ResultRecordedTime\":1444799480.061}",
149149
"outcome": "success",
@@ -160,17 +160,17 @@ An example event for `config` looks as following:
160160
"vendor": "Amazon"
161161
},
162162
"resource": {
163-
"id": "i-0a4468fbfafeeg20h",
163+
"id": "arn:aws:config:us-east-1:11223344556:config-rule/config-rule-id1",
164164
"type": "AWS::EC2::Instance"
165165
},
166166
"result": {
167-
"evaluation": "COMPLIANT"
167+
"evaluation": "passed"
168168
},
169169
"rule": {
170170
"description": "Checks whether the active access keys are rotated within the number of days specified in maxAccessKeyAge. The rule is non-compliant if the access keys have not been rotated for more than maxAccessKeyAge number of days.",
171+
"id": "config-rule-id1",
171172
"name": "access-keys-rotated",
172-
"reference": "arn:aws:config:us-east-1:11223344556:config-rule/config-rule-id1",
173-
"uuid": "config-rule-id1"
173+
"reference": "arn:aws:config:us-east-1:11223344556:config-rule/config-rule-id1"
174174
},
175175
"tags": [
176176
"preserve_original_event",
@@ -224,14 +224,15 @@ Please refer to the following [document](https://www.elastic.co/guide/en/ecs/cur
224224
| aws.config.rule_info.source.source_details.maximum_execution_frequency | The frequency at which you want AWS Config to run evaluations for a custom rule with a periodic trigger. | keyword |
225225
| aws.config.rule_info.source.source_details.message_type | The type of notification that triggers AWS Config to run an evaluation for a rule. | keyword |
226226
| aws.config.rule_info.source.source_identifier | For AWS Config Managed rules, a predefined identifier from a list. | keyword |
227+
| cloud.provider | | constant_keyword |
227228
| data_stream.dataset | Data stream dataset. | constant_keyword |
228229
| data_stream.namespace | Data stream namespace. | constant_keyword |
229230
| data_stream.type | Data stream type. | constant_keyword |
230231
| event.dataset | Event dataset. | constant_keyword |
231232
| event.module | Event module. | constant_keyword |
232233
| input.type | Type of Filebeat input. | keyword |
233-
| labels.is_transform_source | Distinguishes between documents that are a source for a transform and documents that are an output of a transform, to facilitate easier filtering. | constant_keyword |
234234
| log.offset | Log offset. | long |
235+
| observer.vendor | | constant_keyword |
235236
| resource.id | | keyword |
236237
| resource.type | | keyword |
237238
| result.evaluation | | keyword |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: cloud.provider
2+
type: constant_keyword
3+
- name: observer.vendor
4+
type: constant_keyword

packages/aws/elasticsearch/transform/latest_config_misconfigurations/fields/is-transform-source-false.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/aws/elasticsearch/transform/latest_config_misconfigurations/manifest.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

packages/aws/elasticsearch/transform/latest_config_misconfigurations/transform.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ dest:
99
move_on_creation: true
1010
latest:
1111
unique_key:
12-
- rule.uuid
12+
- rule.id
1313
- resource.id
1414
- data_stream.namespace
15-
- data_stream.dataset
1615
sort: "@timestamp"
1716
description: >-
1817
Latest Configs from AWS. As configs get updated, this transform stores only the latest state of each config inside the destination index. Thus the transform's destination index contains only the latest state of the config.
1918
frequency: 5m
2019
settings:
2120
# This is required to prevent the transform from clobbering the Fleet-managed mappings.
22-
deduce_mappings: false
2321
unattended: true
2422
sync:
2523
time:
@@ -29,7 +27,7 @@ sync:
2927
retention_policy:
3028
time:
3129
field: "@timestamp"
32-
max_age: 2160h
30+
max_age: 24h
3331
_meta:
3432
managed: true
3533
# Bump this version to delete, reinstall, and restart the transform during

0 commit comments

Comments
 (0)