diff --git a/widget/edit.controller.js b/widget/edit.controller.js index dc8d8ac..ee7f591 100644 --- a/widget/edit.controller.js +++ b/widget/edit.controller.js @@ -2,11 +2,11 @@ (function () { angular .module('cybersponse') - .controller('editMitreAttackSpread100Ctrl', editMitreAttackSpread100Ctrl); + .controller('editMitreAttackSpread101Ctrl', editMitreAttackSpread101Ctrl); - editMitreAttackSpread100Ctrl.$inject = ['$scope', '$uibModalInstance', 'config', 'ALL_RECORDS_SIZE', '$state', '$resource', 'API', 'Entity']; + editMitreAttackSpread101Ctrl.$inject = ['$scope', '$uibModalInstance', 'config', 'ALL_RECORDS_SIZE', '$state', '$resource', 'API', 'Entity']; - function editMitreAttackSpread100Ctrl($scope, $uibModalInstance, config, ALL_RECORDS_SIZE, $state, $resource, API, Entity) { + function editMitreAttackSpread101Ctrl($scope, $uibModalInstance, config, ALL_RECORDS_SIZE, $state, $resource, API, Entity) { $scope.cancel = cancel; $scope.save = save; $scope.config = config; diff --git a/widget/view.controller.js b/widget/view.controller.js index 1d28e6c..bec993d 100644 --- a/widget/view.controller.js +++ b/widget/view.controller.js @@ -2,13 +2,13 @@ (function () { angular .module('cybersponse') - .controller('mitreAttackSpread100Ctrl', mitreAttackSpread100Ctrl); + .controller('mitreAttackSpread101Ctrl', mitreAttackSpread101Ctrl); - mitreAttackSpread100Ctrl.$inject = ['$scope', 'appModulesService', 'currentPermissionsService', 'usersService', + mitreAttackSpread101Ctrl.$inject = ['$scope', 'appModulesService', 'currentPermissionsService', 'usersService', '$state', '$filter', 'ALL_RECORDS_SIZE', 'API', '$resource', '_', '$q' ]; - function mitreAttackSpread100Ctrl($scope, appModulesService, currentPermissionsService, usersService, + function mitreAttackSpread101Ctrl($scope, appModulesService, currentPermissionsService, usersService, $state, $filter, ALL_RECORDS_SIZE, API, $resource, _, $q) { // the relationship fields do not seem to follow a standard naming convention as seen below @@ -81,7 +81,7 @@ } }; - + if ($scope.config.incidentsQuery != undefined && $scope.config.incidentsQuery.filters.length != 0) { var old_incidents_filter = {"logic": $scope.incidents.query.logic, "filters": $scope.incidents.query.filters}; $scope.incidents.query.logic = "AND"; @@ -184,6 +184,7 @@ $scope.related_tactics = []; $scope.currentUser = usersService.getCurrentUser(); $scope.currentTheme = 'dark'; + $scope.changeMatrix = changeMatrix; $scope.globalRefresh = globalRefresh; $scope.hide_all = false; @@ -200,6 +201,10 @@ 'TA0038', 'TA0039', 'TA0108', 'TA0104', 'TA0110', 'TA0111', 'TA0103', 'TA0102', // ics 'TA0109', 'TA0100', 'TA0101', 'TA0107', 'TA0106', 'TA0105']; + $scope.enterprise_list = $scope.tactics_order.slice(0, 14); + $scope.mobile_list = $scope.tactics_order.slice(14, 28); + $scope.ics_list = $scope.tactics_order.slice(28); + $scope.selected_list = $scope.enterprise_list; init(); @@ -291,7 +296,7 @@ angular.forEach($scope.subtechniquesRecords, function (subtechnique_record) { if (subtechnique_record.parentTechnique != null) { // need this check otherwise it breaks the loop if (technique['@id'] == subtechnique_record.parentTechnique) { - // requires subtechnique object to be cloned + // requires subtechnique object to be cloned // otherwise clicking on one toggle shows/hides alerts and incidents across all duplicates technique._subtechniques.push(structuredClone(subtechnique_record)); } @@ -528,6 +533,18 @@ $state.go(state, params); } + function changeMatrix(selectedMatrix) { + if (selectedMatrix === 'mobile') { + $scope.selected_list = $scope.mobile_list; + } + else if (selectedMatrix === 'ics') { + $scope.selected_list = $scope.ics_list; + } + else { + $scope.selected_list = $scope.enterprise_list; + } + } + function globalRefresh() { init(); } diff --git a/widget/view.html b/widget/view.html index f7a5d7f..9d378b8 100644 --- a/widget/view.html +++ b/widget/view.html @@ -3,8 +3,18 @@
-
{{ config.title ? config.title : 'MITRE ATT&CK - Alert/Incident Spread' }}
+
{{ config.title ? config.title : 'MITRE ATT&CK + Alert/Incident Spread' }}    + + + + +
{{ config.titl + data-ng-hide="(tactic.techniques.length == 0 && config.hideTactics) || (tactic._hidden_techniques_count == tactic.techniques.length && config.hideParentTactics && !tactic._toggled) || (detail_display && !tactic._toggled_detail) || (selected_list.indexOf(tactic.mitreId) === -1)"> {{ tactic.techniques.length }} {{ tactic.techniques.length === 1 ? 'technique' : 'techniques' }} @@ -32,7 +42,7 @@
{{ config.titl + data-ng-hide="(tactic.techniques.length == 0 && config.hideTactics) || (tactic._hidden_techniques_count == tactic.techniques.length && config.hideParentTactics && !tactic._toggled) || (detail_display && !tactic._toggled_detail) || (selected_list.indexOf(tactic.mitreId) === -1)">
{{ tactic.name }} @@ -43,7 +53,7 @@
{{ config.titl + data-ng-hide="(tactic.techniques.length == 0 && config.hideTactics) || (tactic._hidden_techniques_count == tactic.techniques.length && config.hideParentTactics && !tactic._toggled) || (detail_display && !tactic._toggled_detail) || (selected_list.indexOf(tactic.mitreId) === -1)">