Skip to main content

Triage and Remediation

Remediation

Using Console

Below are concise, step‑by‑step console instructions to fix the finding “FMS Web ACL should have rule group association” in AWS (for a Web ACL managed by AWS Firewall Manager / AWS WAF).

1. Identify the FMS Web ACL with the Finding

  1. Open AWS Management Console.
  2. Go to Security Hub (or the service that raised the finding, if different).
  3. Open the specific finding:
    • Look for a finding mentioning something like FMS Web ACL Should Have Rule Group Association or similar.
    • In the finding details, note:
      • The Web ACL name and ID.
      • The Region.
      • The resource type (e.g., CloudFront distribution, Application Load Balancer, API Gateway).

2. Go to the Web ACL in AWS WAF

  1. Switch to the Region from the finding (for CloudFront Web ACLs, use us-east-1).
  2. In the console, go to AWS WAF & Shield.
  3. In the left menu, choose Web ACLs.
  4. Find and select the Web ACL identified in the finding (match by name/ID).

3. Create or Choose a Rule Group

If you already have a rule group you want to associate, skip to Step 4.To create a new rule group:
  1. In AWS WAF, in the left menu, select Rule groups.
  2. Click Create rule group.
  3. Configure:
    • Name: e.g., fms-required-rule-group.
    • CloudWatch metric name: any valid name.
    • Region: same as Web ACL (or us-east-1 for CloudFront).
    • Capacity: set an appropriate WCU number based on your planned rules.
  4. Under Rules, click Add rules and define at least one rule (e.g., IP match, rate-based, etc.).
  5. Click Create rule group to save.

4. Associate the Rule Group with the Web ACL

  1. Return to Web ACLs.
  2. Click the target Web ACL.
  3. Choose the Rules tab (or Rules section within the Web ACL editor).
  4. Click Add rulesAdd my own rules and rule groups.
  5. In the Rule groups section:
    • Select the relevant Rule group (managed by you or AWS managed rule groups, if appropriate).
    • Set an Action override if needed (e.g., Count/Block/Allow, if allowed by the UI).
  6. Arrange rule order (priority) if there are multiple rules/rule groups.
  7. Click Save or Save changes at the bottom.

5. (If Using AWS Firewall Manager Policy) Ensure Policy Includes a Rule Group

If the Web ACL is managed by Firewall Manager, you typically should not manually edit the Web ACL; instead:
  1. Open AWS Firewall Manager in the console.
  2. Go to Security policies.
  3. Find and select the policy that manages this Web ACL.
  4. Click Edit policy.
  5. In the Policy rules or Add AWS WAF rules section:
    • Add the desired Rule groups to the policy (e.g., your custom rule group or AWS managed rule groups).
  6. Save the policy.
Firewall Manager will push the updated rule groups to all member Web ACLs governed by that policy.

6. Verify Remediation

  1. In AWS WAF, open the Web ACL and confirm at least one Rule group is listed in the Rules.
  2. Wait for Security Hub (or the originating service) to re‑evaluate:
    • Usually within a few minutes to a few hours, the finding should move to Resolved / PASSED state if everything is correct.
This addresses the requirement that the FMS-managed Web ACL must have at least one rule group associated.
In AWS there is no WAF scope called “CloudWatch,” so I’ll assume you mean an AWS WAFv2 Web ACL managed by Firewall Manager (FMS) that currently has no rule groups associated. The fix is to update that Web ACL (or its FMS policy) to include at least one rule group.Below is a minimal, CLI‑only approach using WAFv2 (scope REGIONAL or CLOUDFRONT); adapt names/ARNs as needed.

1. Identify the Web ACL missing rule groups

Note the Id and Name of the target Web ACL.Then get full details:
Check the Rules array; it is likely empty ([]).You’ll also need the Web ACL’s LockToken from this output for the update.

2. Choose or create a rule group

Option A – Use an AWS Managed Rule Group

For example, the AWS managed “CommonRuleSet”:
  • Vendor: AWS
  • Name: AWSManagedRulesCommonRuleSet
You don’t create this; you only reference it.

Option B – Use your own existing rule group

List your rule groups if you have custom ones:
Pick the rule group ARN from the output.

3. Build the new rule set JSON

Create a file rules.json with at least one rule referencing a rule group.Example using an AWS managed rule group:
If using a custom rule group instead:

4. Update the Web ACL to associate the rule group

From step 1 you have:
  • Name
  • Id
  • LockToken
  • Existing DefaultAction and VisibilityConfig (must be preserved)
First, capture the existing Web ACL config (excluding Rules):
Open web-acl-current.json and note:
  • "DefaultAction" block
  • "VisibilityConfig" block
  • "Description" (optional)
  • "LockToken"
Now run update-web-acl, providing the new rules:
Replace DefaultAction and VisibilityConfig with the values from your current Web ACL instead of the example above.

5. (If using Firewall Manager) Update via FMS Policy instead

If the Web ACL is managed by Firewall Manager, best practice is to modify the FMS policy, not the Web ACL directly:
  1. Get the policy:
  1. In fms-policy.json, under SecurityServicePolicyData.ManagedServiceData, you’ll find a JSON string describing the WAF configuration. Edit that JSON to add the rule groups (similar to step 3).
  2. Put the updated policy:
This will regenerate/update the underlying Web ACLs with rule group associations.
After these steps, the FMS-managed Web ACL will have at least one rule group associated, satisfying the “FMS Web ACL Should Have Rule Group Association” requirement.
Below are concrete, step‑by‑step remediation instructions and a Python (boto3) example to ensure a Firewall Manager (FMS)–managed WAFv2 Web ACL has at least one rule group associated.

1. Understand the Requirement

FMS Web ACL Should Have Rule Group Association” means:
  • The Web ACLs that are managed by AWS Firewall Manager must include at least one Rule Group (AWS managed or customer managed).
  • For WAFv2, this means the Web ACL’s Rules list must contain at least one RuleGroupReferenceStatement.
You can remediate in two main ways:
  1. Update the WAFv2 Web ACL directly via wafv2.update_web_acl to add a rule group.
  2. Update the Firewall Manager policy that configures those Web ACLs so that the rule groups are automatically applied everywhere.
If these Web ACLs are created/owned by FMS, the proper long‑term fix is to update the FMS policy.

2. Prerequisites

  • Python 3.x installed.
  • boto3 installed:
  • AWS credentials configured (aws configure or environment variables).
  • The ARN of at least one Rule Group you want to associate:
    • Example (regional):
      • arn:aws:wafv2:us-east-1:111122223333:regional/rulegroup/my-rule-group/12345678-aaaa-bbbb-cccc-1234567890ab
    • Or AWS Managed Rule Group:
      • Use RuleGroupReferenceStatement with VendorName and Name for managed rule groups (e.g., AWS, AWSManagedRulesCommonRuleSet).

3. Option A – Update Web ACLs Directly via WAFv2

Use this if you already know the Web ACL ARN or have them from your scanner.

Step 3.1: Python script to add a Rule Group to a Web ACL

What it does:
  1. Finds the Web ACL by name and scope.
  2. Checks if any existing rule references a Rule Group or Managed Rule Group.
  3. If not, appends a new RuleGroupReferenceStatement rule.
  4. Calls update_web_acl with the new rules list and the current LockToken.

If the Web ACL is managed by Firewall Manager, you should adjust the FMS policy so all future and current Web ACLs have rule groups.

Step 4.1: Inspect FMS policies in Python

This shows you the JSON ManagedServiceData definition that FMS uses to create Web ACLs, including any rule groups.

Step 4.2: Update a policy to add rule groups

You will see something similar in ManagedServiceData:
To ensure rule groups are always associated, add entries to preProcessRuleGroups or postProcessRuleGroups:

Python example to update a specific FMS policy:


5. About “CloudWatch” in Your Question

CloudWatch is only indirectly involved (metrics, logs).
The actual remediation is done through:
  • wafv2 API (for Web ACL rules).
  • fms API (for Firewall Manager policies).
CloudWatch configuration (metrics/logs) is controlled via VisibilityConfig in WAF rules and Web ACLs, not where you attach rule groups.
If you tell me:
  • Whether the Web ACL is regional or for CloudFront, and
  • Whether you want to use AWS Managed Rule Groups or your own rule group ARNs,
I can adjust the Python snippet to exactly match your setup.
Changing remediation_enabled from false (or omitted) to true does not force replacement; the policy is updated in place but, as with put-policy, AWS treats this as a full-policy update so review all other arguments carefully.Verification: terraform plan should show remediation_enabled: false => true (or null => true) on aws_fms_policy.FMS_WEB_ACL_POLICY with no -/+ replacement of the resource.