Ad Widget

Collapse

Which function for "Too Many Login Attempts"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BigSmooth
    Member
    • Jun 2023
    • 46

    #1

    Which function for "Too Many Login Attempts"

    Hello,
    I am gathering windows event logs for my application and filter on a pattern like "Unsuccessful login attempts".
    With a preprocessing, the item stores a list of failed attemps. Item value is the login name.
    2024-01-30 15:07:50 user1
    2024-01-30 15:03:50 user2
    2024-01-30 15:02:50 user1
    2024-01-30 14:58:50 user1
    2024-01-30 14:34:50 user1
    2024-01-30 14:28:50 user1


    What would be the formular to do a count of failed login attempt for each logins and raise a trigger when it is above 3 on a 15 minutes period?

    It is some kind of aggregation, but based on item value and not item name.

    Regards,
    Olivier
    Last edited by BigSmooth; 30-01-2024, 17:20.
  • nathanvandalen
    Junior Member
    • Jan 2023
    • 11

    #2
    Think the best way is to use the count() history function

    4 History functions (zabbix.com)​​

    Examples:
    count(/host/key,10m,"like","error") #the number of values for the last 10 minutes until now that contain 'error'​

    Comment

    • BigSmooth
      Member
      • Jun 2023
      • 46

      #3
      If I am not wrong, it will not be counted per login name, will it?
      I don't want to raise an alarm if 10 users made a mistake, but if 1 user made 3 login attempts.

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4807

        #4
        Then you need trigger per user... I cannot think of any function, that would take any possible value and count them in time... Trigger function is dumb in that sense... if you do not tell it, what to look for, ie. what username, then it does not know it...

        Comment

        • BigSmooth
          Member
          • Jun 2023
          • 46

          #5
          I was looking for something like (if you are familiar with sql):
          Code:
          select username, count(*) from failed_login group by username;

          Comment

          Working...