accounts_by_provideraccounts_by_workspaceaccounts_countaccounts_totalactive_controls_by_workspaceactive_controls_countalerts_totalcache_health_checkcontrols_summaryguardrails_activity_retentionguardrails_control_alarm_countguardrails_control_alarm_total_countguardrails_control_alert_24_hours_countguardrails_control_alert_after_1_yearguardrails_control_alert_between_1_30_daysguardrails_control_alert_between_30_90_daysguardrails_control_alert_between_90_365_daysguardrails_control_alert_oldestguardrails_control_error_24_hours_countguardrails_control_error_after_1_yearguardrails_control_error_between_1_30_daysguardrails_control_error_between_30_90_daysguardrails_control_error_between_90_365_daysguardrails_control_error_countguardrails_control_error_oldestguardrails_control_error_total_countguardrails_control_invalid_24_hours_countguardrails_control_invalid_after_1_yearguardrails_control_invalid_between_1_30_daysguardrails_control_invalid_between_30_90_daysguardrails_control_invalid_between_90_365_daysguardrails_control_invalid_countguardrails_control_invalid_oldestguardrails_control_invalid_total_countguardrails_control_top_20_alertsguardrails_mod_auto_updateguardrails_retentionguardrails_workspace_user_activityinstalled_aws_mods_countinstalled_azure_mods_countinstalled_gcp_mods_countinstalled_mods_by_platformmod_auto_updatemod_health_benchmarkmod_installed_controls_errormod_installed_controls_error_listmod_process_monitor_benchmarkpolicies_summarypolicy_settings_totalresources_by_workspaceresources_countsmart_process_retentionsmart_retentionstacks_aggregatetype_installed_controls_errortype_installed_controls_error_listworkspace_account_detailworkspace_health_controlworkspace_statsworkspaces_count
Query: guardrails_workspace_user_activity
Usage
powerpipe query guardrails_insights.query.guardrails_workspace_user_activity
Steampipe Tables
SQL
select g.workspace, g.workspace as resource, case when count( case when (n.notifications ->> 'email') not like '%@turbot.com' then 1 else null end ) = 0 then 'alarm' else 'ok' end as status, case when count( case when (n.notifications ->> 'email') not like '%@turbot.com' then 1 else null end ) = 0 then 'Workspace is Inactive. No User Login for 30 Days.' else 'Workspace is Active.' end as reasonfrom guardrails_query gleft join lateral jsonb_array_elements(g.output -> 'notifications' -> 'items') as n(notifications) ON TRUEwhere g.query = '{ notifications: resources( filter: "resourceTypeId:tmod:@turbot/turbot-iam#/resource/types/profile,tmod:@turbot/turbot-iam#/resource/types/groupProfile,tmod:@turbot/aws-iam#/resource/types/instanceProfile $.lastLoginTimestamp:>=T-30d" ) { items { email: get(path:"email") lastLoginTimestamp: get(path: "lastLoginTimestamp") trunk { title } turbot { akas } } } }'group by g.workspace;
Controls
The query is being used by the following controls: