Skip to content

Commit bf9fd09

Browse files
committed
fix: remove pennywise
1 parent 3d66a51 commit bf9fd09

13 files changed

+0
-133
lines changed

compliance/controls/baseline/aws/dynamoDb/aws_unused_dynamodb_table.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@ Query:
1313
name AS resource,
1414
og_resource_id,
1515
og_account_id,
16-
CASE
17-
WHEN item_count::int = 0 THEN (
18-
SELECT cost
19-
FROM pennywise_cost_estimate
20-
WHERE resource_type = 'aws::dynamodb::table'
21-
AND resource_id = t.og_resource_id
22-
LIMIT 1
23-
)
24-
ELSE 0
25-
END AS cost_optimization,
2616
CASE
2717
WHEN item_count::int = 0 THEN 'alarm'
2818
ELSE 'ok'

compliance/controls/baseline/aws/ebs/aws_ebs_volume_unused.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ Query:
1313
arn AS resource,
1414
og_account_id AS og_account_id,
1515
og_resource_id AS og_resource_id,
16-
CASE
17-
WHEN state = 'in-use' THEN 0
18-
ELSE (SELECT cost
19-
FROM pennywise_cost_estimate
20-
WHERE resource_type = 'aws::ec2::volume'
21-
AND resource_id = v.og_resource_id
22-
LIMIT 1)
23-
END AS cost_optimization,
2416
CASE
2517
WHEN state = 'in-use' THEN 'ok'
2618
ELSE 'alarm'

compliance/controls/baseline/aws/ebs/aws_ebs_volumes_attached_to_stopped_ec2_instances.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,6 @@ Query:
1414
v.volume_id AS resource,
1515
v.og_resource_id,
1616
v.og_account_id,
17-
CASE
18-
WHEN i.instance_state = 'running' THEN 0
19-
ELSE (
20-
SELECT cost
21-
FROM pennywise_cost_estimate
22-
WHERE resource_type = 'aws::ec2::volume'
23-
AND resource_id = v.og_resource_id
24-
LIMIT 1
25-
)
26-
END AS cost_optimization,
2717
CASE
2818
WHEN i.instance_state = 'running' THEN 'ok'
2919
ELSE 'alarm'

compliance/controls/baseline/aws/ebs/aws_ebs_volumes_too_old_snapshots.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ Query:
1515
snapshot_id AS resource,
1616
og_resource_id,
1717
og_account_id,
18-
CASE
19-
WHEN start_time + ({{.awsEbsSnapshotAgeMaxDays}}::INT || ' days')::interval < now()
20-
THEN (
21-
SELECT cost
22-
FROM pennywise_cost_estimate
23-
WHERE resource_type = 'aws::ec2::volumesnapshot' AND resource_id = es.og_resource_id
24-
LIMIT 1
25-
)
26-
ELSE 0
27-
END AS cost_optimization,
2818
CASE
2919
WHEN start_time + ({{.awsEbsSnapshotAgeMaxDays}}::INT || ' days')::interval < now()
3020
THEN 'alarm'

compliance/controls/baseline/aws/ec2/aws_ec2_ami_too_old.yaml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,6 @@ Query:
2929
WHEN NOW() - (creation_date)::timestamp > '{{.awsEbsAmiAgeMaxDays}} days'::interval THEN name || ' needs to be restarted'
3030
ELSE name || ' launch time was not much time ago'
3131
END AS reason,
32-
CASE
33-
WHEN is_aws_backup_managed THEN 0
34-
WHEN root_device_type <> 'ebs' THEN 0
35-
WHEN NOW() - (creation_date)::timestamp > '{{.awsEbsAmiAgeMaxDays}} days'::interval THEN
36-
(SELECT SUM(
37-
(SELECT cost
38-
FROM pennywise_cost_estimate AS es
39-
WHERE es.resource_type = 'aws::ec2::volumesnapshot'
40-
AND es.resource_id = s.arn
41-
LIMIT 1)
42-
)
43-
FROM jsonb_array_elements(block_device_mappings) AS bdm
44-
LEFT JOIN aws_ebs_snapshot AS s
45-
ON s.snapshot_id = bdm -> 'Ebs' ->> 'SnapshotId')
46-
ELSE 0
47-
END AS cost_optimization,
4832
region,
4933
account_id
5034
FROM

compliance/controls/baseline/aws/ec2/aws_unused_ami.yaml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,6 @@ Query:
3939
WHEN i.arn IS NULL THEN ami.name || ' is unused.'
4040
ELSE ami.name || ' is used.'
4141
END AS reason,
42-
CASE
43-
WHEN is_aws_backup_managed THEN 0
44-
WHEN ami.root_device_type <> 'ebs' THEN 0
45-
WHEN i.arn IS NULL THEN (
46-
SELECT
47-
SUM((
48-
SELECT cost
49-
FROM pennywise_cost_estimate AS es
50-
WHERE es.resource_type = 'aws::ec2::volumesnapshot'
51-
AND es.resource_id = s.arn
52-
LIMIT 1
53-
))
54-
FROM
55-
jsonb_array_elements(ami.block_device_mappings) AS bdm
56-
LEFT JOIN
57-
aws_ebs_snapshot AS s ON s.snapshot_id = bdm -> 'Ebs' ->> 'SnapshotId'
58-
)
59-
ELSE 0
60-
END AS cost_optimization,
6142
ami.region,
6243
ami.account_id
6344
FROM

compliance/controls/baseline/aws/load_balancer/aws_unused_application_load_balancers.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ Query:
3131
WHEN b.load_balancer_arn IS NULL THEN a.title || ' has no target registered.'
3232
ELSE a.title || ' has registered target of type ' || b.target_type || '.'
3333
END AS reason,
34-
CASE
35-
WHEN b.load_balancer_arn IS NULL THEN (
36-
SELECT cost
37-
FROM pennywise_cost_estimate
38-
WHERE resource_type = 'aws::elasticloadbalancingv2::loadbalancer'
39-
AND resource_id = a.og_resource_id
40-
LIMIT 1
41-
)
42-
ELSE 0
43-
END AS cost_optimization,
4434
a.region,
4535
a.account_id
4636
FROM

compliance/controls/baseline/aws/load_balancer/aws_unused_elastic_load_balancers.yaml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@ Query:
1313
arn AS resource,
1414
og_account_id,
1515
og_resource_id,
16-
CASE
17-
WHEN jsonb_array_length(instances) > 0 THEN 0
18-
ELSE (
19-
SELECT cost
20-
FROM pennywise_cost_estimate
21-
WHERE resource_type = 'aws::elasticloadbalancing::loadbalancer'
22-
AND resource_id = lb.og_resource_id
23-
LIMIT 1
24-
)
25-
END AS cost_optimization,
2616
CASE
2717
WHEN jsonb_array_length(instances) > 0 THEN 'ok'
2818
ELSE 'alarm'

compliance/controls/baseline/aws/load_balancer/aws_unused_gateway_load_balancers.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ Query:
2323
a.arn AS resource,
2424
og_resource_id,
2525
og_account_id,
26-
CASE
27-
WHEN jsonb_array_length(b.target_health_descriptions) = 0 THEN (SELECT cost FROM pennywise_cost_estimate WHERE resource_type = 'aws::elasticloadbalancingv2::loadbalancer' AND resource_id = a.og_resource_id LIMIT 1)
28-
ELSE 0
29-
END AS cost_optimization,
3026
CASE
3127
WHEN jsonb_array_length(b.target_health_descriptions) = 0 THEN 'alarm'
3228
ELSE 'ok'

compliance/controls/baseline/azure/virtual_machine/azure_check_for_old_virtual_machine_disk_snapshots.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,6 @@ Query:
2525
WHEN NOW() - s.time_created > '{{.azureDiskSnapshotAgeThreshold}} days'::interval THEN s.name || ' snapshot is too old and can be removed'
2626
ELSE s.name || ' snapshot is not old'
2727
END AS reason,
28-
CASE
29-
WHEN NOW() - s.time_created > '{{.azureDiskSnapshotAgeThreshold}} days'::interval THEN (
30-
SELECT cost
31-
FROM pennywise_cost_estimate
32-
WHERE resource_type = 'microsoft.compute/snapshots' AND resource_id = s.og_resource_id
33-
LIMIT 1
34-
)
35-
ELSE 0
36-
END AS cost_optimization,
3728
s.resource_group,
3829
sub.display_name AS subscription
3930
FROM

0 commit comments

Comments
 (0)