turbot/kubernetes_compliance

Query: endpoint_api_serve_on_secure_port

Usage

powerpipe query kubernetes_compliance.query.endpoint_api_serve_on_secure_port

Steampipe Tables

SQL

select
coalesce(uid, concat(path, ':', start_line)) as resource,
case
when p ->> 'name' = 'https' and (p ->> 'port' = '443' or p ->> 'port' = '6443') then 'ok'
else 'alarm'
end as status,
case
when p ->> 'name' = 'https' and (p ->> 'port' = '443' or p ->> 'port' = '6443') then name || ' Kubernetes API serving on secure port.'
else name || ' Kubernetes API not serving on secure port.'
end as reason,
name as endpoint_name
, coalesce(context_name, '') as context_name, namespace, source_type, coalesce(path || ':' || start_line || '-' || end_line, '') as path
from
kubernetes_endpoint,
jsonb_array_elements(subsets) as s,
jsonb_array_elements(s -> 'ports') as p
where name = 'kubernetes';

Controls

The query is being used by the following controls: