Lesson 2 of 5 Secure Deployment and Resource Sharing

Enforcing Firewall Policies Across Accounts with AWS Firewall Manager

This lesson explains how AWS Firewall Manager applies and enforces security policies centrally across every account in an organisation, including accounts and resources created later.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify the prerequisites for Firewall Manager.
  • Distinguish the Firewall Manager policy types.
  • Describe policy scope and automatic remediation.

Prerequisites

AWS Firewall Manager applies firewall policies, for AWS WAF, Shield Advanced, security groups, Network Firewall, Route 53 Resolver DNS Firewall and third-party firewalls, across all accounts in an organisation from one place. Because it works across the organisation and relies on configuration tracking to find resources, it has prerequisites that must be in place before any policy can be applied. The following prerequisites must be in place.

  1. AWS Organizations with all features.
  2. A delegated Firewall Manager administrator account.
  3. AWS Config enabled in member accounts and Regions in scope.
Select all that apply

Firewall Manager prerequisites

Exam skills 6.2.3

Pick the prerequisites that must exist before Firewall Manager policies can apply.

Log in to try this activity Interactive activities are free with an account.

Policy types

Firewall Manager applies security policies across every account in an organisation, including new accounts and resources as they appear. AWS WAF policies deploy web ACLs and rule groups to ALBs, API Gateway stages, CloudFront distributions and other supported resources. Shield Advanced policies apply DDoS protection to chosen resource types.

Security group policies work in three ways. Common policies apply standard groups to resources, content audit policies find and fix overly permissive rules, and usage audit policies remove unused or redundant groups. Network Firewall policies deploy firewalls to VPCs, and DNS Firewall policies associate Resolver DNS Firewall rule groups. Policies also exist for network ACLs and for third-party firewalls from AWS Marketplace. The following table summarises the policy types.

PolicyManages
AWS WAFWeb ACLs and rule groups on ALBs, API Gateway, CloudFront and more
Shield AdvancedDDoS protections
Security groupCommon groups applied to resources; content audits fix overly permissive rules; usage audits remove unused or redundant groups
Network FirewallFirewall deployments
DNS FirewallResolver DNS Firewall rule groups
Network ACL, third-partyNACL policies; Marketplace firewalls

The following diagram follows a Firewall Manager security group audit policy from audit mode to remediation.

A Firewall Manager security group content audit policy across 150 accounts. The referenced audit group lists the rules to deny, SSH and RDP from 0.0.0.0/0; starting with remediation off produces a compliance report, and turning it on removes offending rules in every in-scope account, including new ones. Tags exclude approved exceptions.
FMS stands for Firewall Manager.
Sort into groups

Which security group policy?

Exam skills 6.2.3 · 3.3.5

Choose the Firewall Manager security group policy for each need.

Log in to try this activity Interactive activities are free with an account.

Scope and enforcement

A Firewall Manager policy defines both the protection and the resources it applies to. Once the policy is created, Firewall Manager keeps checking for resources within its scope, so new accounts, new load balancers or new security groups are protected without anyone remembering to configure them. It also reports resources that are not compliant and can fix them. The following list describes scope and enforcement.

  • Scope by account, OU, Region, resource type and resource tags (include or exclude).
  • New in-scope resources and accounts are protected automatically.
  • Per-resource compliance with automatic remediation, e.g. associating the web ACL or removing a permissive rule.
True or false

Firewall Manager scope

Exam skills 6.2.3

Check how Firewall Manager scopes and enforces policies.

Log in to try this activity Interactive activities are free with an account.
Worked example

Removing open SSH everywhere, automatically

Across 150 accounts, some security groups allow SSH from 0.0.0.0/0. A Firewall Manager security group content audit policy finds them and, with automatic remediation, removes the offending rules in every in-scope account, including accounts added later:

aws fms put-policy --policy '{
  "PolicyName": "no-open-admin-ports",
  "SecurityServicePolicyData": {
    "Type": "SECURITY_GROUPS_CONTENT_AUDIT",
    "ManagedServiceData": "{\"type\":\"SECURITY_GROUPS_CONTENT_AUDIT\",\"securityGroupAction\":{\"type\":\"DENY\"},\"securityGroups\":[{\"id\":\"sg-0auditref\"}]}"
  },
  "ResourceType": "AWS::EC2::SecurityGroup",
  "ExcludeResourceTags": false,
  "RemediationEnabled": true,
  "IncludeMap": { "ORGUNIT": ["ou-ab12-34cd5678"] }
}'

The referenced audit security group contains the rules to deny (SSH and RDP from 0.0.0.0/0). Starting with RemediationEnabled: false shows the compliance report without changing anything, which lets owners of legitimate exceptions respond before enforcement. Excluding resources by tag handles approved exceptions.

Check yourself

Which Firewall Manager policy finds overly permissive security groups?

Show answer

A security group content audit policy.

Exam Tips

Remember for the exam

  • To apply the same WAF rules to every ALB and CloudFront distribution, including future ones, use Firewall Manager.
  • To find and fix overly permissive security groups across the organisation, use a security group content audit policy.
  • To deploy DNS Firewall rules to every VPC, use a Firewall Manager DNS Firewall policy.
  • Firewall Manager needs Organizations, an administrator account and AWS Config.
  • To apply Shield Advanced across accounts, use Firewall Manager.