How to Integrate Looker and DuckDB Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Integrating looker and duckdb lets analytics teams run fast dashboards over local or cloud files. Looker builds the SQL queries, and a hosted DuckDB service executes them against your data. This setup gives teams fast analytics without maintaining a massive data warehouse. Still, linking a web analytics platform to an in-process database engine requires strict security rules. You must plan how users log in, how queries run, and how data moves. How authentication and data flow work in looker a

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Integrating looker and duckdb lets analytics teams run fast dashboards over local or cloud files. Looker builds the SQL queries, and a hosted DuckDB service executes them against your data.

This setup gives teams fast analytics without maintaining a massive data warehouse. Still, linking a web analytics platform to an in-process database engine requires strict security rules. You must plan how users log in, how queries run, and how data moves.

How authentication and data flow work in looker and duckdb

Looker needs a network path and a database driver to talk to your data engine. DuckDB usually runs inside a host app or as a managed cloud service. Looker sends standard SQL queries over the network to this hosted DuckDB instance. The database engine reads the underlying files, runs the math, and sends back the results.

To make this work, Looker stores a database key or token in its admin settings. When a business user loads a chart, Looker logs in with that stored key. Then the database checks its local rules to see which tables that key can read. Finally, the data flows back to the user's browser as a clean chart or table.

Because DuckDB can read directly from cloud object storage, permissions have two layers. First, Looker needs permission to query the DuckDB service. Second, the DuckDB process needs its own cloud role to read the raw data files. Both layers must stay locked down so users only query approved data.

Common failure modes and how to scope roles

Many teams use one shared admin account to link their charts to the database. This common mistake gives every dashboard user full read and write powers over all files. If an attacker steals that single key, they can read or delete everything. Shared accounts also ruin your audit logs because every query looks identical.

Broad storage tokens create another big risk for data teams. If the database process holds a wide cloud storage key, SQL queries might read private buckets. A clever user in Looker could write custom SQL to pull files outside their normal team scope. Also, unlogged queries make it impossible to see who read sensitive customer records.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, create a read-only role specifically for your reporting tool. Block the database engine from loading random external plugins or reading local system files. Scope the cloud storage role so the engine only reads clean, approved analytics folders. Put the database service in a private network and allow traffic only from Looker IP addresses.

Protecting sensitive columns during analytics queries

Analytics tables often hold private data like customer emails, phone numbers, and card numbers. Even when you scope roles well, business analysts might still query tables with raw personal details. Copying files just to strip out private columns takes too much time and storage space.

A better pattern is to apply data masking rules as queries run. Masking rewrites matched fields like national IDs or phone numbers in the query results. Analysts still get accurate counts and groupings, while sensitive text turns into masked symbols. You should also keep a clear log of every SQL statement and the user who ran it.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Can Looker query a local DuckDB file directly?

No, because Looker is a cloud web app and needs a network endpoint to reach your data. You must run DuckDB inside a server or use a hosted cloud service that accepts network connections.

How do we stop Looker users from modifying data in DuckDB?

Set the database instance to read-only mode when it mounts the database file. Also, give the storage role read-only permissions on the underlying cloud buckets so no query can write files.

How should we handle PII in raw Parquet files queried by DuckDB?

Keep raw files in a restricted bucket and expose only clean views or masked results to analysts. Dynamic data masking can rewrite emails, phone numbers, and card numbers before the results reach the dashboard.

The query runs. The emails stay hidden.