Bruteforce Mitigation
This commit is contained in:
@ -14,31 +14,31 @@ using namespace std::chrono_literals;
|
||||
*/
|
||||
namespace RegularTaskExecution {
|
||||
/*
|
||||
* print test
|
||||
* todo::remove
|
||||
* clears expired login lockouts
|
||||
*/
|
||||
void reeePrint() {
|
||||
std::cout << "reeee" << std::endl;
|
||||
void purgeExpiredLoginLockouts(pqxx::connection &connection) {
|
||||
Database::executeStatement_STATEMENT_PURGE_EXPIRED_LOGIN_LOCKOUTS(connection);
|
||||
}
|
||||
|
||||
/*
|
||||
* print test
|
||||
* todo::remove
|
||||
* clears expired Freelancer Reset Keys
|
||||
*/
|
||||
void counterPrint(size_t& counter) {
|
||||
std::cout << counter << std::endl;
|
||||
counter++;
|
||||
void purgeExpiredFreelancerResetKeys(pqxx::connection &connection) {
|
||||
Database::executeStatement_STATEMENT_PURGE_EXPIRED_FREELANCER_RESET_KEYS(connection);
|
||||
}
|
||||
|
||||
void regularExecution(const Utilities::config& configuration) {
|
||||
std::chrono::seconds seconds(configuration.regularTaskExecutionIntervalSeconds);
|
||||
pqxx::connection databaseConnection(configuration.databaseConnectionString);
|
||||
size_t counter = 0;
|
||||
std::cout << "REGULAR EXECUTION START: " << std::endl;
|
||||
while (configuration.regularTaskExecution) {
|
||||
if (configuration.regularTaskExecutionModules.at(Utilities::MODULE_NAME_REEE_PRINT))
|
||||
reeePrint(); // print test todo::remove
|
||||
if (configuration.regularTaskExecutionModules.at(Utilities::MODULE_NAME_REEE_PRINT))
|
||||
counterPrint(counter); // print test todo::remove
|
||||
|
||||
std::cout << "REGULAR EXECUTION LOOP: " << counter << std::endl;
|
||||
if (configuration.regularTaskExecutionModules.at(Utilities::MODULE_NAME_BRUTE_FORCE_MITIGATION_CLEANER))
|
||||
purgeExpiredLoginLockouts(databaseConnection);
|
||||
if (configuration.regularTaskExecutionModules.at(Utilities::MODULE_NAME_FREELANCER_RESET_KEY_CLEANER))
|
||||
purgeExpiredFreelancerResetKeys(databaseConnection);
|
||||
counter++;
|
||||
std::this_thread::sleep_for(seconds);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user