Skip to content
Snippets Groups Projects
Commit bcdf3ae1 authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

refs meta#147 slipp api-kall gjennom brannmuren

parent b58a59a4
No related branches found
No related tags found
No related merge requests found
...@@ -83,6 +83,16 @@ Resources: ...@@ -83,6 +83,16 @@ Resources:
Value: "82.134.66.114/32" Value: "82.134.66.114/32"
Name: "allowed IPs" Name: "allowed IPs"
APImatch:
Type: "AWS::WAF::ByteMatchSet"
Properties:
ByteMatchTuples:
- FieldToMatch:
Type: "URI"
TargetString: "/api/"
TextTransformation: "NONE"
PositionalConstraint: "STARTS_WITH"
ITARule: ITARule:
Type: "AWS::WAF::Rule" Type: "AWS::WAF::Rule"
Properties: Properties:
...@@ -93,6 +103,16 @@ Resources: ...@@ -93,6 +103,16 @@ Resources:
Negated: false Negated: false
DataId: !Ref ITAIpSet DataId: !Ref ITAIpSet
APIRule:
Type: "AWS::WAF::Rule"
Properties:
MetricName: "APIRule"
Name: "APIRule"
Predicates:
- Type: "ByteMatch"
Negated: false
DataId: !Ref APImatch
ACL: ACL:
Type: "AWS::WAF::WebACL" Type: "AWS::WAF::WebACL"
Properties: Properties:
...@@ -105,6 +125,10 @@ Resources: ...@@ -105,6 +125,10 @@ Resources:
Type: "ALLOW" Type: "ALLOW"
Priority: 1 Priority: 1
RuleId: !Ref ITARule RuleId: !Ref ITARule
- Action:
Type: "ALLOW"
Priority: 5
RuleId: !Ref APIRule
Distribution: Distribution:
Type: "AWS::CloudFront::Distribution" Type: "AWS::CloudFront::Distribution"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment