File tree Expand file tree Collapse file tree 5 files changed +86
-2
lines changed
assets/queries/cloudFormation/aws/alb_is_not_integrated_with_waf Expand file tree Collapse file tree 5 files changed +86
-2
lines changed Original file line number Diff line number Diff line change @@ -26,14 +26,28 @@ internal_alb(resource) {
2626 scheme == " internal"
2727}
2828
29+ waf_association_types := {" AWS::WAFRegional::WebACLAssociation" , " AWS::WAFv2::WebACLAssociation" }
30+
2931associated_waf (target_alb) {
3032 resource := input .document[_].Resources[_]
31- resource.Type == " AWS::WAFRegional::WebACLAssociation "
33+ waf_association_types[ resource.Type]
3234 resource.Properties.ResourceArn.Ref == target_alb
3335}
3436
3537associated_waf (target_alb) {
3638 resource := input .document[_].Resources[_]
37- resource.Type == " AWS::WAFRegional::WebACLAssociation "
39+ waf_association_types[ resource.Type]
3840 resource.Properties.ResourceArn == target_alb
3941}
42+
43+ associated_waf (target_alb) {
44+ resource := input .document[_].Resources[_]
45+ waf_association_types[resource.Type]
46+ resource.Properties.ResourceArn[" Fn::GetAtt" ][0 ] == target_alb
47+ }
48+
49+ associated_waf (target_alb) {
50+ resource := input .document[_].Resources[_]
51+ waf_association_types[resource.Type]
52+ startswith (resource.Properties.ResourceArn, sprintf (" %s." , [target_alb]))
53+ }
Original file line number Diff line number Diff line change 1+ AWSTemplateFormatVersion : 2010-09-09
2+ Resources :
3+ MyLoadBalancerV2 :
4+ Type : AWS::ElasticLoadBalancingV2::LoadBalancer
5+ Properties :
6+ Name : myloadbalancerv2
7+ Scheme : internet-facing
8+ MyWebACLAssociation :
9+ Type : " AWS::WAFv2::WebACLAssociation"
10+ Properties :
11+ ResourceArn : !GetAtt MyLoadBalancerV2.LoadBalancerArn
12+ WebACLArn : !Ref MyWebACL
Original file line number Diff line number Diff line change 1+ {
2+ "AWSTemplateFormatVersion" : " 2010-09-09T00:00:00Z" ,
3+ "Resources" : {
4+ "MyLoadBalancerV2" : {
5+ "Type" : " AWS::ElasticLoadBalancingV2::LoadBalancer" ,
6+ "Properties" : {
7+ "Name" : " myloadbalancerv2" ,
8+ "Scheme" : " internet-facing"
9+ }
10+ },
11+ "MyWebACLAssociation" : {
12+ "Type" : " AWS::WAFv2::WebACLAssociation" ,
13+ "Properties" : {
14+ "ResourceArn" : {
15+ "Ref" : " MyLoadBalancerV2"
16+ },
17+ "WebACLArn" : {
18+ "Ref" : " MyWebACL"
19+ }
20+ }
21+ }
22+ }
23+ }
Original file line number Diff line number Diff line change 1+ AWSTemplateFormatVersion : 2010-09-09
2+ Resources :
3+ MyLoadBalancerV2b :
4+ Type : AWS::ElasticLoadBalancingV2::LoadBalancer
5+ Properties :
6+ Name : myloadbalancerv2b
7+ Scheme : internet-facing
8+ MyWebACLAssociation :
9+ Type : " AWS::WAFv2::WebACLAssociation"
10+ Properties :
11+ ResourceArn : !Ref MyLoadBalancerV2b
12+ WebACLArn : !Ref MyWebACL
Original file line number Diff line number Diff line change 1+ {
2+ "AWSTemplateFormatVersion" : " 2010-09-09T00:00:00Z" ,
3+ "Resources" : {
4+ "MyLoadBalancerV2c" : {
5+ "Type" : " AWS::ElasticLoadBalancingV2::LoadBalancer" ,
6+ "Properties" : {
7+ "Name" : " myloadbalancerv2c" ,
8+ "Scheme" : " internet-facing"
9+ }
10+ },
11+ "MyWebACLAssociation" : {
12+ "Type" : " AWS::WAFv2::WebACLAssociation" ,
13+ "Properties" : {
14+ "ResourceArn" : {
15+ "Fn::GetAtt" : [" MyLoadBalancerV2c" , " LoadBalancerArn" ]
16+ },
17+ "WebACLArn" : {
18+ "Ref" : " MyWebACL"
19+ }
20+ }
21+ }
22+ }
23+ }
You can’t perform that action at this time.
0 commit comments