fred_reimer
10/24/2021, 10:35 PMvisch
10/24/2021, 10:48 PMfred_reimer
10/24/2021, 10:57 PMvisch
10/24/2021, 11:19 PMmeltano
process running, and you want the env variables to update during the run?fred_reimer
10/25/2021, 11:25 AMvisch
10/25/2021, 12:36 PMfred_reimer
10/25/2021, 12:59 PMvisch
10/25/2021, 1:09 PM.env
files to set credentials (don't have to use postgres:postgres 😉 ) securely that won't get pushed up to git is a great start.
I understand wanting to go with Terraform, I'm curious about a few things first. Your company is in production currently using K8's, Terraform, Helm, and Vault? I only ask as sometimes I think people get the cart before the horse, and want to set up everything with all these tools, but don't actually use the tools yet. If yes, then 100% this is the right way to go
Yeah I was in charge of security at the last place I worked for a while I understand completely, it depends on the context of what you're doing. A test and something local, it's real easy to use "bad" creds, but when it's a local docker container locked down with fw rules on your local computer, I think it's alright to do imo.visch
10/25/2021, 1:13 PMfred_reimer
10/25/2021, 1:16 PMvisch
10/25/2021, 1:16 PMvisch
10/25/2021, 1:26 PM.env
or somethingvisch
10/25/2021, 1:27 PMfred_reimer
10/25/2021, 1:30 PMken_payne
10/25/2021, 2:17 PMmeltano invoke
to execute the Airflow components in your environment. This (among other things) sets additional environment variables from the meltano.yml
project file before calling the wrapped plugin. This is how secrets set as env vars and then pulled by meltano are passed onto plugins like Airflow. It is also the reason to use env vars in the Meltano format, rather than Airflows directly - Meltano will override them. Its also worth noting, these are only evaluated on process startup.
• Airflow specifically is designed to be distributed (separate schedules, workers and UI webservers) all that need to interact with the database to function. So rotation would need to happen on all components to maintain successful running.
• Therefore I recommend doing rotation at deployment time. This may mean i) a tool like chamber to fetch secrets from Vault and inject them into the environment before meltano invoke
is called, ii) a tool/snippet to rotate the db creds and update secrets on a schedule and iii) a scheduled action to redeploy (or at least restart) Airflow after rotation.
• If you already have a mechanism for rotating secrets and placing them into an .env file, you simply need to add a hook to redeploy or restart Airflow (via meltano invoke
following rotation) 🙂
Hope this helps!ken_payne
10/25/2021, 2:21 PMfred_reimer
10/25/2021, 3:40 PMfred_reimer
10/31/2021, 2:06 AMfred_reimer
10/31/2021, 2:22 AM