Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix: distrust compromised eMudhra roots (ovcs backport) - #4695

Draft
vic3lord wants to merge 3 commits into
ovcsfrom
fix/meta-14445/ovcs
Draft

vic3lord wants to merge 3 commits into
ovcsfrom
fix/meta-14445/ovcs

Conversation

@vic3lord

@vic3lord vic3lord commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Parent issue: https://github.com/sequentech/meta/issues/14445

Problem

ovcs trusts emSign ECC Root CA - G3, whose eMudhra intermediates have recoverable private keys, in two places: the embedded webpki-roots 1.0.4 (item 7) and the Keycloak 26.7.5 image (item 5).

Result

Not covered: the Debian images (they need a rebuild with ca-certificates 20250419~deb12u2), Hasura, and the url-truststore fail-closed change.

Validation

The same RUN block was built on this branch's pinned Keycloak digest (26.7.5) with Apple container:

Check emSign chain AAA chain github.com
PEM bundle, before ok (trusted) error 20 ok
PEM bundle, after error 20 error 20 ok
Java HttpClient, before HTTP 200 PKIX failed HTTP 200
Java HttpClient, after PKIX failed PKIX failed HTTP 200
  • The image still runs as uid 1000.
  • webpki-roots 1.0.4 source matches the root names; 1.0.12 does not.
  • cargo metadata --locked: ok.
  • Not built locally: the full Keycloak image and the Rust images.

Rollout

Merge, build images, then bump tags per environment through gitops in agreed windows.

🤖 Generated with Claude Code

vic3lord and others added 3 commits December 3, 2026 13:36
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Backport of #4449.

Refs sequentech/meta#14445

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keycloak 26.7.5 trusts emSign ECC Root CA - G3 and has no newer 26.7.x.

Refs sequentech/meta#14445

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 3, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

vic3lord added a commit that referenced this pull request Dec 3, 2026
Parent issue: sequentech/meta#14445

#4449 (crate bumps) is merged.

## Problem
Keycloak 26.6.4 trusts `emSign ECC Root CA - G3` in its PEM bundle and
JVM `cacerts`. Keycloak 26.8.2 (built 2026-11-19) no longer ships it, so
upgrading fixes item 5 without an in-image workaround.

## Result
- **Images:** `quay.io/keycloak/keycloak:26.6.4` → `26.8.2` in
`Dockerfile.keycloak` (builder and runtime), the three
`Dockerfile.keycloak-vstl-*` files and the voter-enrollment integration
test. #4449 no longer carries a Keycloak trust-store workaround, so this
PR is the fix on `main`.
- **Extensions:** compile against Keycloak 26.8.2 (`keycloak.version` in
every extension pom; beyond's extensions inherit it). Compiling against
the new API caught three changes that a version bump alone would only
have hit at runtime (`NoSuchMethodError` / `AbstractMethodError`):
1. **`action-token-login-bridge`:** `Cors.allowedOrigins(token)` is now
`checkAllowedOrigins(token)`. **Behaviour change:** a request whose
`Origin` isn't in the token's allowed origins now gets HTTP 403 instead
of a response without CORS headers. Keycloak's own admin API uses the
same call (`AdminRoot`).
2. **`conditional-authenticators`:**
`X509ClientCertificateAuthenticator` now takes `legacyCriticalBehavior`.
`X509UserResolutionAuthenticator` passes its factory's SPI setting
through (default `false`), as the built-in factory does. **Behaviour
change (upstream):** on 26.6, a Key Usage / Extended Key Usage mismatch
was only fatal when the extension was critical; on 26.8 with the
default, any mismatch rejects the certificate. This only applies where a
realm's X.509 config sets expected KU/EKU; no realm template in step
does.
`spi-authenticator--x509-user-resolution--legacy-critical-behavior=true`
restores the old behaviour if needed.
3. **`url-truststore-provider`:** `TruststoreProvider` adds
`getHttpsTruststore()`, `getHttpsRootCertificates()` and
`getHttpsIntermediateCertificates()`. 26.8's
`CertificateValidator.validateTrust()` uses these instead of the
non-HTTPS methods to validate X.509 client certificates (voter mTLS
login). The URL truststore returns its per-realm store from them, as
`FileTruststoreProvider` does when no separate HTTPS store is
configured. A `null` would fail every X.509 login closed; a different
store would trust the wrong CAs. A new unit test pins this.

## Validation
Built locally with Apple `container` from this Dockerfile, with beyond's
extensions at the pinned submodule commit (`a0ee42e`):
- **Maven reactor:** all 15 modules `SUCCESS`, including beyond's
`idp-linking-authenticator`, `beyond-keycloak-extensions` and
`smart-link-hmac-authenticator`. 369 tests pass, 0 failures
(`url-truststore-provider`: 16, including the new
`httpsTruststoreIsTheRealmTruststore`).
- **`idp-linking-authenticator`:** was still on 26.4.0 in the reactor
run above; now compiled against 26.8.2 on its own (22 tests pass). The
full image was not rebuilt after this change or after merging the cut
#4449.
- **`kc.sh build`:** succeeds with all 15 provider jars.
- **`start-dev` on Postgres:** `Keycloak 26.8.2 on JVM ... started`.
`serverinfo` lists the `url` truststore provider, `x509-user-resolution`
and `x509-cert-classifier`, and the `sequent.admin-portal` /
`sequent.voting-portal` login themes.
- **Login pages:** with internationalization enabled, both Sequent
themes render (HTTP 200, username field, 3 locales).
- **Pre-existing, not from this PR:** with internationalization
disabled, the Sequent themes return HTTP 500 because `template.ftl:329`
lists `locale.supported` with no `locale??` guard. Keycloak only sets
`locale` when i18n is on, in both 26.6.1 and 26.8.2, so 26.6 does the
same. Tracked separately.
- **Trust stores in the built image:**

| Check | emSign chain | AAA chain | github.com |
|---|---|---|---|
| `openssl s_client -CAfile` (PEM bundle) | error 20 | error 20 | ok |
| Java `HttpClient` (`cacerts`) | PKIX failed | PKIX failed | HTTP 200 |

Not tested locally: a real voter X.509 login (needs a realm with an
uploaded CA and the Envoy client-cert setup) and the login-bridge CORS
flow from the admin portal. Both should be exercised on a dev tenant
before rollout.

## Rollout
1. Merge this PR.
2. Deploy to a dev tenant. Check voter X.509 login on a realm with a CA,
admin-portal flows that use the login bridge, and the login pages in
each language.
3. Then follow the normal per-environment tag bumps. `release/10.0`,
`release/10.1` and `ovcs` are on 26.7.5 and get an in-image workaround
instead: #4693, #4694, #4695.

🤖 Generated with [Claude Code](https://claude.com/claude-code)



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Updates**
* Upgraded the identity platform and its extensions to Keycloak 26.8.2.
* **Bug Fixes**
* Updated certificate-based authentication compatibility for the newer
Keycloak version.
  * Improved handling of allowed origins in the login bridge.
* **Improvements**
* Added HTTPS-specific truststore and certificate access, with the same
trust information as the existing truststore.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Or Elimelech <vic3lord@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant