Securely pass a Coder session token to the (System) Network Extension
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- macos, swift
- Lĩnh vực
- desktop, operating-systems, security
Hướng nghiên cứu
Bắt đầu bằng cách lần theo đường đi NETunnelProviderProtocol.providerConfiguration và điểm vào NEPacketTunnelProvider.startTunnel được mô tả trong issue. Xem xét các phương án thay thế Keychain và XPC, sau đó xác định việc hoàn thành là chuyển token phiên một cách an toàn mà không lưu trữ nó trong providerConfiguration.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The Network Extension requires a session token for a Coder deployment in order to function. This is (and should be) stored in the macOS Keychain.
When registering the network extension as a system VPN, a NETunnelProviderProtocol can be configured and passed to the network extension when it's started (via NEPacketTunnelProvider.startTunnel). NETunnelProviderProtocol.serverAddress allows us to pass the access URL of the deployment.
NETunnelProviderProtocol.passwordReference is described as:
a persistent reference to a keychain item with the kSecClassGenericPassword class.
This field doesn't take into account the fact that the Network Extension might be a System Extension (as opposed to an app extension, used when submitting the application to the macOS/iOS App Store).
For reference, the WireGuard macOS app uses an app extension, running as the user, not root. It's able to pass a keychain reference to that app extension after modifying the item's keychain ACL.
In our case, there's a few problems:
- Whilst Keychain Access Groups exist to share keychain items between multiple sandboxed applications, they require all apps use the data protection keychain (as opposed to the file-based keychain).
Programs that run outside of the user context (such as our NE, running as root), cannot use the data protection keychain. [1] [2] - File-based keychains are accessible from both users and the network-extensions. However, the sandboxed application is only capable of writing to the user keychain, and the network extension is only capable of reading from the system keychain. The application would need elevated permissions to write to the system keychain, and use
passwordReferenceto pass a keychainpersistentRef. [3] [4]
The dev forum solution appears to be to send the credentials over some IPC, which would definitely be XPC in our case ([3], [4]). However, sending the session token over XPC in our case might lead to an annoying implementation: when the VPN is started it first must wait for yet another message containing the session token.
Instead, the current (hacked) solution involves just storing the session token within the NETunnelProviderProtocol.providerConfiguration dictionary. I believe the only difference between this and XPC is that this configuration is written to disk. We currently store Coder CLI tokens on disk too right now, though it'd be good to improve both situations in the future.
- Ngôn ngữ chính
- Swift
- Star
- 29
- Fork
- 9
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không 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 coder/coder-desktop-macos
-
Authentication fails with invalid TLS certificate error on self-hosted Coder deployment (macOS)Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
coder/coder-desktop-macos#285 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
coder/coder-desktop-macos#230 · 2 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
coder/coder-desktop-macos#221 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 48/100
coder/coder-desktop-macos#220 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
coder/coder-desktop-macos#212 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của coder/coder-desktop-macos
Issue tương tự
-
area:shell order:5 status:ready type:bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
krystianslowik/arkt#899 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
help wanted roadmap tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
🐞 bug 💠 component 🔍 triage v4 🧰 library
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Orange-OpenSource/ouds-ios#1875 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
521xueweihan/HelloGitHub#4295 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100