|
1 | | -id: aws_ec2_classic_lb_connection_draining_enabled_rego |
2 | | -title: Classic Load Balancers should have connection draining enabled |
3 | | -description: This control checks whether Classic Load Balancers have connection draining enabled. |
4 | | -integration_type: |
| 1 | +Description: This control checks whether Classic Load Balancers have connection draining enabled. |
| 2 | +ID: aws_ec2_classic_lb_connection_draining_enabled_rego |
| 3 | +IntegrationType: |
5 | 4 | - aws_cloud_account |
6 | | -parameters: [] |
7 | | -policy: |
8 | | - language: sql |
9 | | - primary_resource: aws_ec2_classic_load_balancer |
10 | | - definition: | |
11 | | - data.aws_ec2_classic_lb_connection_draining_enabled_rego.result |
12 | | -severity: medium |
13 | | -tags: |
14 | | - aws_foundational_security: |
15 | | - - 'true' |
16 | | - category: |
17 | | - - Compliance |
18 | | - foundational_security_category: |
19 | | - - resilience |
20 | | - foundational_security_item_id: |
21 | | - - elb_7 |
22 | | - plugin: |
23 | | - - aws |
24 | | - service: |
25 | | - - AWS/ELB |
| 5 | +Query: |
| 6 | + Engine: cloudql-rego |
| 7 | + ListOfTables: |
| 8 | + - aws_ec2_classic_load_balancer |
| 9 | + Parameters: [] |
| 10 | + PrimaryTable: aws_ec2_classic_load_balancer |
| 11 | + RegoPolicies: |
| 12 | + - | |
| 13 | + package aws_ec2_classic_lb_connection_draining_enabled_rego |
| 14 | + import future.keywords.in |
| 15 | + |
| 16 | + status(lb) = "ok" { |
| 17 | + lb.connection_draining_enabled == true |
| 18 | + } |
| 19 | + status(lb) = "alarm" { |
| 20 | + lb.connection_draining_enabled == false |
| 21 | + } |
| 22 | + |
| 23 | + reason(lb) = sprintf("%s connection draining enabled.", [lb.title]) { |
| 24 | + lb.connection_draining_enabled == true |
| 25 | + } |
| 26 | + reason(lb) = sprintf("%s connection draining disabled.", [lb.title]) { |
| 27 | + lb.connection_draining_enabled == false |
| 28 | + } |
| 29 | + |
| 30 | + result[obj] { |
| 31 | + some lb in opencomply.aws_ec2_classic_load_balancer({}) |
| 32 | + |
| 33 | + obj = { |
| 34 | + "resource": lb.arn, |
| 35 | + "platform_integration_id": lb.platform_integration_id, |
| 36 | + "platform_resource_id": lb.platform_resource_id, |
| 37 | + "status": status(lb), |
| 38 | + "reason": reason(lb), |
| 39 | + "region": lb.region, |
| 40 | + "account_id": lb.account_id, |
| 41 | + } |
| 42 | + } |
| 43 | + QueryToExecute: | |
| 44 | + data.aws_ec2_classic_lb_connection_draining_enabled_rego.result |
| 45 | +Severity: medium |
| 46 | +Tags: |
| 47 | + aws_foundational_security: |
| 48 | + - "true" |
| 49 | + category: |
| 50 | + - Compliance |
| 51 | + foundational_security_category: |
| 52 | + - resilience |
| 53 | + foundational_security_item_id: |
| 54 | + - elb_7 |
| 55 | + plugin: |
| 56 | + - aws |
| 57 | + service: |
| 58 | + - AWS/ELB |
| 59 | +Title: Classic Load Balancers should have connection draining enabled |
0 commit comments