Skip to content

Commit 30f4b49

Browse files
feat(opensearch): flip the credential plan to oidc-jwt (Phase-D cutover LIVE)
The cluster side is done on the fleet: the OpenSearch security plugin is ENABLED and now returns 401 to unauthenticated callers, validating Keycloak JWTs natively (jwt auth domain, required_audience offgrid-opensearch, the service account mapped to all_access). Demo-box choice: the REST layer stays PLAIN HTTP (plugins.security.ssl.http.enabled=false) so the console keeps http://127.0.0.1:9200 over loopback and only adds a Bearer — no demo-cert trust problem, which was the blocker that had this parked. Flipping this one line makes every OpenSearch call authenticate, because they all route through lib/opensearch-http.ts now (previous commit). Tests updated: the opensearch plan is asserted as oidc-jwt with baoPath opensearch/client-secret; marquez/opa/presidio still assert none (they cannot verify a KC JWT).
1 parent 3b96b6a commit 30f4b49

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

src/lib/service-credentials-lib.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,14 @@ const PLAN_MODES: Record<string, CredentialMode> = {
8686
// SeaweedFS S3 IAM is access/secret keys (SigV4) — no OIDC.
8787
seaweedfs: 's3',
8888
s3: 's3',
89-
// No-auth images on the trusted LAN today. TODO(Phase-D): OpenSearch can enable its security plugin
90-
// with native OIDC/JWT → flip to 'oidc-jwt' + a KC client; Marquez/OPA/Presidio stay edge-gated
91-
// (Caddy forward_auth) or move behind a console proxy — none of them validate a KC JWT today, so
92-
// they MUST remain 'none' until that lands or we'd send a credential they can't verify.
93-
opensearch: 'none',
89+
// Phase-D DONE for OpenSearch (2026-07-25): its security plugin is ENABLED on the fleet and it
90+
// validates Keycloak JWTs natively (jwt auth domain, required_audience offgrid-opensearch, the
91+
// service account mapped to all_access). The REST layer deliberately stays plain HTTP on this
92+
// deployment, so the console sends a Bearer over loopback — no demo-cert trust problem. Every
93+
// OpenSearch call routes through lib/opensearch-http.ts, which reads this plan.
94+
opensearch: 'oidc-jwt',
95+
// Marquez/OPA/Presidio stay edge-gated (Caddy forward_auth) or behind a console proxy — none of them
96+
// validate a KC JWT today, so they MUST remain 'none' or we'd send a credential they can't verify.
9497
marquez: 'none',
9598
opa: 'none',
9699
presidio: 'none',

test/service-credentials-lib.test.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,17 @@ test('credentialPlan: seaweedfs/s3 are s3 (SigV4 access/secret keys)', () => {
6464
assert.deepEqual(credentialPlan('s3'), { mode: 's3', baoPath: 's3/s3-access-key' });
6565
});
6666

67-
test('credentialPlan: no-auth images (opensearch/marquez/opa/presidio) are none', () => {
68-
for (const svc of ['opensearch', 'marquez', 'opa', 'presidio']) {
67+
test('credentialPlan: opensearch is oidc-jwt (Phase-D cutover — its security plugin validates KC JWTs)', () => {
68+
assert.deepEqual(credentialPlan('opensearch'), {
69+
mode: 'oidc-jwt',
70+
baoPath: 'opensearch/client-secret',
71+
});
72+
});
73+
74+
test('credentialPlan: the remaining no-auth images (marquez/opa/presidio) stay none', () => {
75+
// These are edge-gated (Caddy forward_auth) / proxied — none validate a KC JWT, so sending one
76+
// would be a credential they cannot verify.
77+
for (const svc of ['marquez', 'opa', 'presidio']) {
6978
assert.deepEqual(credentialPlan(svc), { mode: 'none' }, svc);
7079
}
7180
});

0 commit comments

Comments
 (0)