Skip to content

Commit d87f005

Browse files
authored
chore: Use internal secret for JWT key (#686)
* chore: Use internal secret for JWT token * remove connections.secretKey references, changelog, env-var comments * cleaned up comments * review feedback: refactoring * replace openssl with rand crate * use rand crate for generating keys * corrected error text
1 parent f7c50ac commit d87f005

30 files changed

+195
-43
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
- Added a note on webserver workers to the trouble-shooting section ([#685]).
1010
- Helm: Allow Pod `priorityClassName` to be configured ([#687]).
1111

12+
### Changed
13+
14+
- Use internal secrets for secret- and jwt-keys ([#686]).
15+
1216
### Fixed
1317

1418
- Don't panic on invalid authorization config. Previously, a missing OPA ConfigMap would crash the operator ([#667]).
@@ -25,6 +29,7 @@
2529
[#679]: https://github.com/stackabletech/airflow-operator/pull/679
2630
[#683]: https://github.com/stackabletech/airflow-operator/pull/683
2731
[#685]: https://github.com/stackabletech/airflow-operator/pull/685
32+
[#686]: https://github.com/stackabletech/airflow-operator/pull/686
2833
[#687]: https://github.com/stackabletech/airflow-operator/pull/687
2934

3035
## [25.7.0] - 2025-07-23

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.nix

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ product-config = { git = "https://github.com/stackabletech/product-config.git",
1414
stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", features = ["telemetry", "versioned"], tag = "stackable-operator-0.95.0" }
1515

1616
anyhow = "1.0"
17+
base64 = "0.22"
1718
built = { version = "0.8", features = ["chrono", "git2"] }
1819
clap = "4.5"
1920
const_format = "0.2"
2021
fnv = "1.0"
2122
futures = { version = "0.3", features = ["compat"] }
2223
indoc = "2.0"
24+
rand = "0.9.0"
2325
rstest = "0.26"
2426
semver = "1.0"
2527
serde = { version = "1.0", features = ["derive"] }

docs/modules/airflow/examples/example-airflow-secret.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ stringData:
1010
adminUser.lastname: Admin
1111
adminUser.email: airflow@airflow.com
1212
adminUser.password: airflow
13-
connections.secretKey: thisISaSECRET_1234
1413
connections.sqlalchemyDatabaseUri: postgresql+psycopg2://airflow:airflow@airflow-postgresql.default.svc.cluster.local/airflow
1514
# Only needed when using celery workers (instead of Kubernetes executors)
1615
connections.celeryResultBackend: db+postgresql://airflow:airflow@airflow-postgresql.default.svc.cluster.local/airflow

docs/modules/airflow/examples/getting_started/code/airflow-credentials.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ stringData:
1010
adminUser.lastname: Admin
1111
adminUser.email: airflow@airflow.com
1212
adminUser.password: airflow
13-
connections.secretKey: thisISaSECRET_1234
1413
connections.sqlalchemyDatabaseUri: postgresql+psycopg2://airflow:airflow@airflow-postgresql.default.svc.cluster.local/airflow
1514
# Only needed when using celery workers (instead of Kubernetes executors)
1615
connections.celeryResultBackend: db+postgresql://airflow:airflow@airflow-postgresql.default.svc.cluster.local/airflow

docs/modules/airflow/pages/getting_started/first_steps.adoc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ And apply it:
2323
[source,bash]
2424
include::example$getting_started/code/getting_started.sh[tag=apply-airflow-credentials]
2525

26-
The `connections.secretKey` is used for securely signing the session cookies and can be used for any other security related needs by extensions.
27-
It should be a long random string of bytes.
28-
2926
`connections.sqlalchemyDatabaseUri` must contain the connection string to the SQL database storing the Airflow metadata.
3027

3128
`connections.celeryResultBackend` must contain the connection string to the SQL database storing the job metadata (the example above uses the same PostgreSQL database for both).

examples/simple-airflow-cluster-dags-cmap.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ stringData:
1010
adminUser.lastname: Admin
1111
adminUser.email: airflow@airflow.com
1212
adminUser.password: airflow
13-
connections.secretKey: thisISaSECRET_1234
1413
connections.sqlalchemyDatabaseUri: postgresql+psycopg2://airflow:airflow@airflow-postgresql.default.svc.cluster.local/airflow
1514
# Only needed when using celery workers (instead of Kubernetes executors)
1615
connections.celeryResultBackend: db+postgresql://airflow:airflow@airflow-postgresql.default.svc.cluster.local/airflow

examples/simple-airflow-cluster-ldap-insecure-tls.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ stringData:
138138
adminUser.lastname: Admin
139139
adminUser.email: airflow@airflow.com
140140
adminUser.password: airflow
141-
connections.secretKey: thisISaSECRET_1234
142141
connections.sqlalchemyDatabaseUri: postgresql+psycopg2://airflow:airflow@airflow-postgresql.default.svc.cluster.local/airflow
143142
# Only needed when using celery workers (instead of Kubernetes executors)
144143
connections.celeryResultBackend: db+postgresql://airflow:airflow@airflow-postgresql.default.svc.cluster.local/airflow

examples/simple-airflow-cluster-ldap.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ stringData:
136136
adminUser.lastname: Admin
137137
adminUser.email: airflow@airflow.com
138138
adminUser.password: airflow
139-
connections.secretKey: thisISaSECRET_1234
140139
connections.sqlalchemyDatabaseUri: postgresql+psycopg2://airflow:airflow@airflow-postgresql.default.svc.cluster.local/airflow
141140
# Only needed when using celery workers (instead of Kubernetes executors)
142141
connections.celeryResultBackend: db+postgresql://airflow:airflow@airflow-postgresql.default.svc.cluster.local/airflow

0 commit comments

Comments
 (0)