turbot/guardrails_insights

Query: workspace_stats

Usage

powerpipe query guardrails_insights.query.workspace_stats

Steampipe Tables

SQL

select
workspace as "Workspace",
(output -> 'accounts' -> 'metadata' -> 'stats' ->> 'total')::int as "Accounts",
(output -> 'resources' -> 'metadata' -> 'stats' ->> 'total')::int as "Resources",
(output -> 'policySettings' -> 'metadata' -> 'stats' ->> 'total')::int as "Policy Settings",
(output -> 'alerts' -> 'metadata' -> 'stats' ->> 'total')::int as "Alerts",
(output -> 'active_controls' -> 'metadata' -> 'stats' ->> 'total')::int as "Active Controls"
from
guardrails_query
where
query = '{
accounts: resources(
filter: "resourceTypeId:tmod:@turbot/turbot#/resource/interfaces/accountable level:self"
) {
metadata {
stats {
total
}
}
}
resources: resources(
filter: "resourceTypeId:tmod:@turbot/aws#/resource/types/aws,tmod:@turbot/azure#/resource/types/azure,tmod:@turbot/gcp#/resource/types/gcp"
) {
metadata {
stats {
total
}
}
}
policySettings: policySettings {
metadata {
stats {
total
}
}
}
alerts: controls(filter: "state:alarm,invalid,error") {
metadata {
stats {
total
}
}
}
active_controls: controls(
filter: "state:active resourceTypeId:tmod:@turbot/aws#/resource/types/aws,tmod:@turbot/azure#/resource/types/azure,tmod:@turbot/gcp#/resource/types/gcp"
) {
metadata {
stats {
total
}
}
}
}'
order by
"Workspace";

Dashboards

The query is used in the dashboards: