Skip to content

Commit d05b869

Browse files
authored
Create linode_insight_publicly_exposed_k8s_clusters
1 parent ab7198b commit d05b869

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
id: linode_insight_publicly_exposed_k8s_clusters
2+
type: query
3+
title: Publicly Exposed Kubernetes Clusters in Linode
4+
description: >
5+
List of publicly exposed Kubernetes clusters in Linode with indicators for exposure on:
6+
- Port 80 (HTTP)
7+
- Port 443 (HTTPS)
8+
- ClickHouse (via ports 9440 and/or 9000)
9+
- ElasticSearch (via ports 9200 and/or 9300)
10+
query: |
11+
SELECT
12+
c.id AS cluster_id,
13+
c.label AS cluster_label,
14+
CASE
15+
WHEN COUNT(CASE WHEN config.port = 80 THEN 1 END) > 0
16+
THEN 'Yes' ELSE 'No'
17+
END AS "Port 80",
18+
CASE
19+
WHEN COUNT(CASE WHEN config.port = 443 THEN 1 END) > 0
20+
THEN 'Yes' ELSE 'No'
21+
END AS "Port 443",
22+
CASE
23+
WHEN COUNT(CASE WHEN config.port IN (9440, 9000) THEN 1 END) > 0
24+
THEN 'Yes' ELSE 'No'
25+
END AS "ClickHouse",
26+
CASE
27+
WHEN COUNT(CASE WHEN config.port IN (9200, 9300) THEN 1 END) > 0
28+
THEN 'Yes' ELSE 'No'
29+
END AS "ElasticSearch"
30+
FROM linode_kubernetes_node AS n
31+
JOIN linode_kubernetes_cluster AS c
32+
ON n.cluster_id::integer = c.id
33+
JOIN linode_node_balancer AS nb
34+
ON nb.account = n.account
35+
JOIN linode_node_balancer_config AS config
36+
ON config.nodebalancer_id = nb.id
37+
WHERE config.port IN (80, 443, 9440, 9000, 9200, 9300)
38+
GROUP BY c.id, c.label;
39+
tags:
40+
category:
41+
- Security

0 commit comments

Comments
 (0)