kbs: add insecure options for admin/attestation token verification - #1360
kbs: add insecure options for admin/attestation token verification#1360Xynnn007 wants to merge 3 commits into
Conversation
bf46a74 to
c5242ec
Compare
c5242ec to
1c37635
Compare
|
Added another commit for |
0272aa6 to
bfd1b34
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds configuration switches to relax JWT verification behavior in KBS for development scenarios, including optionally allowing plaintext http:// key sources and optionally skipping endorsement checks for header-embedded JWKs (admin tokens).
Changes:
- Add
insecure_public_key_from_urito attestation token verifier config and plumb it intoJwtVerifier. - Extend
JwtVerifier/JWK fetching to support conditionalhttp://for JWKS/OpenID discovery and PEM public keys. - Add admin (
bearer_jwt) config flags for insecure key loading and skipping header-JWK endorsement checks, plus docs/tests updates.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| kbs/src/token/mod.rs | Adds attestation token config flag and passes it into JwtVerifier. |
| kbs/src/crypto/jwt.rs | Extends verifier construction to thread through the new “allow insecure HTTP” flag for JWKS/PEM loading. |
| kbs/src/crypto/jwk.rs | Updates JWKS loading API to accept the new flag and logs a warning when using HTTP. |
| kbs/src/config.rs | Updates config test fixtures to include the new attestation token field. |
| kbs/src/attestation/intel_trust_authority/mod.rs | Updates JwtVerifier::new call site to include the new parameter. |
| kbs/src/admin/authentication/bearer_jwt.rs | Adds admin auth config flags and tests; wires flags into JwtVerifier::new. |
| kbs/docs/config.md | Documents new attestation/admin configuration options. |
| kbs/docs/admin.md | Documents new bearer_jwt options and supported source formats. |
| integration-tests/src/common.rs | Updates integration test harness config to include the new field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bfd1b34 to
54e96a5
Compare
|
My opinion on this PR has not changed. It's an "expensive" developer feature to be added to the config especially when there's no real blockers that justify these changes. |
Cannot agree with the point. It's disabled by default and requires explicit user enablement. Just like KBS currently supports both HTTP and HTTPS startup. In many enterprise environments and development/testing scenarios, where users cannot provide a CA, this can be very helpful. You mentioned using configmaps for configuration, but this requires users to manually update the jwk set instead of automatically fetching updates. It's important to understand that introducing manual updates is very cumbersome. |
0e9230b to
a047e9d
Compare
What was done in the past does not necessarily mean it needs to be followed.
This PR has changed from admin only topic to something else. My comments have been related to that admin http jwkset part only. How likely it is that these jwksets need to be updated regularly during testing? Can we keep the two separate PRs so that one topic does not block the other. |
Not just testing, but inner deployments I get attestation-token things into #1434. About admin part, I believe this follows the industry-standard secure-by-default pattern: Redis Completely blocking the path is not what we want; a better approach is to provide a door that users can choose to open or close. |
a047e9d to
7a0258f
Compare
|
Yeah fwiw I am fine with adding this. We should be careful with adding insecure options, but I think this one is reasonable. This is quite a niche use case, but if you're trying to setup a demo or test that uses an IDP, you probably are not going to have HTTP setup. You could always specify the keys directly in this case, but that changes the flow a bit. |
Add insecure_public_key_uri to bearer_jwt and gate plaintext HTTP when loading admin PEM keys and remote JWKS sources. Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Wire insecure_public_key_uri through [attestation_token] so trusted_jwk_sets can be loaded over plaintext HTTP in controlled environments. Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Add insecure_header_jwk to bearer_jwt to control whether header-embedded JWK keys must be endorsed via x5c before verifying admin JWT signatures. Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com> Co-authored-by: Cursor <cursoragent@cursor.com>
7a0258f to
d423a16
Compare
This patch adds three switches of insecure options for admin/attestation token verification
jwkfield's endorsement check for Admin TokenThese are useful in dev cases.
Relies on #1239