Hello team,
As cloud team reported here there is a potential performance issue when using the AWS-S3 module to monitor AWS Config logs as wazuh-alerts index pattern fields may grow continuously due to the usage of instance ids, buckets and other variables as part of the field names. It can affect the Elasticsearch performance significantly.
Proposed solution
Several solution were analyzed and discarted in the related issue. After discussing this with the Cloud team we concluded the best solution we can apply is the removal of all fields that may cause this behaviour since its possible that an AWS Config alerts references more than one instance ID.
To clarify this solution, lets take a look to an example of a problematic alert:
configuration.AWS:InstanceInformation.Content.<i-AAAAAAAAAAAAA>.ComputerName": "name",
configuration.AWS:InstanceInformation.Content.<i-AAAAAAAAAAAAA>.InstanceId": "<i-AAAAAAAAAAAAA>",
configuration.AWS:InstanceInformation.Content.<i-AAAAAAAAAAAAA>.IpAddress": "<ip>",
configuration.AWS:InstanceInformation.Content.<i-AAAAAAAAAAAAA>.AgentType": "amazon-ssm-agent",
configuration.AWS:InstanceInformation.Content.<i-AAAAAAAAAAAAA>.ResourceType": "EC2Instance",
configuration.AWS:InstanceInformation.Content.<i-AAAAAAAAAAAAA>.AgentVersion": "<version>",
configuration.AWS:InstanceInformation.Content.<i-AAAAAAAAAAAAA>.PlatformVersion": "<version>",
configuration.AWS:InstanceInformation.Content.<i-AAAAAAAAAAAAA>.PlatformName": "<platform>",
configuration.AWS:InstanceInformation.Content.<i-AAAAAAAAAAAAA>.PlatformType": "Windows"
configuration.AWS:InstanceInformation.Content.<i-BBBBBBBBBBBBB>.ComputerName": "name",
configuration.AWS:InstanceInformation.Content.<i-BBBBBBBBBBBBB>.InstanceId": "<i-BBBBBBBBBBBBB>",
configuration.AWS:InstanceInformation.Content.<i-BBBBBBBBBBBBB>.IpAddress": "<ip>",
configuration.AWS:InstanceInformation.Content.<i-BBBBBBBBBBBBB>.AgentType": "amazon-ssm-agent",
configuration.AWS:InstanceInformation.Content.<i-BBBBBBBBBBBBB>.ResourceType": "EC2Instance",
configuration.AWS:InstanceInformation.Content.<i-BBBBBBBBBBBBB>.AgentVersion": "<version>",
configuration.AWS:InstanceInformation.Content.<i-BBBBBBBBBBBBB>.PlatformVersion": "<version>",
configuration.AWS:InstanceInformation.Content.<i-BBBBBBBBBBBBB>.PlatformName": "<platform>",
configuration.AWS:InstanceInformation.Content.<i-BBBBBBBBBBBBB>.PlatformType": "Windows"
In this example <i-AAAAAAAAAAAAA> and <i-BBBBBBBBBBBBB> correspond to instance IDs that are being used as a part of the field name. With the proposed solution every field from the ID onwards will be removed from the alert:
configuration.AWS:InstanceInformation.Content
This will reduce the number of available fields in the alerts but will ensure the compatibility while avoiding the performance and resources issue. The removed fields may be added again in the future if client request them.
Required changes
To apply this solution its necessary to update our AWS-S3 module so the AWS Config alerts contaning this hierarchy will be pre-pocessed to remove problematic fields before sending them to Analysisd.
Tasks
Hello team,
As cloud team reported here there is a potential performance issue when using the AWS-S3 module to monitor AWS Config logs as
wazuh-alertsindex pattern fields may grow continuously due to the usage of instance ids, buckets and other variables as part of the field names. It can affect the Elasticsearch performance significantly.Proposed solution
Several solution were analyzed and discarted in the related issue. After discussing this with the Cloud team we concluded the best solution we can apply is the removal of all fields that may cause this behaviour since its possible that an AWS Config alerts references more than one instance ID.
To clarify this solution, lets take a look to an example of a problematic alert:
In this example
<i-AAAAAAAAAAAAA>and<i-BBBBBBBBBBBBB>correspond to instance IDs that are being used as a part of the field name. With the proposed solution every field from the ID onwards will be removed from the alert:This will reduce the number of available fields in the alerts but will ensure the compatibility while avoiding the performance and resources issue. The removed fields may be added again in the future if client request them.
Required changes
To apply this solution its necessary to update our AWS-S3 module so the AWS Config alerts contaning this hierarchy will be pre-pocessed to remove problematic fields before sending them to
Analysisd.Tasks