turbot/terraform_aws_compliance

Query: eks_cluster_node_group_ssh_access_from_internet

Usage

powerpipe query terraform_aws_compliance.query.eks_cluster_node_group_ssh_access_from_internet

Steampipe Tables

SQL

select
address as resource,
case
when (attributes_std -> 'remote_access') is null then 'ok'
when (attributes_std -> 'remote_access' ->> 'ec2_ssh_key') is not null and (attributes_std -> 'remote_access' ->> 'source_security_group_ids') is not null then 'ok'
when (attributes_std -> 'remote_access' ->> 'ec2_ssh_key') is not null and (attributes_std -> 'remote_access' ->> 'source_security_group_ids') is null then 'alarm'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'remote_access') is null then ' node group does not have implicit SSH access from 0.0.0.0/0'
when (attributes_std -> 'remote_access' ->> 'ec2_ssh_key') is not null and (attributes_std -> 'remote_access' ->> 'source_security_group_ids') is not null then ' SSH access restricted to security group(s)'
when (attributes_std -> 'remote_access' ->> 'ec2_ssh_key') is not null and (attributes_std -> 'remote_access' ->> 'source_security_group_ids') is null then ' has implicit SSH access from 0.0.0.0/0'
else ' has implicit SSH access from 0.0.0.0/0'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_eks_node_group';

Controls

The query is being used by the following controls: