This repository has been archived by the owner on Nov 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
demo-stack.yaml
74 lines (72 loc) · 2.09 KB
/
demo-stack.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
AWSTemplateFormatVersion: '2010-09-09'
Description: Demo stack for the rate-based rule provider
Resources:
NormalRule:
Type: AWS::WAF::Rule
Properties:
Name: demonormalrule
MetricName: demonormalrulemetric
Predicates:
- Negated: False
Type: SqlInjectionMatch
DataId: !ImportValue SqlInjectionMatchSetTestPredicate
RateBasedRule:
Type: Custom::RateBasedRule
Properties:
Name: ratebasedrule
MetricName: ratebasedrulemetric
RateKey: IP
RateLimit: 4500
ServiceToken: !Sub 'arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:binxio-cfn-waf-provider'
RateBasedRuleWithPredicate1:
DependsOn: RateBasedRule
Type: Custom::RateBasedRule
Properties:
Name: ratebasedrulepredicate1
MetricName: ratebasedrulepredicate1metric
RateKey: IP
RateLimit: 3245
MatchPredicates:
-
Negated: False
Type: XssMatch
DataId: !ImportValue XssMatchSetTrestPredicate
ServiceToken: !Sub 'arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:binxio-cfn-waf-provider'
RateBasedRuleWithPredicate2:
DependsOn: RateBasedRuleWithPredicate1
Type: Custom::RateBasedRule
Properties:
Name: ratebasedrulepredicate2
MetricName: ratebasedrulepredicate2metric
RateKey: IP
RateLimit: 2800
MatchPredicates:
-
Negated: False
Type: SqlInjectionMatch
DataId: !ImportValue SqlInjectionMatchSetTestPredicate
-
Negated: True
Type: ByteMatch
DataId: !ImportValue ByteMatchSetTestPredicate
ServiceToken: !Sub 'arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:binxio-cfn-waf-provider'
WebACL:
DependsOn:
- RateBasedRuleWithPredicate1
Type: AWS::WAF::WebACL
Properties:
DefaultAction:
Type: ALLOW
MetricName: demowebaclmetric
Name: demowebacl
Rules:
- Action:
Type: BLOCK
Priority: 1
RuleId: !Ref NormalRule
Outputs:
RateBasedRuleRef:
Value: !Ref RateBasedRule
NormalRuleRef:
Value: !Ref NormalRule