turbot/net_insights
Loading controls...

Control: Ensure certificates have sufficient hostname coverage

Description

It is recommended that your certificates cover all the names you wish to use with a site, since you cannot control how your users arrive at the site or how others link to it. Make sure you have added all the necessary domain names to certificate's Subject Alternative Name (SAN).

Usage

Run the control in your terminal:

powerpipe control run net_insights.control.ssl_certificate_multiple_hostname

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run net_insights.control.ssl_certificate_multiple_hostname --share

Steampipe Tables

Params

ArgsNameDefaultDescriptionVariable
$1domain_names
["github.com","microsoft.com"]
DNS domain names.

SQL

select
common_name as resource,
case
when jsonb_array_length(dns_names) > 1 then 'ok'
else 'alarm'
end as status,
case
when jsonb_array_length(dns_names) > 1 then common_name || ' has sufficient hostname coverage.'
else common_name || ' don''t have sufficient hostname coverage.'
end as reason
from
net_certificate
where
domain in (
select
jsonb_array_elements_text(to_jsonb($1 :: text [ ]))
)
order by
common_name;