Cloud Defense Logo

Products

Solutions

Company

Book A Live Demo

Ensure Log Metric Filter and Alarm Rule

This rule ensures the existence of a log metric filter and alarm for IAM policy changes.

RuleEnsure a log metric filter and alarm exist for IAM policy changes
FrameworkGeneral Data Protection Regulation (GDPR)
Severity
Low

Rule Description

This rule ensures the presence of a log metric filter and alarm to track and notify IAM policy changes for compliance with the General Data Protection Regulation (GDPR). This helps organizations maintain control and transparency over access to personal data and ensure compliance with GDPR requirements.

Troubleshooting Steps (if any)

If you encounter issues while setting up the log metric filter and alarm for IAM policy changes related to GDPR, follow these troubleshooting steps:

  1. 1.

    Ensure IAM policy change logging is enabled: Check if IAM policy changes are being logged by verifying the CloudTrail configuration and log delivery settings. Make sure CloudTrail is activated and configured correctly for your AWS account.

  2. 2.

    Verify log metric filter configuration: Double-check the log metric filter settings to ensure the correct filter pattern is used to track IAM policy changes related to GDPR. Ensure that the correct CloudTrail log group is selected and that the filter pattern aligns with GDPR-specific IAM policy changes.

  3. 3.

    Review IAM policy permissions: Confirm that the IAM user or role you are using to create the log metric filter and alarm has the necessary permissions. Required permissions include "cloudwatch:PutMetricFilter" and "cloudwatch:PutMetricAlarm" as well as access to the CloudTrail logs.

  4. 4.

    Check alarm configuration: Examine the alarm configuration parameters such as threshold, evaluation period, and actions to ensure they are correctly set. Make sure the alarm triggers based on the desired conditions when IAM policy changes occur.

Necessary Codes (if any)

No specific code is required for this rule, as it pertains to the configuration and setup of log metric filters and alarms using AWS services.

Step-by-Step Guide for Remediation

To create a log metric filter and alarm for tracking IAM policy changes related to GDPR compliance, follow these steps:

Step 1: Enable CloudTrail

  1. 1.
    Open the AWS Management Console and navigate to the CloudTrail service.
  2. 2.
    Create a new trail or select an existing trail that captures the IAM policy changes.
  3. 3.
    Configure the trail settings, including the storage location and delivery frequency.
  4. 4.
    Enable logging of management events and specifically include IAM policy changes in the trail configuration.
  5. 5.
    Save the trail settings.

Step 2: Create a Log Metric Filter

  1. 1.
    Open the AWS Management Console and go to the CloudWatch service.
  2. 2.
    In the CloudWatch dashboard, navigate to the "Logs" section and select the CloudTrail log group.
  3. 3.
    Click on the "Create metric filter" button.
  4. 4.
    Define a filter pattern that matches IAM policy changes related to GDPR. For example, you can use the filter pattern:
    {($.eventName = PutGroupPolicy) || ($.eventName = PutUserPolicy) || ($.eventName = PutRolePolicy)} && ($.additionalEventData.policyType = "IdentityPolicy") && ($.additionalEventData.compliance.relatedEventName = "EnableMfaForUser")
    
  5. 5.
    Select the log groups to apply the filter to, such as the CloudTrail logs specific to GDPR-related activities.
  6. 6.
    Configure the filter details, including the metric namespace and metric name for the filter.
  7. 7.
    Save the metric filter.

Step 3: Create a Log Metric Filter Alarm

  1. 1.
    In the CloudWatch dashboard, select the "Alarms" section.
  2. 2.
    Click on the "Create alarm" button.
  3. 3.
    In the alarm configuration wizard, select the previously created metric filter as the alarm source.
  4. 4.
    Set the conditions for the alarm based on the desired policy change thresholds, such as the number of policy changes within a specific time period.
  5. 5.
    Specify the actions to be taken when the alarm triggers, such as sending notifications via email or triggering an automated response.
  6. 6.
    Review and save the alarm configuration.

Once the log metric filter and alarm are created, you will start tracking and receiving notifications for IAM policy changes related to GDPR compliance. This ensures better visibility and monitoring of access controls and maintains compliance with GDPR regulations.

Is your System Free of Underlying Vulnerabilities?
Find Out Now