Skip to content

Data View Export

WebbinRoot edited this page Jul 10, 2026 · 2 revisions

Data View/Export

Use this page for SQL queries, export commands, and wipe operations against local workspace data.

Query Data (SQL)

data sql --db service "SELECT * FROM iam_allow_policies LIMIT 25"
data sql --db metadata "SELECT * FROM workspaces"

Tables added by newer service modules

The newer GCP service modules populate their own workspace-scoped tables. A few you can query directly:

data sql --db service "SELECT * FROM logging_sinks LIMIT 25"        # enum_logging
data sql --db service "SELECT * FROM logging_buckets LIMIT 25"
data sql --db service "SELECT * FROM logging_logs LIMIT 25"
data sql --db service "SELECT * FROM logging_metrics LIMIT 25"
data sql --db service "SELECT * FROM billing_accounts LIMIT 25"     # enum_billing
data sql --db service "SELECT * FROM project_billing_info LIMIT 25"
data sql --db service "SELECT * FROM cloudshell_environments LIMIT 25"  # enum_cloudshell
data sql --db service "SELECT * FROM cloudscheduler_jobs LIMIT 25"  # enum_cloudscheduler
data sql --db service "SELECT * FROM spanner_instances LIMIT 25"    # enum_spanner
data sql --db service "SELECT * FROM spanner_databases LIMIT 25"
data sql --db service "SELECT scope_type, scope_name, policy_id, denied_principals, denied_permissions FROM iam_deny_policies"  # enum_gcp_policy_bindings (IAM deny policies)

Other new modules (enum_cloudworkflows, enum_alloydb, enum_eventarc, enum_workstations, enum_orgpolicy, and the --clusters component of enum_memorystore) follow the same per-service table convention.

enum_asset_inventory is different: instead of its own table, a single Cloud Asset Inventory scan upserts into the shared tables other modules already use (iam_allow_policies, abstract_tree_hierarchy, iam_service_accounts/keys/roles, cloudcompute_instances, WIF pools/providers). It is opt-in inside enum_all (enum_all --asset-inventory).

Export Data

Supported formats:

  • csv
  • json
  • excel
  • treeimage

Examples:

data export csv
data export json
data export excel
data export treeimage

Custom output targets:

data export json --out-file ./exports/gcpwn.json
data export excel --out-file ./exports/gcpwn.xlsx
data export csv --out-dir ./exports/csv

Wipe Service Data (Destructive)

data wipe-service --yes
data wipe-service --all-workspaces --yes

Without --yes, GCPwn prompts for confirmation.

Export Output Paths

Default export root:

gcpwn_output/<workspace_slug>/exports/

Typical files:

  • sqlite_blob.csv
  • sqlite_blob.json
  • sqlite_blob.xlsx
  • hierarchy_tree.svg

Quick Review Flow

modules run enum_all --iam
modules run enum_gcp_policy_bindings --ensure-tree
data export excel
data sql --db service "SELECT * FROM member_permissions_summary LIMIT 20"

Clone this wiki locally