Skip to content

How can I use Network Firewall managed rule groups in the LZA?

0

Hi all

I'm using the Landing Zone Accelerator (LZA) - https://aws.amazon.com/solutions/implementations/landing-zone-accelerator-on-aws/. I'd love to set up a Network Firewall and use managed rule groups shown in https://docs.aws.amazon.com/network-firewall/latest/developerguide/nwfw-using-managed-rule-groups-list.html. I looked at the sample codes in https://github.com/awslabs/landing-zone-accelerator-on-aws/tree/main/reference/sample-configurations, but I do not see how to enable managed rule groups. How can I enable them through LZA config files?

Thanks.

3 Answers
1
Accepted Answer

Unfortunately, we do support managed rule with LZA now.There is feature request existing for this. Thank you!

AWS

answered 2 years ago

EXPERT

reviewed 2 years ago

  • Thank you so much, @Lijan Kuniyil !!!

0

The managed rule groups I mentioned in step three are for AWS WAF you are correct.

The rest is applicable to the AWS Network Firewall.

Here is the link to the documentation for the cloudformation for a stateful rule

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-networkfirewall-rulegroup-statefulrule.html

Here is the same section in the API documentation

https://docs.aws.amazon.com/network-firewall/latest/APIReference/API_StatefulRule.html

If none of the above steps resolve the issue, it may be necessary to contact AWS Support for further assistance. They can provide specific guidance based on your account and configuration.

AWS

answered 2 years ago

-1

The Landing Zone Accelerator (LZA) sample configurations don't explicitly show how to enable managed rule groups for AWS Network Firewall. This link shows how to update the network-config.yaml to add a transit gateway. It is a similar process to add managed rule groups.

https://docs.aws.amazon.com/solutions/latest/landing-zone-accelerator-on-aws/performing-administrator-tasks.html

  1. First, ensure you have the Network Firewall configuration in your network-config.yaml file.

  2. To add managed rule groups, you need to modify the statefulRuleGroups section.

  3. You can add managed rule groups as needed. AWS provides several managed rule groups, including:

    • AWSManagedRulesATPRuleSet
    • AWSManagedRulesKnownBadInputsRuleSet
    • AWSManagedRulesSQLiRuleSet
    • AWSManagedRulesLinuxRuleSet
    • AWSManagedRulesWindowsRuleSet
  4. For each rule group, you can specify:

    • name: The name of the managed rule group
    • priority: The priority of the rule group (lower numbers are evaluated first)
    • overrideAction: What action to take (ALERT or DROP)
  5. After making these changes, commit and push your updated configuration files to your LZA configuration repository.

  6. The LZA pipeline will detect the changes and update your Network Firewall policy to include these managed rule groups.

Remember, using managed rule groups may incur additional costs, so be sure to review the AWS pricing for Network Firewall and managed rule groups.

Also, it's a good practice to test these configurations in a non-production environment first to ensure they don't interfere with your legitimate traffic.

If you need to customize the behaviour of these managed rules or create your own stateful rules, you can do so by adding custom rule groups in addition to or instead of the managed ones.

If none of the above steps resolve the issue, it may be necessary to contact AWS Support for further assistance. They can provide specific guidance based on your account and configuration.

AWS

answered 2 years ago

  • Hi @brisjam-2842907, seems like you're confused with WAF. What I'm asking is Network Firewall. Any way I added the following in the network-config.yaml as follows:

    policies:
      - name: nfw-policy
        regions:
          - *HOME_REGION
        firewallPolicy:
          statelessDefaultActions: ["aws:forward_to_sfe"]
          statelessFragmentDefaultActions: ["aws:forward_to_sfe"]
          statefulRuleGroups:
            - name: MalwareDomainsActionOrder
        shareTargets:
          organizationalUnits:
            - Infrastructure
    rules:
      - name: MalwareDomainsActionOrder
        regions:
          - *HOME_REGION
        capacity: 100
        type: STATEFUL
    

    but encountered the following error:

    Resource handler returned message: "Exactly one of Rules or RuleGroup must be set (Service: NetworkFirewall, Status Code: 400,

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.