turbot/steampipe-mod-gcp-compliance

Query: project_oslogin_enabled

Usage

powerpipe query gcp_compliance.query.project_oslogin_enabled

SQL

select
id as resource,
case
when exists (
select 1
from jsonb_array_elements(common_instance_metadata -> 'items') as items
where lower(items ->> 'key') = 'enable-oslogin'
and lower(items ->> 'value') in ('true','y','yes','1')
) then 'ok'
else 'alarm'
end as status,
case
when exists (
select 1
from jsonb_array_elements(common_instance_metadata -> 'items') as items
where lower(items ->> 'key') = 'enable-oslogin'
and lower(items ->> 'value') in ('true','y','yes','1')
) then title || ' OS login enabled.'
else title || ' OS login disabled.'
end as reason
, location as location, project as project
from
gcp_compute_project_metadata;

Controls

The query is being used by the following controls: