turbot/aws_compliance

Query: eks_cluster_endpoint_public_access_restricted

Usage

powerpipe query aws_compliance.query.eks_cluster_endpoint_public_access_restricted

Steampipe Tables

SQL

select
arn as resource,
case
when resources_vpc_config ->> 'EndpointPrivateAccess' = 'true' and resources_vpc_config ->> 'EndpointPublicAccess' = 'false' then 'ok'
when resources_vpc_config ->> 'EndpointPublicAccess' = 'true' and resources_vpc_config -> 'PublicAccessCidrs' @> '["0.0.0.0/0"]' then 'alarm'
else 'ok'
end as status,
case
when resources_vpc_config ->> 'EndpointPrivateAccess' = 'true' and resources_vpc_config ->> 'EndpointPublicAccess' = 'false' then title || ' endpoint access is private.'
when resources_vpc_config ->> 'EndpointPublicAccess' = 'true' and resources_vpc_config -> 'PublicAccessCidrs' @> '["0.0.0.0/0"]' then title || ' endpoint access is public.'
else title || ' endpoint public access is restricted.'
end as reason
, region, account_id
from
aws_eks_cluster;

Controls

The query is being used by the following controls: