示例#1
0
def addPathnameBDD(event):
    
    baseDeDonne.initialisationDB("./data/database.db")
    db = sqlite3.connect("./data/database.db")

    cursor = db.cursor()
    cursor.execute(""" 
    INSERT OR IGNORE INTO pathname(evenement,pathname,NomProcessus,ret)
    VALUES(?,?,?,?)""",(event["a_nomEvent"],event["pathname"],event["p_name"],event["ret"])
    )

    db.commit()

    baseDeDonne.closeDB(db)
示例#2
0
def addParentChildBDD(event):

    baseDeDonne.initialisationDB("./data/database.db")
    db = sqlite3.connect("./data/database.db")

    cursor = db.cursor()
    cursor.execute(""" 
    INSERT OR IGNORE INTO parentChild(parent,child,NomProcessus)
    VALUES(?,?,?)""",(event["parent_comm"],event["child_comm"],event["p_name"])
    )

    db.commit()

    baseDeDonne.closeDB(db)
示例#3
0
def addIPBDD(event):

    baseDeDonne.initialisationDB("./data/database.db")
    db = sqlite3.connect("./data/database.db")

    cursor = db.cursor()
    infoIP = infosIP()
    infoIP = processIPnet_dev_queue_(event)
    # print("PortSource : ",infoIP.portSource ," | ","PortDest : ",infoIP.portDest," | ","ipSource : ",infoIP.ipSource," | ","ipDest : ",infoIP.ipDest )
    cursor.execute(""" 
    INSERT OR IGNORE INTO ip(IPdevice,IPdest,PortSource,PortDest,NomProcessus,Protocole)
    VALUES(?,?,?,?,?,?)""",(infoIP.ipSource,infoIP.ipDest,infoIP.portSource,infoIP.portDest,event["p_name"],infoIP.proto)
    )

    db.commit()

    baseDeDonne.closeDB(db)