Exemple #1
0
    def select_userid_auth(self, filters, table):

        if filters.have_only(firewall=False, user_id=False, username=False):
            return "SELECT username FROM authfail %s" % filters.getwhere()
        else:
            self.reset_raw_label(filters)
            return Ulogd2Request.select_userid_auth(self, filters)
Exemple #2
0
    def select_apps(self, filters, column):

        if filters.have_only(firewall=False, client_app=False):
            return "SELECT client_app, %s AS packets, first_time AS start_time, last_time AS end_time FROM apps_stats %s" % (column, filters.getwhere())
        else:
            self.reset_raw_label(filters)
            return Ulogd2Request.select_apps(self, filters)
Exemple #3
0
    def select_userid(self, filters, column):

        if filters.have_only(firewall=False, user_id=False, username=False):
            return "SELECT username FROM users_stats %s" % filters.getwhere()
        else:
            self.reset_raw_label(filters)
            return Ulogd2Request.select_userid(self, filters)
Exemple #4
0
    def count_ip(self, filters, column, direction):
        """ Count all dropped packets """

        if direction == 's' and filters.have_only(firewall=False, ip_saddr_str=False):
            return "SELECT SUM(%s) FROM hosts_stats %s" % (column, filters.getwhere())
        else:
            self.reset_raw_label(filters)
            return Ulogd2Request.count_ip(self, filters, direction)
Exemple #5
0
    def select_ip(self, filters, column, direction):
        """ List all ips which matches filters """

        if direction == 's' and filters.have_only(firewall=False, ip_saddr_str=False):
            return "SELECT ip_saddr_str, %s AS packets, first_time AS start_time, last_time AS end_time FROM hosts_stats %s" % (column, filters.getwhere())
        else:
            self.reset_raw_label(filters)
            return Ulogd2Request.select_ip(self, filters, direction)
Exemple #6
0
    def count_user(self, filters, column):
        """ Count all users packets which are dropped """

        if filters.have_only(firewall=False, user_id=False,username=False):
            return "SELECT SUM(%s) FROM users_stats %s" % (column, filters.getwhere())
        else:
            self.reset_raw_label(filters)
            return Ulogd2Request.count_user(self, filters)
Exemple #7
0
    def select_user(self, filters, column):
        """ List all users who have dropped packets """

        if filters.have_only(firewall=False, user_id=False, username=False):
            return "SELECT username, %s AS packets, first_time AS start_time, last_time AS end_time FROM users_stats %s" % (column, filters.getwhere())
        else:
            self.reset_raw_label(filters)
            return Ulogd2Request.select_user(self, filters)
Exemple #8
0
    def count_apps(self, filters, column):
        """ Count all dropped packets """

        if filters.have_only(firewall=False, client_app=False):
            return "SELECT SUM(%s) FROM apps_stats %s" % (column, filters.getwhere())
        else:
            self.reset_raw_label(filters)
            return Ulogd2Request.count_apps(self, filters)
Exemple #9
0
 def __init__(self, database, tablename):
     Ulogd2Request.__init__(self, database, tablename)
     self.raw_label = None