forked from p15670423/monkey
UI: Modify how process list collection PBA is shown in Security report
This commit is contained in:
parent
afa7d4fca4
commit
ff6fd52979
|
@ -5,6 +5,10 @@ export default function parsePbaResults(results) {
|
|||
|
||||
const SHELL_STARTUP_NAME = 'Modify shell startup file';
|
||||
const CMD_HISTORY_NAME = 'Clear command history';
|
||||
// TODO: Remove line 10 and un-comment line 11 after the TODO in `_run_pba()` in
|
||||
// `automated_master.py` is resolved.
|
||||
const PROCESS_LIST_COLLECTION = 'ProcessListCollection';
|
||||
// const PROCESS_LIST_COLLECTION = 'Process list collection';
|
||||
|
||||
const multipleResultsPbas = [SHELL_STARTUP_NAME, CMD_HISTORY_NAME]
|
||||
|
||||
|
@ -41,10 +45,17 @@ function aggregateMultipleResultsPba(results) {
|
|||
}
|
||||
}
|
||||
|
||||
function modifyProcessListCollectionResult(result) {
|
||||
result[0] = "Found " + Object.keys(result[0]).length.toString() + " running processes";
|
||||
}
|
||||
|
||||
// check for pbas with multiple results and aggregate their results
|
||||
for (let i = 0; i < results.length; i++)
|
||||
for (let i = 0; i < results.length; i++) {
|
||||
if (multipleResultsPbas.includes(results[i].name))
|
||||
aggregateResults(results[i]);
|
||||
if (results[i].name === PROCESS_LIST_COLLECTION)
|
||||
modifyProcessListCollectionResult(results[i].result);
|
||||
}
|
||||
|
||||
// if no modifications were made to the results, i.e. if no pbas had mutiple results, return `results` as it is
|
||||
let noResultsModifications = true;
|
||||
|
|
Loading…
Reference in New Issue