A Secure Framework for Exposing SaaS Data to Your Data Lake
How to pull large volumes of data out of any enterprise SaaS platform — safely, repeatably, and without a single write permission. Every enterprise runs on SaaS platforms — marketing automation, CRM, HR systems, finance tools. And every data team eventually gets the same request: "Can we get that data into our lake?" The naive answer is to grab an admin's credentials, hit the API, and start downloading. It works — right up until the admin leaves the company, the password rotates, someone accidentally writes data back into the source system, or the security team asks who exactly has been exporting customer records at 2 AM. This post describes a framework I've used to expose SaaS platform data to a data lake the right way. It's platform-agnostic: the same pattern works for almost any modern SaaS tool that offers a REST API. The framework has four pillars: A least-privilege, read-only API role A dedicated, non-human service account OAuth 2.0 client-credentials authentication An asynchronous bulk-export job pattern Let's walk through each. Pillar 1: A Read-Only API Role Before touching any code, create a dedicated permission role inside the source platform — and give it only read permissions, only on the API surface. Most enterprise SaaS platforms separate permissions into two planes: UI permissions — what a human can click on in the web interface API permissions — what a token can do programmatically Your extraction role should have zero UI permissions and only the Read-Only API permissions for the objects you need: records, activities, memberships, whatever your platform calls them. Why this matters: Blast radius. If the credentials ever leak, the worst an attacker can do is read the same data you were already reading. They cannot delete records, trigger campaigns, or modify configuration. Auditability. When the security team reviews the role, "read-only, API-only" is a one-line conversation. Future-proofing. Ticking all the read-only permissions (rather than the two