CDCgov / cfa-config-validation

Modeling pipeline config validation microservice.
Apache License 2.0
0 stars 0 forks source link

Integrating Azure authentication #13

Closed amondal2 closed 22 hours ago

amondal2 commented 1 day ago

Closes #4 --

First pass at integrating Azure secrets into the application. Since the application will be interacting with Azure via Docker, we only use Service Principal credentials to authenticate (as opposed to individual user credentials).

This PR:

  1. Adds authentication utils to pull environment variables and authenticate
  2. Injects secrets into the Docker container via docker-compose and an .env file (not committed)
  3. Adds an auth route to test if the application is authenticated properly

I looked into Docker secrets (https://docs.docker.com/engine/swarm/secrets/) for this, but it doesn't seem to me is much more secure given the secrets are just written to disk instead of as env variables (and more annoying to read from python), and if someone is able to ssh into the containers on the CDC network, we probably have bigger issues. Happy to take suggestions on how to improve the workflow, in any case.

I'll open separate issues/PRs for actually pulling from blob storage and automated deployments.

amondal2 commented 1 day ago

@zsusswein yep, that's correct!