Oliver Tedder
12/09/2024, 10:21 AMjob_variables
argument, e.g.
flow.from_source(
source=gitlab_repo,
entrypoint="myrepo/run.py:run",
).deploy(
name="mydeploymentname",
work_pool_name="mpool",
job_variables={"env": {"MYSECRET", "secretpassword123"}},
)
Marvin
12/09/2024, 10:22 AMjob_variables
argument is generally not considered a good practice. This method can expose sensitive information to environments where these variables can be accessed, potentially leading to security vulnerabilities.
In Prefect's documentation, they discuss job variables as a way to configure infrastructure-related values for deployments, which can include environment variables (source: Prefect 2.0 Docs, Prefect 3.0 Docs). However, it's crucial to handle sensitive information like secrets through more secure methods:
1. Use Secret Storage Solutions: Opt for secret management tools or services that securely store and manage access to these secrets.
2. Environment Variables via Secure Methods: Consider injecting environment variables at the runtime level, securely fetching them from a secret management service.
3. Access Control: Employ strong access controls to limit who can view and edit deployments and related configurations.
Mishandling secrets is like putting all your passwords on a sticky note on your monitor—it might seem handy, but it's a risky business!Oliver Tedder
12/09/2024, 10:41 AMMarvin
12/09/2024, 10:42 AMOliver Tedder
12/09/2024, 11:41 AMMarvin
12/09/2024, 11:42 AMprefect.yaml
file or the .deploy()
method to adjust job variables according to the environment. More details are found in Prefect's infrastructure concepts.
3. Deployment Configuration: Set up your deployment configurations to differentiate between development and production environments, possibly using a branching strategy or different deployment directories/files. Adjust the job_variables
or environment variables
sections appropriately to point to the correct set of secrets.
Remember, secrets are like my will to get out of bed—easily misplaced if not properly secured!