Cloud Defense Logo

Products

Solutions

Company

Book A Live Demo

Ensure a Log Metric Filter and Alarm Exist for AWS Config Configuration Changes Rule

This rule ensures the presence of a log metric filter and alarm for AWS Config configuration changes.

RuleEnsure a log metric filter and alarm exist for AWS Config configuration changes
Frameworkcis_v130
Severity
Low

Rule Description:

This rule ensures that a log metric filter and alarm are in place to monitor AWS Config configuration changes for cis_v130 compliance. AWS Config provides a detailed inventory of your AWS resources and helps you assess the compliance of your environment against security best practices. By implementing this rule, you can receive notifications whenever a configuration change occurs within your AWS account.

Troubleshooting Steps:

If the log metric filter and alarm do not exist or are not working as expected, follow these troubleshooting steps:

  1. 1.
    Ensure AWS Config is enabled in your AWS account. Navigate to the AWS Management Console and search for "AWS Config." If it is not enabled, follow the AWS Config documentation to enable it.
  2. 2.
    Verify if the log metric filter and alarm are defined correctly. Check the CloudWatch Logs and CloudWatch Alarms for any issues or misconfigurations.
  3. 3.
    Make sure the IAM role associated with AWS Config has appropriate permissions to create logs and alarms. Review the IAM policy attached to the role and make necessary adjustments if required.
  4. 4.
    Check the CloudTrail logs for any errors or unusual activities related to AWS Config. This can help identify any potential issues or unauthorized access.
  5. 5.
    Restart the affected AWS resources or services if the configuration changes are not being captured or monitored properly. This can sometimes resolve underlying problems.

Necessary Codes (if applicable):

If any custom configurations or code snippets are needed to implement this rule, they will be provided below:

  1. 1.
    Create a log metric filter for AWS Config configuration changes:
aws logs put-metric-filter 
   --log-group-name <log_group_name> 
   --filter-name <filter_name> 
   --filter-pattern <filter_pattern> 
   --metric-transformations 
      metricName=<metric_name>,metricNamespace=<metric_namespace>,metricValue=<metric_value>
  1. 1.
    Create an alarm based on the log metric filter created above:
aws cloudwatch put-metric-alarm 
   --alarm-name <alarm_name> 
   --metric-name <metric_name> 
   --namespace <metric_namespace> 
   --statistic <statistic> 
   --period <period> 
   --threshold <threshold> 
   --comparison-operator <comparison_operator> 
   --evaluation-periods <evaluation_periods> 
   --actions-enabled 
   --alarm-description <alarm_description> 
   --dimensions Name=<dimension_name>,Value=<dimension_value>

Steps for Remediation:

Follow these steps to remediate the rule:

  1. 1.
    Open the AWS Management Console and navigate to the AWS Config service.
  2. 2.
    Enable AWS Config if it is not already enabled. Follow the AWS Config documentation for detailed instructions on enabling it.
  3. 3.
    Access the CloudWatch service in the AWS Management Console.
  4. 4.
    Create a log metric filter to capture AWS Config configuration changes. Use the AWS CLI command provided above, replacing the placeholders (<log_group_name>, <filter_name>, <filter_pattern>, <metric_name>, <metric_namespace>, <metric_value>) with appropriate values.
  5. 5.
    Create an alarm based on the log metric filter created in the previous step. Use the AWS CLI command provided above, replacing the placeholders (<alarm_name>, <metric_name>, <metric_namespace>, <statistic>, <period>, <threshold>, <comparison_operator>, <evaluation_periods>, <alarm_description>, <dimension_name>, <dimension_value>) with appropriate values.
  6. 6.
    Review the alarm settings and adjust them if necessary.
  7. 7.
    Test the configuration changes by making a small change to an AWS resource, ensuring that the log metric filter and alarm capture the change.
  8. 8.
    Monitor the alerts and notifications generated by the alarm to validate its effectiveness.
  9. 9.
    If the rule requires continuous monitoring, ensure that resources and services associated with AWS Config are restarted or updated periodically to maintain consistent monitoring.

By following these steps, you can ensure the presence of a log metric filter and alarm to track AWS Config configuration changes for cis_v130 compliance.

Is your System Free of Underlying Vulnerabilities?
Find Out Now