feat: As a user, I want to store basic auth credentials in hashed form, to not leak them to authorized admins
Los mantenedores suelen responder en 2 días
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
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- lua
- Área
- authentication, security
Línea de trabajo
Comienza por plugins/basic-auth.lua cerca de la línea referenciada 151 y sigue cómo se guardan y comprueban las credenciales del consumidor; el issue indica que no se identificó la ruta de guardado. Compara la configuración propuesta de hashed_password y hash con el comportamiento existente de basic-auth y key-auth, y después define pruebas que cubran el almacenamiento de credenciales y la autenticación. El trabajo debe incluir un diseño de hashing acordado, un comportamiento de configuración compatible y QA para ambos tipos de credenciales.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
As a User, I want to store basic auth credentials in a hashed way, to not leak credentials to other admin users.
Hi, we are manaiging APISIX with a team of people using the apisix-dashboard.
There is a different set of users that have authenticated access to some APIs exposed via APISIX (not the admin API). We use consumers and a combination of basic-auth and restrict-consumers-plugins to restrict access. We have noticed, that all basic-auth credentials of consumers are stored in a readable format for admins (i.e. if you go to consumers -> <consumer> -> credentials -> <basic-auth-credential>, you can see the plain password for this user.
This allows for trivial impersonation of people and API access for admin users. Thus, I would like to see at least the option to store basic-auth passwords in a hashed way. Sane defaults would be to use SHA512 or bcrypt (depending on which algorithms are supported by lua), with a defined salt, e.g. SHA512(USERNAME.PASSWORD).
The same is true for key-auth API keys.
I am open to help with both code fragments, testing and QA, although I am not very familiar with lua.
The schema for configuration would be something like:
# user config
{
"username": "testuser",
"plugins": {
"basic-auth": {
"username": "my-basic-credential", # existing
"password": "my-password", # existing
"hashed_password": "<hash>", # mutually exclusive to password, allows outside hashing
"hash": "sha512" # sane default, future-proofing if algorithm needs to be changed
}
}
}
Regarding implementation, there need to be 2 sections:
- saving new credentials - didn't find that in a quick search. There needs to be some logic for differentation between
passwordandhashed_passwordparameter - checking the credentials (pseudocode,
plugins/basic-auth.lua:151)
# snippet of basic-auth.lua
# import library
local hash = require("lua-hash")
...
# within find_consumer(ctx), before line 151
if cur_consumer.auth_conf.hash != "" then
local password_to_check = hash.oneshot(cur_consumer.auth_conf.hash, username .. password)
else
local password_to_check = password
fi
if cur_consumer.auth_conf.password ~= password_to_check then
Please let me know what you think of the idea. Let me know if you need any more information; as I said, I can contribute code as well, but I will need some pointers in regards to boilerplate (requirements, tests, ...) that need to be implented.
- Lenguaje dominante
- Lua
- Estrellas
- 17.3k
- Forks
- 3k
- Merge medio
- 4 d 16 h
- PR fusionados (30 d)
- 69
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 apache/apisix
-
bug: an admin key injected with ${{VAR}} that contains only digits becomes a number, so the correct key gets 401Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
bug(body-transformer): runtime crash when request or response body is a JSON primitivePosiblemente ocupada @bhuvan-somisetty la tomó hace 5 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días
-
bug: openapi-to-mcp appends a second ? to a query-suffixed path templatePosiblemente ocupada @lordcheng10 la tomó hace 5 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 2 días
-
ai-proxy forwards client `Transfer-Encoding: chunked` but sends an unchunked body (upstream 400)Posiblemente ocupada @locker95 la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
As a user, I want the opa plugin to propagate trace context (traceparent) to OPA, so that OPA spans are linked to the APISIX request tracePosiblemente ocupada @GitNimay la tomó hace 20 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/apisix#14051 · 3 comentarios ·
Los mantenedores suelen responder en 2 días
Todos los issues de apache/apisix
Issues similares
-
Dustwallow soothing spices stepAbiertobug discord guide:04-dustwallow-marsh locale:enUS lua-error triage v0.3.6
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
NaixGames/Polycosmos#79 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
google/executor.nvim#46 ·
-
Hide undiscovered areaAbiertoforever from-game
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
openmap-world/openmap#96 ·
Los mantenedores suelen responder en 1 día