The Simplest Way to Make AWS Secrets Manager and Dataproc Work Like They Should
Using aws secrets manager and dataproc together lets Google Cloud jobs read Amazon secrets. This setup helps data teams run Spark and Hadoop jobs with cross-cloud keys. Many teams store their main database keys in Amazon Web Services. At the same time, they run big data jobs on Google Cloud. Linking these two systems stops teams from copying raw keys into job scripts. It also keeps secret rotation simple across both clouds. How aws secrets manager and dataproc share keys and roles A Dataproc
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.
Using aws secrets manager and dataproc together lets Google Cloud jobs read Amazon secrets. This setup helps data teams run Spark and Hadoop jobs with cross-cloud keys.
Many teams store their main database keys in Amazon Web Services. At the same time, they run big data jobs on Google Cloud. Linking these two systems stops teams from copying raw keys into job scripts. It also keeps secret rotation simple across both clouds.
How aws secrets manager and dataproc share keys and roles
A Dataproc cluster runs on Google Cloud virtual machines. Each cluster uses a Google service account as its main identity. To read an Amazon secret, that Google identity must trade its token. It sends its Google token to the Amazon identity service.
Amazon checks the Google token against a trust rule on an Amazon role. When the check passes, Amazon sends back short-term credentials. The Dataproc worker node then uses those credentials to ask for the secret. The secret stays in memory while the Spark job runs.
Teams often run this fetch step during cluster start up. Some teams fetch the secret inside the Spark job code instead. Fetching inside the job code limits which apps can read the secret. It also makes sure each job uses its own role permissions.
Common failure modes and how to scope roles
The biggest mistake is putting raw Amazon keys inside startup scripts. Anyone who can read the cloud storage bucket can see those keys. Long-lived keys also break jobs when a security team rotates them. Always use workload identity federation instead of static keys.
Another common risk is using one broad service account for every cluster. If all jobs share one Google identity, they share the same Amazon role. A test job could then read production database keys from the secret store. Teams should create a unique service account for each job type.
AWS Secrets Manager + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Broad read rules in Amazon cause trouble too. Do not give the Amazon role access to all secrets in the account. Scope the role so it can only read the exact secret it needs. Use resource tags to lock down secret access by team and project.
Unlogged secret reads and database queries also create blind spots. When a shared cluster reads a secret, logs only show the machine name. You cannot tell which engineer ran the job or changed the data. Network paths should also stay private between the two clouds.
Keeping cross-cloud data jobs safe in production
Good network rules stop outside traffic from reaching your cluster nodes. Set up private routing or peering between your Google network and Amazon. Keep your cluster nodes off the public internet whenever you can. Limit outbound traffic so nodes only talk to the Amazon secret endpoint.
Watch your secret usage logs in both cloud consoles every week. Check that secret read counts match the number of jobs you run. If a cluster asks for a secret every second, add local caching. Caching in memory cuts down on API calls and lowers cloud costs.
Finally, clean up your temporary files when a job finishes. Never write secret values to disk or print them into job logs. Masking tools can rewrite emails, phone numbers, card numbers, and national IDs in results.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
How do Dataproc nodes log in to AWS Secrets Manager without static keys?
Nodes use Google service account tokens with Amazon web identity federation. Amazon checks the Google token and gives the node a short-term role.
Where should a Spark job fetch secrets during a run?
Fetch secrets inside the driver code right before the job needs them. Do not write secrets to cluster disks during an early setup step.
How can teams stop test clusters from reading production secrets?
Give each cluster its own Google service account and matching Amazon role. Set the Amazon policy to allow reading only the specific test secret.
Related guides
In this post