The package mirror's address reaches every app, so a token in it leaks

Abierto
#96 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go, kubernetes

Línea de trabajo

Start with validMirrorURL in internal/config/config.go and trace how the mirror address reaches internal/pixienv/pixienv.go and the config written in internal/cli/podcmd/runner.go. Then review the proposed auth Secret and install-step mount design, along with the mirror documentation; done means credentials stay out of the app environment and readable config, with tests covering rejected query strings and fragments.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

The package mirror's address still reaches every user's app, so a secret written into it leaks.

validMirrorURL refuses a user name or password, but a token anywhere else in the address passes, for example https://mirror.example.com/conda-forge?token=SECRET, https://mirror.example.com/t/SECRET/conda-forge (conda's own token form) or https://mirror.example.com/conda-forge#SECRET:
https://github.com/nebari-dev/tapas/blob/cc65f01120dbcf3efc76386b18a0ecc07e20cc93/internal/config/config.go#L1278-L1280

The full address is then put in the app container's environment as TAPAS_PIXI_MIRROR, which the person's own code can read:
https://github.com/nebari-dev/tapas/blob/cc65f01120dbcf3efc76386b18a0ecc07e20cc93/internal/pixienv/pixienv.go#L394-L396

and in /etc/pixi/config.toml, written world-readable (0644) and mounted into the app:
https://github.com/nebari-dev/tapas/blob/cc65f01120dbcf3efc76386b18a0ecc07e20cc93/internal/cli/podcmd/runner.go#L113

Reproduced on a local cluster with a user name and password before that check existed: inside the app, echo $TAPAS_PIXI_MIRROR printed the password.

Proposed fix: keep the mirror's address public and its credentials apart.

  • Refuse a query string and a fragment in the address, as a user name or password is refused now. A token in the path cannot be detected, so the docs say the address must hold no secret.
  • Credentials in a Secret named by a new setting (for example environments.mirror.authSecret): pixi's auth file, mounted read-only (0400) in the install step only, never in the app.
  • Keep TAPAS_PIXI_MIRROR out of the app container; the install step can keep it. /etc/pixi/config.toml can stay readable once it holds only the public address.
  • Document mirrors that need a login, and that a person's own pixi add in the app does not get the mirror's credentials.

Follow-up from #63 and #65.

Lenguaje dominante
Go
Estrellas
5
Forks
0
Merge medio
21 h 13 min
PR fusionados (30 d)
53

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nebari-dev/tapas

Todos los issues de nebari-dev/tapas

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.