Kerberos credential delegation: allowDelegation() and CLI --allow-delegate (winrs -allowdelegate)
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- java
- Área
- authentication, cli, documentation, testing
Línea de trabajo
Empieza leyendo KerberosAuthScheme y la validación del constructor del cliente; después, sigue el análisis de las opciones de CLI y las páginas del manual de Authentication y CLI. Verifica la configuración de delegación y el rechazo de autenticación no basada en Kerberos con pruebas unitarias, y completa los requisitos previos documentados y la validación en vivo contra el host AD interno.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
winrs parity:
-a[llow]d[elegate]— let the remote shell use the user's credentials to reach a further hop (a share on a third machine, a database, ...). Without delegation, anything the remote command does with the user's identity over the network fails with access denied (the classic double-hop problem).
Context
winrs implements this with CredSSP or Kerberos delegation. For this client:
- Kerberos (in scope): the JDK GSS-API supports delegation natively —
GSSContext.requestCredDeleg(true)on the contextKerberosAuthSchemealready creates. The TGT must be forwardable (forwardable = trueinkrb5.conf, or a forwardable ticket in the ticket cache), and the target service must be trusted for delegation in AD (OK-AS-DELEGATE; for constrained delegation the KDC decides). All pure JDK, zero new dependencies. - CredSSP (out of scope): NTLM-based delegation requires implementing CredSSP (TLS channel + SPNEGO inside TSRequest ASN.1 structures + credential submission). That is a whole new authentication protocol and a significant security surface; explicitly not part of this issue — file separately if ever needed.
Proposed API
try (WinRMClient client = WinRMClient.builder("server.example.net")
.https()
.authentication(AuthScheme.KERBEROS)
.allowDelegation() // connection-scoped, Kerberos only
.credentials("DOMAIN\user", password)
.build()) {
client.command("dir \\fileserver\share").execute();
}
- Builder-level (delegation is a property of the authentication, not of one command).
build()rejectsallowDelegation()when Kerberos is not among the requested schemes — silently ignoring it would give a false sense of security posture.- When the KDC does not grant a forwardable/delegable ticket, GSS reports it — surface a clear message (this is the number-one support question with delegation).
CLI
winrm-java -h server -u 'DOMAIN\user' -pf pw.txt \
--https --kerberos --allow-delegate \
exec 'dir \fileserver\share'
Usage error when --allow-delegate is given without --kerberos.
Acceptance criteria
requestCredDeleg(true)set on the GSS context iff delegation was requested; unit-testable at theKerberosAuthSchemelevel.- Configuration rejections (NTLM-only + delegation) at
build()/ CLI parse time with actionable messages. - Live validation against a real AD host with
OK-AS-DELEGATE(see the internal test host) — the FakeWsmanServer speaks NTLM only, so delegation is covered by unit + live tests. - Documented on the Authentication page (including the krb5.conf
forwardableand AD trust prerequisites) and in the CLI manual.
🤖 Generated with Claude Code
- Lenguaje dominante
- Java
- Estrellas
- 11
- Forks
- 4
- Merge medio
- 5 d 5 h
- PR fusionados (30 d)
- 6
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MetricsHub/winrm-java
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
MetricsHub/winrm-java#148 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
MetricsHub/winrm-java#147 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
MetricsHub/winrm-java#146 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
MetricsHub/winrm-java#145 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
MetricsHub/winrm-java#139 ·
Todos los issues de MetricsHub/winrm-java
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
opensearch-project/k-NN#3597 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100