continued work on capa scanner
This commit is contained in:
		
							parent
							
								
									27d99b0aac
								
							
						
					
					
						commit
						2581f7ed27
					
				
					 3 changed files with 8 additions and 3 deletions
				
			
		| 
						 | 
					@ -11,5 +11,10 @@ services:
 | 
				
			||||||
      - "5000:5000"
 | 
					      - "5000:5000"
 | 
				
			||||||
    volumes:
 | 
					    volumes:
 | 
				
			||||||
      - "./storage/files:/mnt/storage/files"
 | 
					      - "./storage/files:/mnt/storage/files"
 | 
				
			||||||
 | 
					  capa:
 | 
				
			||||||
 | 
					    build: ./scanners/capa/Dockerfile
 | 
				
			||||||
 | 
					    ports:
 | 
				
			||||||
 | 
					      - "5001:5001"
 | 
				
			||||||
 | 
					    volumes:
 | 
				
			||||||
 | 
					      - "./storage/files:/mnt/storage/files"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,6 +6,7 @@ class Config:
 | 
				
			||||||
    HOST = os.environ.get("HOST", "127.0.0.1")
 | 
					    HOST = os.environ.get("HOST", "127.0.0.1")
 | 
				
			||||||
    PORT = int(os.environ.get("PORT", 5000))
 | 
					    PORT = int(os.environ.get("PORT", 5000))
 | 
				
			||||||
    DEBUG = os.environ.get("DEBUG", "False").lower() in ("true", "1")
 | 
					    DEBUG = os.environ.get("DEBUG", "False").lower() in ("true", "1")
 | 
				
			||||||
 | 
					    RULES = os.environ.get("RULES", "/usr/local/share/capa-rules/")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Ensure upload directory exists
 | 
					# Ensure upload directory exists
 | 
				
			||||||
if not os.path.exists(Config.FILE_DIRECTORY):
 | 
					if not os.path.exists(Config.FILE_DIRECTORY):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -24,8 +24,7 @@ def analyze_capa():
 | 
				
			||||||
        print(f"Error: File not found at '{filepath}'")
 | 
					        print(f"Error: File not found at '{filepath}'")
 | 
				
			||||||
        abort(400)
 | 
					        abort(400)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    
 | 
					    rules = capa.rules.get_rules([Path(config.Config.RULES)])
 | 
				
			||||||
    rules = capa.rules.get_rules([capa.main.get_default_root()/ "rules"])
 | 
					 | 
				
			||||||
    extractor = capa.loader.get_extractor(filepath, FORMAT_AUTO, OS_AUTO, capa.main.BACKEND_VIV, [], should_save_workspace=False, disable_progress=True)
 | 
					    extractor = capa.loader.get_extractor(filepath, FORMAT_AUTO, OS_AUTO, capa.main.BACKEND_VIV, [], should_save_workspace=False, disable_progress=True)
 | 
				
			||||||
    capabilities = capa.capabilities.common.find_capabilities(rules, extractor, disable_progress=True)
 | 
					    capabilities = capa.capabilities.common.find_capabilities(rules, extractor, disable_progress=True)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue