Skip to content

Commit 6f4d025

Browse files
committed
Add a login log to discover login attack attempts
1 parent 07806e7 commit 6f4d025

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

migrations/V93__login_log.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
CREATE TABLE IF NOT EXISTS `login_log` (
2+
`id` MEDIUMINT UNSIGNED NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'ID for API/Elide compatibility',
3+
`login_id` MEDIUMINT UNSIGNED NOT NULL,
4+
`ip` VARCHAR(45) NOT NULL,
5+
`attempts` MEDIUMINT UNSIGNED NOT NULL DEFAULT 1,
6+
`success` BOOLEAN NOT NULL,
7+
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
8+
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
9+
PRIMARY KEY (`success`,`ip`,`login_id`),
10+
CONSTRAINT FOREIGN KEY (`login_id`) REFERENCES `login` (`id`)
11+
) ENGINE=InnoDB COMMENT='Log of logins to discover login attack attempts. Has to be cleaned up by the services.';

0 commit comments

Comments
 (0)