Skip to content

Commit a30c479

Browse files
authored
fix: Use service scope for user-info-fetcher AD kerberos keytab (#698)
* Use service scope for user-info-fetcher AD kerberos keytab Fixes #680 * Add ad-user-info test suite that I apparently forgot to commit before Disabled for now, since it still requires some manual setup, but at least it's a starting point... * Changelog * Ignore RUSTSEC-2025-0012 for now * Update ring to satisfy cargo deny * Don't use a podoverride for testing the service scope * Formatting
1 parent 26e3c48 commit a30c479

17 files changed

+270
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file.
1919

2020
- Bump `stackable-operator` to 0.87.0 and `stackable-versioned` to 0.6.0 ([#696]).
2121
- Default to OCI for image metadata and product image selection ([#671]).
22+
- Active Directory backend for user-info-fetcher now uses the `service={opacluster}` scope rather than `pod,node` ([#698]).
2223

2324
[#666]: https://github.com/stackabletech/opa-operator/pull/666
2425
[#671]: https://github.com/stackabletech/opa-operator/pull/671
@@ -27,6 +28,7 @@ All notable changes to this project will be documented in this file.
2728
[#687]: https://github.com/stackabletech/opa-operator/pull/687
2829
[#693]: https://github.com/stackabletech/opa-operator/pull/693
2930
[#696]: https://github.com/stackabletech/opa-operator/pull/696
31+
[#698]: https://github.com/stackabletech/opa-operator/pull/698
3032

3133
## [24.11.1] - 2025-01-10
3234

Cargo.lock

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

Cargo.nix

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

deny.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ ignore = [
2929
#
3030
# TODO: Remove after https://github.com/kube-rs/kube/pull/1652 is merged
3131
"RUSTSEC-2024-0384",
32+
33+
# https://rustsec.org/advisories/RUSTSEC-2025-0012
34+
# "backoff" is unmainted.
35+
#
36+
# Upstream (kube) has switched to backon in 0.99.0, and an upgrade is scheduled on our end. In the meantime,
37+
# this is a very low-severity problem.
38+
#
39+
# TODO: Remove after upgrading to kube 0.99.
40+
"RUSTSEC-2025-0012",
3241
]
3342

3443
[bans]

rust/operator-binary/src/controller.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,7 @@ fn build_server_rolegroup_daemonset(
747747
user_info_fetcher_image: &str,
748748
service_account: &ServiceAccount,
749749
) -> Result<DaemonSet> {
750+
let opa_name = opa.metadata.name.as_deref().context(NoNameSnafu)?;
750751
let role = opa.role(opa_role);
751752
let role_group = opa
752753
.rolegroup(rolegroup_ref)
@@ -979,9 +980,9 @@ fn build_server_rolegroup_daemonset(
979980
SecretClassVolume::new(
980981
ad.kerberos_secret_class_name.clone(),
981982
Some(SecretClassVolumeScope {
982-
pod: true,
983-
node: true,
984-
services: Vec::new(),
983+
pod: false,
984+
node: false,
985+
services: vec![opa_name.to_string()],
985986
listener_volumes: Vec::new(),
986987
}),
987988
)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
apiVersion: v1
3+
kind: LimitRange
4+
metadata:
5+
name: limit-request-ratio
6+
spec:
7+
limits:
8+
- type: "Container"
9+
maxLimitRequestRatio:
10+
cpu: 5
11+
memory: 1
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% if test_scenario['values']['openshift'] == 'true' %}
2+
# see https://github.com/stackabletech/issues/issues/566
3+
---
4+
apiVersion: kuttl.dev/v1beta1
5+
kind: TestStep
6+
commands:
7+
- script: kubectl patch namespace $NAMESPACE -p '{"metadata":{"labels":{"pod-security.kubernetes.io/enforce":"privileged"}}}'
8+
timeout: 120
9+
{% endif %}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
5+
---
6+
apiVersion: v1
7+
kind: ConfigMap
8+
metadata:
9+
name: vector-aggregator-discovery
10+
{% endif %}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
2+
---
3+
apiVersion: v1
4+
kind: ConfigMap
5+
metadata:
6+
name: vector-aggregator-discovery
7+
data:
8+
ADDRESS: {{ lookup('env', 'VECTOR_AGGREGATOR') }}
9+
{% endif %}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
metadata:
5+
name: install-opa
6+
timeout: 300
7+
commands:
8+
- script: kubectl -n $NAMESPACE wait --for=condition=available opaclusters.opa.stackable.tech/test-opa --timeout 301s

0 commit comments

Comments
 (0)