feat: As a user, I want to store basic auth credentials in hashed form, to not leak them to authorized admins
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- lua
- Ambito
- authentication, security
Direzione di ricerca
Inizia da plugins/basic-auth.lua intorno alla riga 151 indicata e traccia il modo in cui le credenziali del consumer vengono salvate e verificate; l’issue afferma che il percorso di salvataggio non è stato identificato. Confronta la configurazione proposta hashed_password e hash con il comportamento esistente di basic-auth e key-auth, quindi definisci test che coprano l’archiviazione delle credenziali e l’autenticazione. Il lavoro deve includere un design di hashing concordato, un comportamento di configurazione compatibile e la QA per entrambi i tipi di credenziali.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Lua
- Stelle
- 17.3k
- Fork
- 3k
- Merge medio
- 4g 16h
- PR unite (30g)
- 69
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apache/apisix
-
bug: an admin key injected with ${{VAR}} that contains only digits becomes a number, so the correct key gets 401Forse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
bug(body-transformer): runtime crash when request or response body is a JSON primitiveForse già presa @bhuvan-somisetty l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
bug: openapi-to-mcp appends a second ? to a query-suffixed path templateForse già presa @lordcheng10 l’ha presa 5 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 2 giorni
-
ai-proxy forwards client `Transfer-Encoding: chunked` but sends an unchunked body (upstream 400)Forse già presa @locker95 l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni
-
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 traceForse già presa @GitNimay l’ha presa 20 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apache/apisix#14051 · 3 commenti ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di apache/apisix
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
google/executor.nvim#46 ·
-
Hide undiscovered areaApertaforever from-game
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
openmap-world/openmap#96 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
teradata-labs/loom#624 ·
I maintainer di solito rispondono entro 1 giorno
-
[Forever] Whuut's the Rush (97275) shown as available before Yelmak's Medley (97242) is completedApertaData Correction Forever
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno