Check if you’re affected
You’re affected if you supply the database connection for one or more Deployments yourself, either in themetadataConnection, metadataConnectionJson, resultBackendConnection, or resultBackendConnectionJson arguments of the upsertDeployment mutation, or through a pre-deployment webhook.
This guide covers the Houston API logs only.
The credentials appear in the following locations:
- The logs of the Houston API and Houston worker Pods in your platform namespace.
- Any system that collects those Pod logs, such as a security information and event management (SIEM) system, a data lake, or a log archive in cold storage.
Step 1: Stop new log entries
Astro Private Cloud (APC) 2.1.1 redacts customer-managed database credentials written to log lines. Astronomer recommends that you upgrade to APC 2.1.1 or later. See Upgrade 0.37 to 2.x. Until you upgrade, set the Houston API log level towarn. The affected log lines use the info level, so this setting stops new entries. It also removes all other info log lines from the Houston API.
-
Add the following to your
values.yamlfile: - Apply the change. See Apply a config change.
Step 2: Restrict access to the logs
Limit who can read the affected logs while you rotate the credentials and remove the old entries.- In Kubernetes, restrict the
getpermission onpods/login your platform namespace to the smallest group of users that need it. To check a user’s access, runkubectl auth can-i get pods/log -n <platform-namespace> --as <user>. - In every system that collects Houston API or Houston worker Pod logs, restrict read access to the indices, tables, or buckets that hold them.
Step 3: Rotate the exposed credentials
Because these credentials were stored in plaintext, Astronomer recommends that you rotate them. Changing the log level stops new entries, but credentials in existing entries remain valid until you change them. For each affected Deployment:- In your database, set a new password for the database user, or create a new database user.
- Update the Deployment connection in the same location you set it originally: the
upsertDeploymentmutation or your pre-deployment webhook. See Use a MySQL or PostgreSQL database for metadata or storage. - Confirm that the Deployment’s Airflow components restart and connect to the database.
- Remove the old password or the old database user.
Step 4: Purge the affected log entries
After you rotate the credentials, the old values in your logs no longer grant access. Remove or redact those entries anyway, so that a credential you missed during rotation doesn’t stay exposed.- In every system that keeps Houston API or Houston worker Pod logs, search for entries that contain
metadataConnectionorresultBackendConnection. Start the search from the date you first supplied a connection for an affected Deployment. - Delete the matching entries, or redact the credentials in them.
- Repeat the search in copies of these logs, such as SIEM archives, data lake tables, cold storage buckets, and backups.