2020-11-24 19:45:03 +01:00
|
|
|
from app import db
|
|
|
|
|
2021-06-08 18:22:52 +02:00
|
|
|
|
2020-11-24 19:45:03 +01:00
|
|
|
class Ioc(db.Model):
|
|
|
|
def __init__(self, value, type, tlp, tag, source, added_on):
|
|
|
|
self.value = value
|
|
|
|
self.type = type
|
|
|
|
self.tlp = tlp
|
|
|
|
self.tag = tag
|
|
|
|
self.source = source
|
|
|
|
self.added_on = added_on
|
|
|
|
|
2021-06-08 18:22:52 +02:00
|
|
|
|
2020-11-24 19:45:03 +01:00
|
|
|
class Whitelist(db.Model):
|
|
|
|
def __init__(self, element, type, source, added_on):
|
|
|
|
self.element = element
|
|
|
|
self.type = type
|
|
|
|
self.source = source
|
|
|
|
self.added_on = added_on
|
|
|
|
|
2021-06-08 18:22:52 +02:00
|
|
|
|
2021-05-10 16:08:58 +02:00
|
|
|
class MISPInst(db.Model):
|
2021-06-10 18:37:40 +02:00
|
|
|
def __init__(self, name, url, key, ssl, added_on, last_sync):
|
2021-05-10 16:08:58 +02:00
|
|
|
self.name = name
|
|
|
|
self.url = url
|
2021-06-08 20:11:51 +02:00
|
|
|
self.apikey = key
|
2021-05-10 16:08:58 +02:00
|
|
|
self.verifycert = ssl
|
|
|
|
self.added_on = added_on
|
2021-06-10 18:37:40 +02:00
|
|
|
self.last_sync = last_sync
|
2021-05-10 16:08:58 +02:00
|
|
|
|
2021-06-08 18:22:52 +02:00
|
|
|
|
2020-11-24 19:45:03 +01:00
|
|
|
db.mapper(Whitelist, db.Table('whitelist', db.metadata, autoload=True))
|
|
|
|
db.mapper(Ioc, db.Table('iocs', db.metadata, autoload=True))
|
2021-06-08 20:11:51 +02:00
|
|
|
db.mapper(MISPInst, db.Table('misp', db.metadata, autoload=True))
|