The Simplest Way to Make AWS RDS and Github Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Pairing aws rds and github lets your team run database changes from code commits. Your build jobs test and apply schema updates without manual steps. This workflow links code reviews to data updates. Developers push SQL changes to a branch and open a pull request. After approval, a runner connects to the cloud database and runs the update. Good setups use short-lived cloud roles instead of stored passwords. How aws rds and github handle identity and data flow Data flow starts when a develope

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.

Pairing aws rds and github lets your team run database changes from code commits. Your build jobs test and apply schema updates without manual steps.

This workflow links code reviews to data updates. Developers push SQL changes to a branch and open a pull request. After approval, a runner connects to the cloud database and runs the update. Good setups use short-lived cloud roles instead of stored passwords.

How aws rds and github handle identity and data flow

Data flow starts when a developer pushes code or merges a pull request. The source control platform starts an automated job on a build runner. That runner needs a safe way to log in to the database.

Modern setups use OpenID Connect to link the two platforms. The build runner sends a signed token to the cloud provider. The cloud provider checks this token against a trust rule. If the repo and branch match the rule, the cloud issues a temporary key.

Next, the runner uses that temporary key to request a database login token. The database checks the token through its built-in cloud identity feature. This path skips static passwords in repo secrets.

Network traffic also needs a clear path between the runner and the database. Public runners sit outside your private cloud network. Teams either run private runners inside the cloud network or open strict firewall rules. Private runners keep all database traffic on the internal network.

Common failure modes and how to scope roles

Many teams start by putting a master database password into a repo secret. This shortcut creates huge risks for production data. Any workflow in that repo can read the secret and change any table.

Shared service accounts also ruin audit logs. When five jobs use one database user, all queries look the same. You cannot tell which pull request or developer dropped a table. Broad network rules make things worse when teams allow traffic from all addresses.

AWS IAM Policies + GitHub Actions Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, split database roles by task and branch. Give pull request jobs a read-only role or a staging database target. Give main branch jobs a role that only changes schema tables. Never give a build runner full admin rights on the database instance.

Lock down your cloud trust rules to exact repo names and branch names. Check that only the main branch can assume the production migration role. Turn on database query logs so every schema change leaves a clear record.

Auditing schema changes and protecting sensitive data

Automated jobs are not the only link between code and data. Developers often inspect database state while fixing bugs found in pull requests. If engineers share one login for these checks, your audit trail breaks.

Every query from a person or a job should map to one identity. When a runner executes a script, log the commit hash and the author. When a developer runs a check, log their user email and the query text.

Production tables also hold sensitive fields like emails, phone numbers, and card numbers. Build logs and test outputs must not expose these values to the whole team. Data masking rewrites matched fields in results before they reach logs or screens. You can also require peer approval before a job or user runs high-risk commands.

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

How do build runners reach a private cloud database?

Place self-hosted runners inside the same private cloud network as your database. Then set the database security group to allow traffic only from those runners.

Should we store database passwords in repo secrets?

No, static passwords in repo secrets are hard to rotate and easy to leak. Use OpenID Connect with cloud database login to issue short-lived tokens per job.

How can we prevent a bad migration script from dropping production data?

Run schema checks on a staging copy first during the pull request phase. Scope the production database role so the runner cannot run destructive drop commands.

The query runs. The emails stay hidden.