Skip to content

Commit

Permalink
Merge branch 'develop' into bugfix/146-showall-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Aboisier committed Feb 7, 2019
2 parents 75e9500 + 347d65b commit 7add262
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 45 deletions.
35 changes: 0 additions & 35 deletions ScoutSuite/output/data/inc-scoutsuite/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ Handlebars.registerHelper('add_policy_path', function() {
for (var i = 2; i < arguments.length -1; i++) {
path = path + '\\.' + arguments[i];
}
console.log(arguments);
console.log('policy_path:' + path);
policy['policy_path'] = path;
policy['policy_spath'] = path.replace(/\\/g, '');
});
Expand Down Expand Up @@ -120,16 +118,6 @@ Handlebars.registerHelper('count_in', function(service, path) {

Handlebars.registerHelper('count_in_new', function(path) {
var entities = path.split('.');
console.log('Counting ' + path);
/*
if (service == 'ec2') {
var input = run_results['services']['ec2'];
} else if(service == 'cloudtrail') {
var input = run_results['services']['cloudtrail'];
} else {
return 0;
}
*/
return recursive_count(run_results, entities);
});

Expand Down Expand Up @@ -176,14 +164,12 @@ Handlebars.registerHelper('count_role_instances', function(instance_profiles) {

var recursive_count = function(input, entities) {
var count = 0;
console.log('Entities left: ' + entities + ' (length = ' + entities.length + ')');
if (entities.length > 0) {
var entity = entities.shift();
for (i in input[entity]) {
count = count + recursive_count(input[entity][i], eval(JSON.stringify(entities)));
}
} else {
console.log('Found one...');
count = count + 1;
}
return count;
Expand Down Expand Up @@ -236,26 +222,6 @@ Handlebars.registerHelper('fixBucketName', function(bucket_name) {
}
});

// http://funkjedi.com/technology/412-every-nth-item-in-handlebars, slightly tweaked to work with a dictionary
// TODO this is duplicated code
// Handlebars.registerHelper('grouped_each', function(every, context, options) {
// var out = "", subcontext = [], i;
// var keys = Object.keys(context);
// var count = keys.length;
// var subcontext = {};
// if (context && count > 0) {
// for (i = 0; i < count; i++) {
// if (i > 0 && i % every === 0) {
// out += options.fn(subcontext);
// subcontext = {};
// }
// subcontext[keys[i]] = context[keys[i]];
// }
// out += options.fn(subcontext);
// }
// return out;
// });

Handlebars.registerHelper('dashboard_color', function(level, checked, flagged) {
if (checked == 0) {
return 'unknown disabled-link';
Expand Down Expand Up @@ -461,7 +427,6 @@ Handlebars.registerHelper('get_arg_name', function(rule_filename, arg_index) {
if ('arg_names' in run_results['rule_definitions'][rule_filename]) {
return run_results['rule_definitions'][rule_filename]['arg_names'][arg_index];
} else {
console.log('Error, arg_names is not declared in ' + rule_filename);
return '';
}
});
Expand Down
10 changes: 0 additions & 10 deletions ScoutSuite/output/data/inc-scoutsuite/scoutsuite.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,6 @@ $(document).ready(function () {
// add item to json
json_dict['items'].push(i);
};
// doesn't work as ID is not always last or second to last value in id_array
// for (item in items) {
// // get item value
// var id_array = items[item].split('.');
// var id = 'services.' + id_array.slice(0, resource_path_array.length).join('.');
// var i = get_value_at(id);
// // add item to json
// json_dict[id_array[id_array.length - 2]] = i;
// };
download_as_json(finding_key + '.json', json_dict);
};

Expand Down Expand Up @@ -302,7 +293,6 @@ function showRowWithItems(path) {
function showFilters(resource_path) {
hideFilters();
service = resource_path.split('.')[1];
console.log('Service: ' + service);
// Show service filters
$('[id="' + resource_path + '.id.filters"]').show();
// show region filters
Expand Down

0 comments on commit 7add262

Please sign in to comment.