Ejemplo n.º 1
0
 def get(self):
     # post request to server to get ip blacklist
     # return 'Hello World!'
     # blacklist = [{'ip' : '8.8.8.8/255.255.255.255'}]
     blacklist = []
     o = IpTablesManager()
     res = o.get_blacklist()
     for item in res:
         blacklist.append(item['IP'])
     return render_template('ui.html', blacklist = blacklist)
Ejemplo n.º 2
0
    def main(self):
        self.ips = IronBlockIPS().get_ips()


        conn = S3Connection(AWS_ID, AWS_PASS)
        bucket = conn.get_bucket("iron_block_ips")
        key = Key(bucket)
        key.key = 'blacklist_json'
        self.ips = json.loads(key.get_contents_as_string())
        self.ips = self.ips['MaliciousIPS']

        mgr = IpTablesManager()
        mgr.add_ips_to_block_list(self.ips)
Ejemplo n.º 3
0
 def post(self):
     #add to whitelist
     ip = flask.request.form['ip']
     o = IpTablesManager()
     o.remove_ips_from_block_list([ip])
     o.add_to_white_list([ip])