/
aws_elbv2_load_balancer_has_ssl_policy.yml
165 lines (165 loc) · 6.01 KB
/
aws_elbv2_load_balancer_has_ssl_policy.yml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
AnalysisType: policy
Filename: aws_elbv2_load_balancer_has_ssl_policy.py
PolicyID: "AWS.ELBV2.LoadBalancer.HasSSLPolicy"
DisplayName: "AWS Enforces SSL Policies"
Enabled: true
ResourceTypes:
- AWS.ELBV2.ApplicationLoadBalancer
Tags:
- AWS
- PCI
- Initial Access:Exploit Public-Facing Application
Reports:
PCI:
- 2.2.3
- 4.1
MITRE ATT&CK:
- TA0001:T1190
Severity: High
Description: This policy validates that ELBV2 load balancer listeners are using an SSL policy.
Runbook: Apply an SSL policy to the listener to force HTTPS.
Reference: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/listener-update-certificates.html#update-security-policy
Tests:
- Name: LB Using SSL Policy
ExpectedResult: true
Resource:
{
"AccountId": "123456789012",
"Arn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/example-lb/1",
"AvailabilityZones":
[
{
"LoadBalancerAddresses": null,
"SubnetId": "subnet-1",
"ZoneName": "us-west-2d",
},
{
"LoadBalancerAddresses": null,
"SubnetId": "subnet-1",
"ZoneName": "us-west-2a",
},
],
"CanonicalHostedZonedId": "AAAA",
"DNSName": "internal-example-lb-1111.us-west-2.elb.amazonaws.com",
"IpAddressType": "ipv4",
"Listeners":
[
{
"Certificates":
[
{
"CertificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/example-cert",
"IsDefault": null,
},
],
"DefaultActions":
[
{
"AuthenticateCognitoConfig": null,
"AuthenticateOidcConfig": null,
"FixedResponseConfig": null,
"Order": null,
"RedirectConfig": null,
"TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/test-lb-target-group/1",
"Type": "forward",
},
],
"ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/example-lb/1/1",
"LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/example-lb/1",
"Port": 443,
"Protocol": "HTTPS",
"SslPolicy": "ELBSecurityPolicy-2016-08",
},
],
"Name": "example-lb",
"Region": "us-west-2",
"ResourceId": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/example-lb/1",
"ResourceType": "AWS.ELBV2.ApplicationLoadBalancer",
"SSLPolicies":
{
"ELBSecurityPolicy-2016-08":
{
"Ciphers":
[
{ "Name": "ECDHE-ECDSA-AES128-GCM-SHA256", "Priority": 1 },
{ "Name": "ECDHE-RSA-AES128-GCM-SHA256", "Priority": 2 },
{ "Name": "AES256-SHA", "Priority": 3 },
],
"Name": "ELBSecurityPolicy-2016-08",
"SslProtocols": ["TLSv1", "TLSv1.1", "TLSv1.2"],
},
},
"Scheme": "internal",
"SecurityGroups": ["sg-1"],
"State": { "Code": "active", "Reason": null },
"Tags": { "environment": "pci" },
"TimeCreated": "2019-01-01T00:00:00.000Z",
"Type": "application",
"VpcId": "vpc-1",
"WebAcl": "1111-2222-3333",
}
- Name: LB Not Using SSL Policy
ExpectedResult: False
Resource:
{
"AccountId": "123456789012",
"Arn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/example-lb/1",
"AvailabilityZones":
[
{
"LoadBalancerAddresses": null,
"SubnetId": "subnet-1",
"ZoneName": "us-west-2d",
},
{
"LoadBalancerAddresses": null,
"SubnetId": "subnet-1",
"ZoneName": "us-west-2a",
},
],
"CanonicalHostedZonedId": "AAAA",
"DNSName": "internal-example-lb-1111.us-west-2.elb.amazonaws.com",
"IpAddressType": "ipv4",
"Listeners":
[
{
"Certificates":
[
{
"CertificateArn": "arn:aws:acm:us-west-2:123456789012:certificate/example-cert",
"IsDefault": null,
},
],
"DefaultActions":
[
{
"AuthenticateCognitoConfig": null,
"AuthenticateOidcConfig": null,
"FixedResponseConfig": null,
"Order": null,
"RedirectConfig": null,
"TargetGroupArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:targetgroup/test-lb-target-group/1",
"Type": "forward",
},
],
"ListenerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:listener/app/example-lb/1/1",
"LoadBalancerArn": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/example-lb/1",
"Port": 443,
"Protocol": "HTTPS",
"SslPolicy": "ELBSecurityPolicy-2016-08",
},
],
"Name": "example-lb",
"Region": "us-west-2",
"ResourceId": "arn:aws:elasticloadbalancing:us-west-2:123456789012:loadbalancer/app/example-lb/1",
"ResourceType": "AWS.ELBV2.ApplicationLoadBalancer",
"SSLPolicies": null,
"Scheme": "internal",
"SecurityGroups": ["sg-1"],
"State": { "Code": "active", "Reason": null },
"Tags": { "environment": "pci" },
"TimeCreated": "2019-01-01T00:00:00.000Z",
"Type": "application",
"VpcId": "vpc-1",
"WebAcl": "1111-2222-3333",
}