I want to Create and Attach a WAF to my loadbalancer.
what are the resources and parameters i need to attach to create a WAF, is there any example, You can suggest me?
I tried this way but each rule set is failed using cloudformation template.
MyWebACL = t.add_resource(
WebACL(
"MyWebACL",
Name=Ref(WebACLName),
DefaultAction=Action(
Type="ALLOW"
),
Rules=[
Rules(
Action=Action(
Type="BLOCK"
),
Priority=1,
RuleId=Ref(ManualIPBlockRule)
),
Rules(
Action=Action(
Type="COUNT"
),
Priority=2,
RuleId=Ref(SizeMatchRule)
),
Rules(
Action=Action(
Type="BLOCK"
),
Priority=3,
RuleId=Ref(SqliRule)
),
Rules(
Action=Action(
Type="BLOCK"
),
Priority=4,
RuleId=Ref(XssRule)
)
],
MetricName=(),
))
Here are my one example rule:
SizeMatchRule = t.add_resource(
Rule(
"SizeMatchRule",
Name=Join("", [Ref(WebACLName), "LargeBodyMatchRule"]),
MetricName=Join("", [Ref(WebACLName), "DetectLargeBody"]),
Predicates=[
Predicates(
DataId=Ref(SizeMatchSet),
Type="SizeConstraint",
Negated=False
)
]
))
Any suggestion and reference let me know?