Skip to content

Instantly share code, notes, and snippets.

@iDVB
Created March 1, 2018 04:33
Show Gist options
  • Save iDVB/5d7ec47b18953699b684a373026ff02d to your computer and use it in GitHub Desktop.
Save iDVB/5d7ec47b18953699b684a373026ff02d to your computer and use it in GitHub Desktop.
WAF Rules
Resources:
WebACL:
Type: "AWS::WAF::WebACL"
Properties:
DefaultAction:
Type: BLOCK
MetricName: "TrustedIPs"
Name: "TrustedIPs"
Rules:
- Action:
Type: ALLOW
Priority: 1
RuleId: {Ref: WAFRule}
WAFRule:
Type: "AWS::WAF::Rule"
Properties:
Name: "MyIPSetRule"
MetricName: "MyIPSetRule"
Predicates:
- DataId: {Ref: WAFIpSet}
Negated: false
Type: "IPMatch"
WAFIpSet:
Type: "AWS::WAF::IPSet"
Properties:
IPSetDescriptors:
- Type: "IPV4"
Value: "192.168.1.1/32" # Your whitelist IP Here
Name: IPSet for whitelisted IP adresses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment