marmotdata/firebase
Discover Firestore collections and Realtime Database instances from Firebase projects
The Firebase plugin discovers Firestore databases with their collections and subcollections, and Realtime Database instances, from a Firebase project.
Firestore stores no schema, so each collection's fields are inferred from a sample of its documents. A field missing from any sampled document, or null in one, is nullable; a field seen with two different types is mixed.
A subcollection exists once per parent document, so the copies are catalogued as one asset with the document id left out of the name: firestore/(default)/orders/lines.
Cloud Storage for Firebase buckets are not discovered here. They are GCS buckets and the gcs plugin already owns that identity.
Databases
Leaving databases empty lists every Firestore database through the admin API. The Firestore emulator does not implement that call, so name the databases explicitly when running against one.
Testing against the emulator
docker run -d --name firestore-emulator -p 8080:8080 \
gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators \
gcloud emulators firestore start --host-port=0.0.0.0:8080
MARMOT_TEST_FIRESTORE_EMULATOR_HOST=127.0.0.1:8080 go test ./...
Keyless authentication
On Marmot Cloud or Marmot Enterprise the pipeline can present its own identity instead of a service account key. Set workload_identity_provider to a Workload Identity Federation provider that trusts your Marmot instance as an OIDC issuer, and grant the pipeline's subject, pipeline:<name> as reported by the pipeline API, the role above directly (principal://iam.googleapis.com/<pool>/subject/pipeline:<name>), or grant it roles/iam.workloadIdentityUser on a service account named in service_account. No key exists anywhere; Marmot mints a short-lived token for each run.
In the UI
Point and click, no config file needed.
- Open Runs and choose Create pipeline.
- Pick Google Firebase from the plugin list.
- Fill in the settings, set a schedule and save.
With the CLI
Save a YAML config, then run marmot ingest.
Not using plugins? Other ways to populate Marmot
Configuration
Fields marked Required must be set.
tagsList of textTags to apply to discovered assets
external_linksList of groupsExternal links to show on all assets
nameTextDisplay name for the link
iconTextIcon identifier for the link
urlTextURL to the external resource
filterGroup of settingsFilter discovered assets by name (regex)
includeList of textInclude patterns for resource names (regex)
excludeList of textExclude patterns for resource names (regex)
zoneTextTells this system apart from others of the same technology and becomes part of every asset's MRN
audienceTextAudience of the Marmot identity token. Derived from the credentials' federation settings; set it only when the cloud side expects another
project_idText RequiredGoogle Cloud project ID
databasesList of textFirestore database IDs to scan. Every database is listed from the API when this is empty. The Firestore emulator has no such API, so name the databases here when pointing at one
credentials_fileTextPath to service account JSON file
credentials_jsonSecretService account JSON content
workload_identity_providerTextWorkload Identity Federation provider to exchange the Marmot identity token at, projects/<number>/locations/global/workloadIdentityPools/<pool>/providers/<provider>. Setting it federates: no key is needed; bind the pipeline's subject on the Google Cloud side
service_accountTextService account to impersonate after the exchange; empty acts as the federated principal directly
endpointTextCustom endpoint URL, for testing against a local server
disable_authYes or noDisable authentication, for local testing
include_realtime_databaseYes or noWhether to discover Realtime Database instances
include_project_detailsYes or noWhether to read the Firebase project name and number
include_subcollectionsYes or noWhether to descend into subcollections
max_collection_depthNumberHow many levels of subcollection to descend
sample_documentsNumberHow many documents to read per collection to infer its fields
Assets emitted
Metadata this plugin attaches to each discovered asset.
Project
The project-level metadata fields the plugin adds to every asset. They are kept as documentation-only structs so downstream tooling can introspect the shape of the metadata map.
Firestore Database
The metadata fields the plugin emits for a Firestore database asset.
Realtime Database
The metadata fields the plugin emits for a Realtime Database instance asset.
Firestore Collection
The metadata fields the plugin emits for a Firestore collection asset.
Firestore Column
The per-field columns inferred from the sampled documents and stored in an asset's schema.