anti-bruteforce

command module
v0.0.0-...-fb92606 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 1 Imported by: 0

README

Anti-bruteforce

Go Report Card Tests License

This microservice is intended to fight against password brute-force attack.

The microservice architecture corresponds to Golang standarts

Besides, the Clean Architecture principles are applied, business-logic are separated from database and REST API, so we can easily replace any module on the service.

For counting authorization tries for every login/password/IP pair there is a Leaky Bucket algorithm in the app.

The project was done as a final step to complete Golang Developer. Professional from OTUS course

Commands

Docker-compose

Build all containers and run the app

make up

Stop all containers with the app.

make down

Database

Enter PostgreSQL database console

make enterdb

gRPC

Regenerate gRPC files

make generate

Tests

Run unit-tests

make test

Run integration-tests

make integration-tests

Delete integration-tests containers (if there's some cache and it keeps failing)

make reset-integration-tests

Linters

Run linters (you have to have golangci-lint installed on your PC)

make lint

Command Line Interface

If you want to use CLI you need to build the app binary file

make build
Blacklist

Add subnet to the blacklist

./bin/app blacklist add *SUBNET*

Remove subnet from the blacklist

./bin/app blacklist rm *SUBNET*
Whitelist

Add subnet to the whitelist

./bin/app whitelist add *SUBNET*

Remove subnet from the whitelist

./bin/app whitelist rm *SUBNET*

Leaky Bucket

Reset Leaky-Bucket counter

./bin/app bucket-reset

Server

Run the app's HTTP and gRPC servers

./bin/app serve --configFolder *CONFIG_FOLDER*

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
app
cli
repository/mocks
Package mock_repository is a generated GoMock package.
Package mock_repository is a generated GoMock package.
services/mocks
Package mock_services is a generated GoMock package.
Package mock_services is a generated GoMock package.
transport/http/mocks
Package mock_http is a generated GoMock package.
Package mock_http is a generated GoMock package.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL