Subchapter 93.4
references/enabling-automatic-application-layer-mitigation.mdMarkdown13 KBView on GitHub
Domain expertise for turning on AWS Shield Advanced automatic application layer (layer 7) DDoS
mitigation, which lets Shield Advanced create, test, and deploy AWS WAF rules during an attack
instead of an engineer hand-writing rules under pressure. Covers the AWS WAF (v2) web ACL
precondition, the Block versus Count decision, the baseline period that customers do not expect,
the load-bearing ShieldMitigationRuleGroup rule group, and the web ACL capacity it consumes.
Does not cover subscribing and protecting resources, health-based detection, SRT setup, event review, or protection groups; those are separate references. Authoring the AWS WAF web ACL or its rules is the waf skill.
Execute commands using the AWS MCP server when connected (sandboxed execution, audit logging,
observability). Fall back to the AWS CLI otherwise. Shield Advanced control-plane calls run in
us-east-1; pass --region us-east-1 on every command.
To enable automatic application layer mitigation end to end, follow the procedure exactly. See the Procedure section below.
The procedure covers:
Automatic mitigation works by managing rules inside an AWS WAF (v2) web ACL on the resource. Without a v2 web ACL, or with an older AWS WAF Classic web ACL, enabling does nothing useful.
Constraints:
| Mode | Behavior | Use when |
|---|---|---|
| Count | Shield’s rules observe and label suspect requests but do not block them | During the baseline period and for initial testing, so legitimate traffic is not blocked |
| Block | Shield’s rules drop suspect requests | After the baseline is established and false-positive risk is understood |
Constraints:
When advising on automatic application layer mitigation — especially when asked why no tailored custom rules appeared, or before any cleanup — you MUST state ALL of the following points together, not a subset:
ShieldMitigationRuleGroup from the web ACL: doing so silently disables
automatic mitigation for every resource that shares that web ACL, with no obvious signal.The sections below give the detail behind each point.
Customers enable automatic mitigation and expect tailored custom rules during the very next attack. Shield Advanced needs a baseline period of roughly 24 to 30 days of traffic before it can tailor rules to the application and test them against historical traffic.
Constraints:
When enabled, Shield Advanced adds a managed rule group whose name starts with
ShieldMitigationRuleGroup to the web ACL. Removing it during cleanup silently disables automatic
mitigation for every resource that shares that web ACL.
Constraints:
ShieldMitigationRuleGroup rule group from the web ACL; its
removal turns off automatic mitigation for all resources using that web ACL, with no obvious
signalShieldMitigationRuleGroup automatically;
the customer does not set its priority, and their own rules continue to evaluate in their existing
order. Point at the waf skill for authoring or ordering the customer’s own rulesThe Shield rule group consumes a fixed amount of the web ACL’s capacity, which competes with the customer’s own rules.
Constraints:
The resource has no AWS WAF (v2) web ACL associated, or it is an AWS WAF Classic web ACL. Associate a v2 web ACL first (Precondition).
The baseline is not established yet. Custom rules need roughly 24 to 30 days of traffic; run in Count mode meanwhile (Baseline period before custom rules).
The ShieldMitigationRuleGroup rule group was removed. Re-enable the automatic response to restore
it (The ShieldMitigationRuleGroup is load-bearing).
The response is in Block mode and a rule is over-matching. Switch to Count with the update call and review before returning to Block (Decision: Block vs Count).
Automatic mitigation manages AWS WAF rules inside the resource’s web ACL, so call out the risks and the controls that contain them.
ShieldMitigationRuleGroup to the web ACL; removing it
during cleanup silently disables automatic mitigation for every resource that shares that web ACL,
with no obvious signal.shield:ListProtections, shield:EnableApplicationLayerAutomaticResponse,
shield:UpdateApplicationLayerAutomaticResponse) rather than broad Shield or administrator access.shield:* calls so every automatic
response configuration change leaves a record, and confirm the CloudTrail trail uses SSE-KMS
encryption on its S3 log bucket and CloudWatch Logs log group, since CloudTrail records contain
sensitive API metadata (caller identities, resource ARNs, parameters).This procedure enables automatic application layer mitigation on a protected resource that already has an AWS WAF (v2) web ACL, in the chosen mode, then surfaces the console link to verify.
Count (observe) or Block (mitigate). Default to Count during the
baseline.Constraints for parameter acquisition:
Constraints:
aws sts get-caller-identityshield:ListProtections, shield:EnableApplicationLayerAutomaticResponse,
shield:UpdateApplicationLayerAutomaticResponse) rather than broad Shield or administrator accessshield:* calls so every Shield Advanced
configuration change leaves an audit trailaws shield list-protections --region us-east-1Constraints:
You MUST enable the automatic response with the chosen action:
aws shield enable-application-layer-automatic-response \
--resource-arn {resource_arn} --action '{"{action}":{}}' --region us-east-1You SHOULD use Count during the baseline period and switch to Block later:
aws shield update-application-layer-automatic-response \
--resource-arn {resource_arn} --action '{"Block":{}}' --region us-east-1Constraints:
ShieldMitigationRuleGroup rule group is present in the resource’s web ACLConstraints:
You MUST present the Shield protected-resources console link and tell the customer to open the resource and confirm the automatic application layer DDoS mitigation status and mode:
https://us-east-1.console.aws.amazon.com/wafv2/shieldv2#/protections{
"resource_arn": "arn:aws:elasticloadbalancing:us-east-1:111122223333:loadbalancer/app/my-app-alb/abc",
"action": "Count"
}Enabled automatic application layer mitigation in Count mode on my-app-alb.
Shield added the ShieldMitigationRuleGroup rule group to the web ACL — do not remove it.
Custom tailored rules become available after the ~24-30 day baseline; switch to Block once traffic is validated.
Open the Shield console and confirm the automatic mitigation status:
https://us-east-1.console.aws.amazon.com/wafv2/shieldv2#/protectionsAssociate an AWS WAF (v2) web ACL with the resource first (Step 1).
The baseline is not established. Run in Count mode and wait roughly 24 to 30 days (Step 2).
The ShieldMitigationRuleGroup was removed. Re-enable the automatic response (Step 2).
Nearby