def form(self,query,result): try: ## Draw the form for each scan group: result.text(DB.expand("Scanning Inode %s", (query['inode']))) groups = [] for cls in ScannerUtils.scan_groups_gen(): try: drawer = cls.Drawer() if drawer.group in groups: continue groups.append(drawer.group) drawer.form(query,result) except RuntimeError: pass result.checkbox('Click here when finished','final','ok') except KeyError: return result
def form(self, query, result): try: ## Draw the form for each scan group: result.text(DB.expand("Scanning Inode %s", (query["inode"]))) groups = [] for cls in ScannerUtils.scan_groups_gen(): try: drawer = cls.Drawer() if drawer.group in groups: continue groups.append(drawer.group) drawer.form(query, result) except RuntimeError: pass result.checkbox("Click here when finished", "final", "ok") except KeyError: return result
def form(self,query,result): try: result.case_selector() if query['case']!=config.FLAGDB: result.textfield('Scan files (glob or path)','path',size=50) ## Draw the form for each scan group: groups = [] for cls in ScannerUtils.scan_groups_gen(): try: drawer = cls.Drawer() if drawer.group in groups: continue groups.append(drawer.group) drawer.form(query,result) except RuntimeError: pass result.checkbox('Click here when finished','final','ok') except KeyError: return result
def calculate_scanners(self,query): """ Calculates the scanners required, filling in dependancies and considering scanner groups. returns an array of scanner names. """ ## The scanners that users asked for: q = FlagFramework.query_type(()) for cls in ScannerUtils.scan_groups_gen(): drawer=cls.Drawer() drawer.add_defaults(q,query) scanner_names = [] l = len("scan_") for k,v in q: if k[:l]=="scan_" and v=='on': scanner_names.append(k[l:]) ## Now pull in any scanners which are needed scanner_names = ScannerUtils.fill_in_dependancies(scanner_names) return scanner_names
def calculate_scanners(self, query): """ Calculates the scanners required, filling in dependancies and considering scanner groups. returns an array of scanner names. """ ## The scanners that users asked for: q = FlagFramework.query_type(()) for cls in ScannerUtils.scan_groups_gen(): drawer = cls.Drawer() drawer.add_defaults(q, query) scanner_names = [] l = len("scan_") for k, v in q: if k[:l] == "scan_" and v == "on": scanner_names.append(k[l:]) ## Now pull in any scanners which are needed scanner_names = ScannerUtils.fill_in_dependancies(scanner_names) return scanner_names
def form(self, query, result): try: result.case_selector() if query["case"] != config.FLAGDB: result.textfield("Scan files (glob or path)", "path", size=50) ## Draw the form for each scan group: groups = [] for cls in ScannerUtils.scan_groups_gen(): try: drawer = cls.Drawer() if drawer.group in groups: continue groups.append(drawer.group) drawer.form(query, result) except RuntimeError: pass result.checkbox("Click here when finished", "final", "ok") except KeyError: return result
def __init__(self,flag,ui=None): Reports.report.__init__(self,flag,ui) self.parameters = self.parameters.copy() ## Work out what scan groups are available and require they be ## in the parameters: groups = [] for cls in ScannerUtils.scan_groups_gen(): drawer = cls.Drawer() if drawer.group in groups: continue scan_group_name = drawer.get_group_name() groups.append(scan_group_name) ## Add the scan group to our parameters - this will ensure ## that type checking is done on it: self.parameters[scan_group_name]='onoff' ## Adjust this reports parameters list. This is ## required to ensure that caching works correctly ## (caching must include all the individual scanners so ## they are sensitive to changes in sub group tuning) for k,t in drawer.get_parameters(): self.parameters[k]=t
def __init__(self, flag, ui=None): Reports.report.__init__(self, flag, ui) self.parameters = self.parameters.copy() ## Work out what scan groups are available and require they be ## in the parameters: groups = [] for cls in ScannerUtils.scan_groups_gen(): drawer = cls.Drawer() if drawer.group in groups: continue scan_group_name = drawer.get_group_name() groups.append(scan_group_name) ## Add the scan group to our parameters - this will ensure ## that type checking is done on it: self.parameters[scan_group_name] = "onoff" ## Adjust this reports parameters list. This is ## required to ensure that caching works correctly ## (caching must include all the individual scanners so ## they are sensitive to changes in sub group tuning) for k, t in drawer.get_parameters(): self.parameters[k] = t