Allow logging of failed login attempts

Aberta Para iniciantes
#1,218 3 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
65/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Estagnada
Stack de tecnologia
rust
Domínio
authentication

Direção de pesquisa

Localize o módulo de autenticação na base de código Rust do SQLPage onde as tentativas de login são processadas. Altere a resposta HTTP para tentativas de login malsucedidas de 302 para 401, mantendo 302 para logins bem-sucedidos. Verifique o comportamento testando cenários de login bem-sucedidos e malsucedidos.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

enhancement

What are you building with SQLPage ?
I’ve currently built a shared calendar with SQLPage, but I really like the project and will use it some more in the future for other simple apps

What is your problem ? A description of the problem, not the solution you are proposing.
When using the auth module, all login attempts show up the same in the reverse proxy logs (302 HTTP code) whether they’re successful or not. Because of this, it’s not possible to monitor if there is suspicious activity on the login page, with a bad actor trying to bruteforce passwords for example

What are you currently doing ? Since your solution is not implemented in SQLPage currently, what are you doing instead ?
Instead, I’m monitoring if an IP address is hitting the page that handles an auth multiple times in an hour. Any login attempt hits this page once, but when a legitimate user sucessfully logs in, they won’t fave to hit it again because they stay logged in thanks to their session cookie. Multiple hits point towards failed login attempts

Describe the solution you'd like
I’d like for an option in the auth module to return a different HTTP code for a failed login attempt (typically 401) and a successful one (the current 302). This way, failed logins can be logged by the reverse proxy

Describe alternatives you've considered
I’ve tried manually setting the status code to 401 with the ad hoc module, but it didn’t work

Linguagem predominante
Rust
Estrelas
2.6k
Forks
175
Merge médio
14h 16min
PRs com merge (30d)
43

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de sqlpage/SQLPage

Todas as issues de sqlpage/SQLPage

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.