[Server] Derive the public key from private_key.der on the deprecated key-folder path
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 62/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- java
- Lĩnh vực
- authentication, security
Hướng nghiên cứu
Bắt đầu từ server/src/main/java/io/unitycatalog/server/security/SecurityConfiguration.java, trong constructor SecurityConfiguration(Path configurationFolder), khoảng dòng 70-76, nơi public_key.der được đọc riêng, và so sánh với publicKeyOf ở dòng 128, được dùng trên đường dẫn tệp khóa. Chạy SecurityConfigurationTest sau khi thêm một trường hợp có public_key.der không khớp. Hoàn thành khi một token được ký bởi cấu hình xác minh thành công và public_key.der vẫn được ghi khi sinh khóa.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
When server.token-signing-private-key-file is not set, the server signs its tokens with the key it keeps in etc/conf (deprecated since #2081). On that path it reads the private key from private_key.der and the public key from public_key.der as two separate files (SecurityConfiguration.java:70-76). Nothing checks that they are one pair. If they don't match (for example, one file was replaced by hand), the server starts and logs nothing, but every token it signs fails its own check, so internal tokens get a 401.
The key-file path does not have this problem: it derives the public key from the private key (publicKeyOf, line 128).
This predates #2081 (the folder path read the two files separately before it too), and it fails closed. It was raised in the review of #2081 (https://github.com/unitycatalog/unitycatalog/pull/2081#issuecomment-7123860110).
To reproduce, put a private_key.der and a public_key.der from two different openssl genrsa keys in a folder, build new SecurityConfiguration(folder), sign a token with algorithmRSA() and verify it with the same algorithm: verification fails with SignatureVerificationException.
Describe the solution you would like
- In
SecurityConfiguration(Path configurationFolder), derive the public key fromprivate_key.derwithpublicKeyOf, as the key-file path does, instead of readingpublic_key.der. - Keep writing
public_key.derwhen the server generates a key, so a rollback to an earlier release, which reads that file, still works. - Add a row or step to the existing
SecurityConfigurationTest: with a mismatchedpublic_key.der, a token signed by the configuration verifies with it.
Additional context
Smaller follow-ups from the same review, fine to take here or separately:
docs/server/configuration.md,server.token-signing-private-key-file: say that a relative path resolves against the server's working directory, and that the file must exist even with authorization off.- No minimum key size: a 512-bit key loads and then fails when the service token is signed, with a message that does not name the file. This also predates #2081.
- A key file path that points to a directory fails with
Is a directoryand no path (Files.readAllBytes, line 213); the missing, empty and encrypted cases name the file. JwksOperations: the branch for a nullSecurityContextexists only forJwksOperationsTest.- A server-level test that a token signed with another key gets HTTP 401 (today
AuthDecoratorTestchecks the exception, andAuthServiceTestchecks 401 for an expired token). writeOwnerOnly(line 160) deletes, creates, then writes the key, which is not atomic: a crash in between leaves an emptyprivate_key.der, and the next start fails until it is removed.
- Ngôn ngữ chính
- Java
- Star
- 3.6k
- Fork
- 706
- Merge trung bình
- 3 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 135
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của unitycatalog/unitycatalog
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
unitycatalog/unitycatalog#2280 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
unitycatalog/unitycatalog#2277 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[CI] Submit the sbt dependency graph so Dependabot alerts cover the server's Java dependenciesCó thể đã có người làm @iam-hk đã nhận 7 ngày trước. Đang mởenhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
unitycatalog/unitycatalog#2255 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Python] Timedelta parameter defaults are rendered unquoted in generated function SQLCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
unitycatalog/unitycatalog#2148 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
unitycatalog/unitycatalog#2074 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của unitycatalog/unitycatalog
Issue tương tự
-
hermes-queue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
chrisalunlloyd2-sudo/mindpalace#430 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: editor P3 type: feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
halisonworks/mod-codeling#290 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
CVE-2026-63402 i18nextĐang mởarea/dependencies area/dependencies/js backport/26.6 backport/26.8 kind/cve severity/medium source/scan-dependencies status/triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 2 ngày