Check if you’re affected
You’re affected if both of the following are true:- Your installation runs, or ran, an affected APC version.
- You supply the database connection for one or more Deployments yourself, either in the
metadataConnection,metadataConnectionJson,resultBackendConnection, orresultBackendConnectionJsonarguments of theupsertDeploymentmutation, or through a pre-deployment webhook.
The credentials appear in the following locations:
- The logs of the APC API and APC 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.
- APC audit events, including events for failed requests, and the sink that receives them.
Step 1: Stop new log entries
Upgrade to APC 2.1.1 or later. APC 2.1.1 redacts customer-managed database credentials written to log lines. No 2.0.x release includes the fix. For details, see the APC 2.1.1 release notes.- To upgrade from 2.0.x or 2.1.0, see Upgrade 2.x to 2.x.
- To upgrade from 1.x, see Upgrade 1.x to 2.x.
- To upgrade from 0.37, see Upgrade 0.37 to 2.x.
warn. The affected log lines use the info level, so this setting stops new entries. It also removes all other info log lines from the APC API. Add the following to your values.yaml file, then apply the 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 APC API or APC Worker Pod logs, restrict read access to the indices, tables, or buckets that hold them.
- Restrict read access to the sink that receives your audit events.
Step 3: Rotate the exposed credentials
Because these credentials were stored in plaintext, Astronomer recommends that you rotate them. An upgrade or log level change affects only new log entries. 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 APC API or APC 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.
- Do the same in the sink that receives your audit events.
- Repeat the search in copies of these logs, such as SIEM archives, data lake tables, cold storage buckets, and backups.