parent
							
								
									516d56c42a
								
							
						
					
					
						commit
						93aedbfd6e
					
				@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					"""
 | 
				
			||||||
 | 
						This class is designed to be an actor class i.e it will undertake certain actions given an event detected
 | 
				
			||||||
 | 
						The platform has 2 main sections (detection & analysis).
 | 
				
			||||||
 | 
						Action Types (Actors):
 | 
				
			||||||
 | 
							- Alert : Sends an email or Webhook
 | 
				
			||||||
 | 
							- Apps 	: Kill, Start
 | 
				
			||||||
 | 
							- Folder: Archive, Delete (all, age, size)
 | 
				
			||||||
 | 
							
 | 
				
			||||||
 | 
						@TODO: 
 | 
				
			||||||
 | 
							- upgrade to python 3.x
 | 
				
			||||||
 | 
					"""
 | 
				
			||||||
 | 
					import json
 | 
				
			||||||
 | 
					from threading import Thread
 | 
				
			||||||
 | 
					class Actor(Thread):
 | 
				
			||||||
 | 
						def __init__(self,config):
 | 
				
			||||||
 | 
							pass
 | 
				
			||||||
 | 
						def init(self,config):
 | 
				
			||||||
 | 
							pass
 | 
				
			||||||
 | 
					class Kill(Actor):
 | 
				
			||||||
 | 
						def __init__(self,config):
 | 
				
			||||||
 | 
							Actor.__init__(self,config)
 | 
				
			||||||
 | 
						def init (self,app):
 | 
				
			||||||
 | 
							pass
 | 
				
			||||||
 | 
					class Start(Actor):
 | 
				
			||||||
 | 
						def __init__(self,config):
 | 
				
			||||||
 | 
							Actor.__init__(self,config)
 | 
				
			||||||
 | 
						def init(self,args):
 | 
				
			||||||
 | 
							path = args['path']
 | 
				
			||||||
 | 
							args = args['args'] if 'args' in args else ''
 | 
				
			||||||
 | 
					class Alert(Actor):
 | 
				
			||||||
 | 
						pass
 | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue