New to Kestra?
Use blueprints to kickstart your first workflows.
Audit Data Studio report sharing via the Google Drive permissions API and alert Slack when a report is shared with anyone holding the link.
A Data Studio report shared with "anyone with the link" looks identical to one scoped to three named analysts until someone actually lists its permissions. Data Studio has no dedicated Kestra plugin, but every Data Studio report is a Google Drive-backed file, so this blueprint reads its sharing through Drive's own permissions API on a schedule, flags any permission granted to "anyone", and pages Slack the moment one appears or the API itself cannot be reached.
list_asset_permissions (io.kestra.plugin.core.http.Request) calls GET https://www.googleapis.com/drive/v3/files/{fileId}/permissions for asset_id with a Bearer-token Authorization header, requesting the id, type, role, emailAddress, domain, and displayName fields. allowFailure: true means a connection or authentication failure still lets the flow continue instead of aborting.classify_sharing_risk (io.kestra.plugin.core.debug.Return) checks whether outputs.list_asset_permissions.body is defined; if not, UNREACHABLE. Otherwise, when flag_link_sharing is true, it runs a jq filter over the JSON body counting permissions whose type is anyone, returning AT_RISK when that count is above zero, HEALTHY otherwise.route_by_sharing_risk (io.kestra.plugin.core.flow.Switch) branches on that string: HEALTHY logs a quiet confirmation, AT_RISK pages Slack with the permission count, UNREACHABLE pages Slack separately, and defaults logs the raw outcome.log_audit_status records a status line on every run regardless of branch, so the execution history is a continuous sharing-compliance trend.errors block pages Slack separately if the flow itself fails outright.datastudio_sharing_gate_schedule trigger polls every 6 hours with explicit input overrides, shipped disabled: true until you point it at a real asset.status output (HEALTHY / AT_RISK / UNREACHABLE) you can chart or gate other flows on.Checking sharing settings by hand does not scale past a handful of dashboards, and a manual review only catches drift at the moment someone looks. This flow keeps every audit in the execution history, turns the result into a typed output other flows can depend on, and gives you a Switch branch to grow into real remediation (revoking the anyone permission automatically, opening a ticket) without rewriting the audit itself.
https://www.googleapis.com/auth/drive.readonly scope (or drive.metadata.readonly, which also covers permissions) for the account or service account that can see the tracked report. Data Studio (Looker Studio) itself is free to use with any Google account; no paid Google Cloud tier is required for this read-only scope. There is no self-hostable Docker image for this API, so test it against a real asset you control.asset_id must already exist and be reachable by the account behind the access token.GOOGLE_DRIVE_ACCESS_TOKEN: a valid OAuth2 access token with drive.readonly scope, sent as the Authorization: Bearer header on the permissions.list call.SLACK_WEBHOOK_URL: Slack incoming webhook used for the at-risk alert, the unreachable alert, and the flow-failure alert.SECRET_GOOGLE_DRIVE_ACCESS_TOKEN and SECRET_SLACK_WEBHOOK_URL as base64, for example echo -n "<your-access-token>" | base64 and echo -n "<your-webhook-url>" | base64.GOOGLE_DRIVE_ACCESS_TOKEN and SLACK_WEBHOOK_URL secrets.asset_id to a Data Studio report or Drive file you control.status reads HEALTHY for an asset scoped to named users.status reads AT_RISK.datastudio_sharing_gate_schedule.Loop task to audit an entire portfolio of dashboards from one flow.emailAddress or domain outside your organization, not just type: anyone.io.kestra.plugin.core.http.Request task calling Drive's permissions.delete endpoint to automatically revoke the anyone permission once detected, instead of only alerting.