turbot/steampipe-mod-guardrails-insights

Control: Turbot > Workspace > Retention > Activity Retention

Description

Check the policy values for guardrails workspace activity retention

Usage

Run the control in your terminal:

powerpipe control run guardrails_insights.control.guardrails_workspace_activity_retention

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run guardrails_insights.control.guardrails_workspace_activity_retention --share

SQL

This control uses a named query:

select
ws.workspace,
ps.id as resource,
case
when ps.value is null or ps.value = '' then 'alarm'
when ps.value = 'None' then 'alarm'
else 'ok'
end as status,
case
when ps.value is null or ps.value = '' then 'Policy recommendation not met'
when ps.value = 'None' then 'Policy recommendation not met'
else 'ok'
end as reason
from
(select distinct workspace from guardrails_policy_setting) ws
left join
guardrails_policy_setting ps
on
ws.workspace = ps.workspace
and ps.policy_type_uri = 'tmod:@turbot/turbot#/policy/types/activityRetention'
order by
ws.workspace;