GitHub user kokoc30 added a comment to the discussion: Airflow 2.9.3 version 
integration vault backend_kwargs

Yes—Airflow 2.9.3 can read connections from files rendered by Vault 
Agent/Injector. Direct Vault API access from the Airflow process is one option, 
not a requirement.

There are two separate issues in the example:

1. **The logged failure is certificate trust.** `unable to get issuer 
certificate` occurs during TLS verification, before the AppRole login can 
complete. Check that Vault serves the necessary intermediate certificates, and 
mount a PEM CA bundle trusted for that Vault endpoint into every Airflow 
container/pod that performs lookups. Add `"verify": 
"/etc/ssl/certs/vault-ca.pem"` to your existing Vault backend kwargs, using the 
actual mounted path. The [Hashicorp provider documentation you 
linked](https://airflow.apache.org/docs/apache-airflow-providers-hashicorp/2.2.0/secrets-backends/hashicorp-vault.html#for-vault-running-with-self-signed-certificates-add-verify-absolute-path-to-ca-certificate-file)
 documents this parameter. Keep certificate verification enabled. This 
traceback alone does not establish an AppRole/CeleryKubernetesExecutor 
incompatibility.

2. **For the Injector/file approach, configure a file backend.** Have the 
injector render a file such as `/vault/secrets/airflow-connections.json` in 
this format (illustrative values):

~~~json
{
  "psql": {
    "conn_type": "postgres",
    "host": "postgres.example.internal",
    "port": 5432,
    "schema": "app",
    "login": "app_user",
    "password": "RENDERED_FROM_VAULT"
  }
}
~~~

Then use:

~~~ini
[secrets]
backend = airflow.secrets.local_filesystem.LocalFilesystemBackend
backend_kwargs = {"connections_file_path": 
"/vault/secrets/airflow-connections.json"}
~~~

This is the documented [Airflow 2.9.3 Local Filesystem Secrets 
Backend](https://airflow.apache.org/docs/apache-airflow/2.9.3/security/secrets/secrets-backend/local-filesystem-secrets-backend.html),
 including the Kubernetes sidecar/shared-volume use case. The rendered JSON 
must be valid JSON; use JSON-aware escaping in the Vault template for passwords 
and other values. Ensure the file exists before the task starts and is readable 
by the Airflow process. With your executor, that includes the actual Celery 
workers and dynamically created Kubernetes task pods that need the 
connection—not just the scheduler/webserver. Credential renewal and file 
refresh remain the injector/agent's responsibility.

Your existing `BaseHook.get_connection("psql")` call can stay. Avoid printing 
its URI to test success, since that can disclose the password; inspect a 
non-secret property instead.

One important expectation to adjust: connections supplied by **either** 
alternative backend will not appear in the UI's Connections list. In 2.9.3 that 
list shows metadata-database entries only, as the [secrets-backend 
documentation](https://airflow.apache.org/docs/apache-airflow/2.9.3/security/secrets/secrets-backend/index.html)
 explains. A successful runtime lookup is the relevant check.

I checked the versioned documentation and 2.9.3 file-backend source; I have not 
reproduced your Kubernetes deployment.

---
Drafted-by: Codex (GPT-6) (no human review before posting)

GitHub link: 
https://github.com/apache/airflow/discussions/61669#discussioncomment-19428821

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to