grpc / grpc/grpc-java

Add LocalChannelCredentials and LocalServerCredentials, with UDS support

Offen
#9,900 13 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

enhancement
Vorherrschende Sprache
Java
Sterne
12.1k
Forks
4k
Ø Merge
2 T. 17 Std.
Gemergte PRs (30 T.)
37

Beschreibung

Using version gRPC 1.52.1

When looking at the transport attributes, from a ServerInterceptor, on a Netty Server, with a KQueue (or Epoll) channel, I see the following:

```
{io.grpc.internal.GrpcAttributes.securityLevel=NONE, io.grpc.Grpc.TRANSPORT_ATTR_REMOTE_ADDR=null, io.grpc.Grpc.TRANSPORT_ATTR_LOCAL_ADDR=null}
```

This issue is actually two related requests:

1. When using a domain socket with KQueue or Epoll, the security level should be `PRIVACY_AND_INTEGRITY`. I don't believe it is possible to snoop on the data going back and forth without root privileges. There doesn't appear to be a lot of information about how these values should be interpreted. For context, I am calling my gRPC Java server from the `grpc_cli` tool, which treats UDS channels as a credentialed connection.

2. The remote and local addresses should be set from the _parent_ socket for domain. Unlike regular Inet sockets, Netty doesn't set the address on the child channel for domain sockets on the server side. Netty only sets the addresses on `bind` and `connect` calls, which don't happen on the server side (the corresponding Epoll Socket channels, and Nio Socket Channels set the values more eagerly). Arguably this is a Netty bug, but it would be reasonable to work around this on the gRPC side.

One other passing thought: Connections over the loopback adapter for Inet sockets could also be reasonably treated as secure as well. gRPC C-core treats connections where both sides are loopback as special, which is nice. However, unlike domain sockets, they aren't "authenticated" IMO, which is mentioned in the docs for `SecurityLevel`.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit nachzuverfolgen, wie ein Netty Server Transportattribute für KQueue- und Epoll-Kanäle an ServerInterceptor weitergibt, und überprüfe anschließend die vorhandene Behandlung von SecurityLevel und Anmeldedaten für Unix domain sockets. Überprüfe das Verhalten mit einem gRPC Java-Server und dem Tool grpc_cli. Als erledigt gilt die Aufgabe, wenn lokale und entfernte Adressen aus dem übergeordneten Socket stammen und Verbindungen über Unix domain sockets die angeforderten Anmeldedaten und die Sicherheitsstufe offenlegen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java
Bereich
networking
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.