Securely pass a Coder session token to the (System) Network Extension
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Refactoring
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- macos, swift
- Bereich
- desktop, operating-systems, security
Rechercherichtung
Beginne damit, den im Issue beschriebenen Pfad NETunnelProviderProtocol.providerConfiguration und den Einstiegspunkt NEPacketTunnelProvider.startTunnel nachzuverfolgen. Prüfe die Keychain- und XPC-Alternativen und definiere dann den Abschluss als die sichere Übermittlung des Session-Tokens, ohne ihn in providerConfiguration zu speichern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Swift
- Sterne
- 29
- Forks
- 9
- Ø Merge
- 1 T. 17 Std.
- Gemergte PRs (30 T.)
- 5
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus coder/coder-desktop-macos
-
Authentication fails with invalid TLS certificate error on self-hosted Coder deployment (macOS)Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
coder/coder-desktop-macos#285 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
coder/coder-desktop-macos#230 · 2 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
coder/coder-desktop-macos#221 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 48/100
coder/coder-desktop-macos#220 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
coder/coder-desktop-macos#212 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in coder/coder-desktop-macos
Ähnliche Issues
-
🎉 Add GinkgoEvtl. vergeben @usual2970 hat das heute übernommen. Offenaddition
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 76/100
jaywcjlove/awesome-mac#4442 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
DeveloperAcademy-POSTECH/2026-C6-A03-KIIKICK-iOS#76 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[java] TestClassWithoutTestCases: document that abstract classes and interfaces are not checkedOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 91/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
VictorKildahl/cra#302 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag