Beispiel #1
0
    def validate_config(self):
        props = [['output-email','enabled'], ['output-email','login'], ['output-email','attack']]
        for prop in props:
            if not config.checkExist(self.cfg,prop) or not config.checkValidBool(self.cfg, prop):
                return False

        #If email is enabled check it's config
        if self.cfg.get('output-email','login') == 'true' or self.cfg.get('output-email','login') == 'attack':
            if self.cfg.get('output-txtlog','enabled') == 'true':
                prop = ['output-email','port']
                if not config.checkExist(self.cfg,prop) or not config.checkValidPort(self.cfg,prop):
                    return False
                props = [['output-email','use_tls'], ['output-email','use_smtpauth']]
                for prop in props:
                    if not config.checkExist(self.cfg,prop) or not config.checkValidBool(self.cfg,prop):
                        return False
                if self.cfg.get('output-email','use_smtpauth') == 'true':
                    props = [['output-email','username'], ['output-email','password']]
                    for prop in props:
                        if not config.checkExist(self.cfg,prop):
                            return False
                props = [['output-email','host'], ['output-email','from'], ['output-email','to']]
                for prop in props:
                    if not config.checkExist(self.cfg,prop):
                        return False
            else:
                print '[output-txtlog][enabled] must be set to true for email support to work'
                return False
        
        return True
Beispiel #2
0
 def validate_config(self):
     props = [['output-txtlog', 'enabled']]
     for prop in props:
         if not config.checkExist(self.cfg,
                                  prop) or not config.checkValidBool(
                                      self.cfg, prop):
             return False
     return True
Beispiel #3
0
 def validate_config(self):
     props = [['output-slack','enabled']]
     for prop in props:
         if not config.checkExist(self.cfg,prop) or not config.checkValidBool(self.cfg, prop):
             return False
         
     props = [['output-slack','webhook-url']]
     for prop in props:
         if not config.checkExist(self.cfg,prop):
             return False
     return True
Beispiel #4
0
    def validate_config(self):
        props = [['honeypot-docker','enabled'], ['honeypot-docker','pre-auth'], ['honeypot-docker','post-auth']]
        for prop in props:
            if not config.checkExist(self.cfg,prop) or not config.checkValidBool(self.cfg, prop):
                return False
            
        props = [['honeypot-docker','image'], ['honeypot-docker','uri'], ['honeypot-docker','hostname'], ['honeypot-docker','launch_cmd'], ['honeypot-docker','honey_port']]
        for prop in props:
            if not config.checkExist(self.cfg,prop):
                return False  

        return True    
Beispiel #5
0
    def validate_config(self):
        props = [['output-slack', 'enabled']]
        for prop in props:
            if not config.checkExist(self.cfg,
                                     prop) or not config.checkValidBool(
                                         self.cfg, prop):
                return False

        props = [['output-slack', 'webhook-url']]
        for prop in props:
            if not config.checkExist(self.cfg, prop):
                return False
        return True
Beispiel #6
0
 def validate_config(self):
     props = [['output-mysql','enabled']]
     for prop in props:
         if not config.checkExist(self.self.cfg,prop) or not config.checkValidBool(self.self.cfg, prop):
             return False    
     
     #If output-mysql is enabled check it's config
     if self.cfg.get('output-mysql','enabled') == 'true':
         prop = ['output-mysql','port']
         if not config.checkExist(self.cfg,prop) or not config.checkValidPort(self.cfg,prop):
             return False
         props = [['output-mysql','host'], ['output-mysql','database'], ['output-mysql','username'], ['output-mysql','password']]
         for prop in props:
             if not config.checkExist(self.cfg,prop):
                 return False
     return True
Beispiel #7
0
    def validate_config(self):
        props = [['honeypot-script','enabled'], ['honeypot-script','pre-auth'], ['honeypot-script','post-auth']]
        for prop in props:
            if not config.checkExist(self.cfg,prop) or not config.checkValidBool(self.cfg, prop):
                return False
        if self.cfg.get('honeypot-script','pre-auth') == 'true':
            props = [['honeypot-script','pre-auth-script']]
            for prop in props:
                if not config.checkExist(self.cfg,prop):
                    return False  
        if self.cfg.get('honeypot-script','post-auth') == 'true':
            props = [['honeypot-script','post-auth-script']]
            for prop in props:
                if not config.checkExist(self.cfg,prop):
                    return False 

        return True    
Beispiel #8
0
    def validate_config(self):
        props = [["output-hpfeeds", "enabled"]]
        for prop in props:
            if not config.checkExist(self.cfg, prop) or not config.checkValidBool(self.cfg, prop):
                return False

        # If hpfeeds is enabled check it's config
        if self.cfg.get("output-hpfeeds", "enabled") == "true":
            props = [["output-hpfeeds", "server"], ["output-hpfeeds", "identifier"], ["output-hpfeeds", "secret"]]
            for prop in props:
                if not config.checkExist(self.cfg, prop):
                    return False
            prop = ["output-hpfeeds", "port"]
            if not config.checkExist(self.cfg, prop) or not config.checkValidPort(self.cfg, prop):
                return False

        return True
Beispiel #9
0
    def validate_config(self):
        props = [['honeypot-docker', 'enabled'],
                 ['honeypot-docker', 'pre-auth'],
                 ['honeypot-docker', 'post-auth']]
        for prop in props:
            if not config.checkExist(self.cfg,
                                     prop) or not config.checkValidBool(
                                         self.cfg, prop):
                return False

        props = [['honeypot-docker', 'image'], ['honeypot-docker', 'uri'],
                 ['honeypot-docker', 'hostname'],
                 ['honeypot-docker', 'launch_cmd'],
                 ['honeypot-docker', 'honey_port']]
        for prop in props:
            if not config.checkExist(self.cfg, prop):
                return False

        return True
Beispiel #10
0
    def validate_config(self):
        props = [['honeypot-script', 'enabled'],
                 ['honeypot-script', 'pre-auth'],
                 ['honeypot-script', 'post-auth']]
        for prop in props:
            if not config.checkExist(self.cfg,
                                     prop) or not config.checkValidBool(
                                         self.cfg, prop):
                return False
        if self.cfg.get('honeypot-script', 'pre-auth') == 'true':
            props = [['honeypot-script', 'pre-auth-script']]
            for prop in props:
                if not config.checkExist(self.cfg, prop):
                    return False
        if self.cfg.get('honeypot-script', 'post-auth') == 'true':
            props = [['honeypot-script', 'post-auth-script']]
            for prop in props:
                if not config.checkExist(self.cfg, prop):
                    return False

        return True
Beispiel #11
0
    def validate_config(self):
        props = [['output-mysql', 'enabled']]
        for prop in props:
            if not config.checkExist(self.self.cfg,
                                     prop) or not config.checkValidBool(
                                         self.self.cfg, prop):
                return False

        #If output-mysql is enabled check it's config
        if self.cfg.get('output-mysql', 'enabled') == 'true':
            prop = ['output-mysql', 'port']
            if not config.checkExist(self.cfg,
                                     prop) or not config.checkValidPort(
                                         self.cfg, prop):
                return False
            props = [['output-mysql', 'host'], ['output-mysql', 'database'],
                     ['output-mysql', 'username'],
                     ['output-mysql', 'password']]
            for prop in props:
                if not config.checkExist(self.cfg, prop):
                    return False
        return True
Beispiel #12
0
    def validate_config(self):
        props = [['honeypot-static','enabled'], ['honeypot-static','pre-auth'], ['honeypot-static','post-auth']]
        for prop in props:
            if not config.checkExist(self.cfg,prop) or not config.checkValidBool(self.cfg, prop):
                return False
            
        props = [['honeypot-static','honey_ip']]
        for prop in props:
            if not config.checkExist(self.cfg,prop) or not config.checkValidIP(self.cfg,prop):
                return False
            
        props = [['honeypot-static','honey_port']]
        for prop in props:
            if not config.checkExist(self.cfg,prop) or not config.checkValidPort(self.cfg,prop):
                return False 
            
        props = [['honeypot-static','sensor_name']]
        for prop in props:
            if not config.checkExist(self.cfg,prop):
                return False           

        return True    
Beispiel #13
0
    def validate_config(self):
        props = [['output-hpfeeds', 'enabled']]
        for prop in props:
            if not config.checkExist(self.cfg,
                                     prop) or not config.checkValidBool(
                                         self.cfg, prop):
                return False

        #If hpfeeds is enabled check it's config
        if self.cfg.get('output-hpfeeds', 'enabled') == 'true':
            props = [['output-hpfeeds', 'server'],
                     ['output-hpfeeds', 'identifier'],
                     ['output-hpfeeds', 'secret']]
            for prop in props:
                if not config.checkExist(self.cfg, prop):
                    return False
            prop = ['output-hpfeeds', 'port']
            if not config.checkExist(self.cfg,
                                     prop) or not config.checkValidPort(
                                         self.cfg, prop):
                return False

        return True
Beispiel #14
0
 def validate_config(self):
     props = [['output-txtlog','enabled']]
     for prop in props:
         if not config.checkExist(self.cfg,prop) or not config.checkValidBool(self.cfg, prop):
             return False
     return True