FIM tab (wip) and minor changes

This commit is contained in:
root 2016-07-08 14:37:25 +00:00
parent 1b86769aab
commit 1fe1bc5f9f
11 changed files with 140 additions and 26 deletions

View File

@ -182,8 +182,8 @@ app.controller('agentsController', function ($scope, $route, alertify, sharedPro
}; };
$scope.loadRootcheck = function (agentId) { $scope.loadRootcheck = function (agentId) {
sharedProperties.setProperty(agentId); sharedProperties.setProperty('rc//'+agentId);
$location.path('/rootcheck'); $location.path('/compliance');
}; };
$scope.loadFIM = function (agentId) { $scope.loadFIM = function (agentId) {

View File

@ -45,17 +45,17 @@ app.controller('fimController', function ($scope, alertify, sharedProperties, Da
_template += '<li><b>User ID:</b> '+event.uid+'</li>'; _template += '<li><b>User ID:</b> '+event.uid+'</li>';
_template += '<li><b>Group ID:</b> '+event.gid+'</li>'; _template += '<li><b>Group ID:</b> '+event.gid+'</li>';
_template += '</ul></div>' _template += '</ul></div>'
alertify.okBtn("Close").alert(_template); alertify.alert(_template);
}; };
$scope.loadDiscover = function (file) { $scope.loadDiscover = function (file) {
var _filter = 'AlertsFile:"'+file+'"'; var _filter = 'SyscheckFile.path:"'+file+'"';
sharedProperties.setProperty('aa//'+_filter); sharedProperties.setProperty('aa//'+_filter);
$location.path('/discover'); $location.path('/discover');
}; };
$scope.loadDashboard = function (file) { $scope.loadDashboard = function (file) {
var _filter = 'AlertsFile:"' + file+'"'; var _filter = 'SyscheckFile.path:"' + file+'"';
sharedProperties.setProperty('ad//' + _filter); sharedProperties.setProperty('ad//' + _filter);
$location.path('/fim/dashboard'); $location.path('/fim/dashboard');
}; };
@ -152,9 +152,9 @@ app.controller('fimController', function ($scope, alertify, sharedProperties, Da
}; };
$scope.setAgentFilter = function (id) { $scope.setAgentFilter = function (id) {
if (id != $scope.agentId) {
$scope.eventFilter = ''; $scope.eventFilter = '';
$scope.typeFilter = ''; $scope.typeFilter = '';
if (id != $scope.agentId) {
$scope.agentId = id; $scope.agentId = id;
DataFactory.initialize('get', '/syscheck/' + id + '/files', {}, 16, 0) DataFactory.initialize('get', '/syscheck/' + id + '/files', {}, 16, 0)
.then(function (data) { .then(function (data) {

View File

@ -19,6 +19,77 @@ app.controller('rcController', function ($scope, alertify, sharedProperties, Dat
//Functions //Functions
$scope.loadDiscover = function (event) {
var _filter = 'full_log:"' + event + '"';
sharedProperties.setProperty('aa//' + _filter);
$location.path('/discover');
};
$scope.loadDashboard = function (event) {
var _filter = 'full_log:"' + event + '"';
sharedProperties.setProperty('ad//' + _filter);
$location.path('/compliance/dashboard');
};
$scope.getEvents = function (body) {
if (!body) {
var tmpBody = DataFactory.getBody(objectsArray['/rootcheck']);
if ($scope.search !== tmpBody['search']) {
tmpBody['search'] = $scope.search;
body = tmpBody;
}
} else if ($scope.search !== body['search']) {
body['search'] = $scope.search;
}
if (body['search'] === '') {
body['search'] = undefined;
}
if (!body) {
DataFactory.get(objectsArray['/rootcheck'])
.then(function (data) {
$scope.events.length = 0;
$scope.events = data.data.items;
}, printError);
} else {
DataFactory.get(objectsArray['/rootcheck'], body)
.then(function (data) {
$scope.events.length = 0;
$scope.events = data.data.items;
}, printError);
}
};
$scope.hasPrevEvents = function () {
return DataFactory.hasPrev(objectsArray['/rootcheck']);
};
$scope.prevEvents = function () {
DataFactory.prev(objectsArray['/rootcheck'])
.then(function (data) {
$scope.events.length = 0;
$scope.events = data.data.items;
}, printError);
};
$scope.hasNextEvents = function () {
return DataFactory.hasNext(objectsArray['/rootcheck']);
};
$scope.nextEvents = function () {
DataFactory.next(objectsArray['/rootcheck'])
.then(function (data) {
$scope.events.length = 0;
$scope.events = data.data.items;
}, printError);
};
$scope.getStatusClass = function (status) {
if (status === 'resolved') {
return "statusGreen";
} else {
return "statusRed";
}
};
$scope.searchAgent = function () { $scope.searchAgent = function () {
if ($scope.searchAgents === '') { if ($scope.searchAgents === '') {
$scope.searchAgents = undefined; $scope.searchAgents = undefined;
@ -78,6 +149,22 @@ app.controller('rcController', function ($scope, alertify, sharedProperties, Dat
}); });
}; };
$scope.isSetAgentFilter = function (id) {
return ($scope.agentId === id);
};
$scope.setAgentFilter = function (id) {
if (id != $scope.agentId) {
$scope.statusFilter = '';
$scope.agentId = id;
DataFactory.initialize('get', '/rootcheck/' + id, {}, 16, 0)
.then(function (data) {
objectsArray['/rootcheck'] = data;
$scope.getEvents();
}, printError);
}
};
var load = function () { var load = function () {
var _agent = '000'; var _agent = '000';
var _init = sharedProperties.getProperty(); var _init = sharedProperties.getProperty();
@ -86,6 +173,7 @@ app.controller('rcController', function ($scope, alertify, sharedProperties, Dat
sharedProperties.setProperty(''); sharedProperties.setProperty('');
$scope.agentId = _agent; $scope.agentId = _agent;
} }
$scope.agentId = _agent;
DataFactory.initialize('get', '/rootcheck/'+_agent, {}, 16, 0) DataFactory.initialize('get', '/rootcheck/'+_agent, {}, 16, 0)
.then(function (data) { .then(function (data) {

View File

@ -1286,6 +1286,14 @@ ul.eventTabs-controlButtons {
clear: both; clear: both;
text-align: right; text-align: right;
} }
.upperDate {
float: left;
clear: left;
}
.bottomDate {
float: left;
clear: left;
}
ul.eventTabs-controlButtons li { ul.eventTabs-controlButtons li {
display: inline; display: inline;
margin-left: 0; margin-left: 0;
@ -1329,6 +1337,12 @@ ul.eventTabs-controlButtons li a {
width: 200px; width: 200px;
font-weight: bold; font-weight: bold;
} }
.event_card .dates{
padding: 10px;
padding-top: 10px;
text-align: center;
font-weight: bold;
}
.eventRed { .eventRed {
color: red; color: red;
} }
@ -1338,7 +1352,12 @@ ul.eventTabs-controlButtons li a {
.eventOrange { .eventOrange {
color: orange; color: orange;
} }
.statusGreen {
background-color: green;
}
.statusRed {
background-color: red;
}
/* Wazuh submenu */ /* Wazuh submenu */
.wazuh-submenu { .wazuh-submenu {
background: #222; background: #222;
@ -1399,3 +1418,13 @@ ul.eventTabs-controlButtons li a {
width: 0; width: 0;
height: 0; height: 0;
} }
.filterSpan {
float: right;
font-size: 16px;
font-weight: bold;
width: 40%;
overflow: hidden;
height: 32px;
text-align: right;
}

View File

@ -5,7 +5,7 @@
</ul> </ul>
</div> </div>
<div class="container" ng-controller="kibanaIntegrationController"> <div class="container" ng-controller="kibanaIntegrationController">
<h2 class="container_page_title">Agents metrics <span style="float: right; font-size: 16px; font-weight: bold;" ng-show="defMetricsFilter != ''">{{defMetricsFilter}}</span></h2> <h2 class="container_page_title">Agents metrics <span class="filterSpan" ng-show="defMetricsFilter != ''">{{defMetricsFilter}}</span></h2>
<div style="margin-bottom: 25px;"> <div style="margin-bottom: 25px;">
<label style="font-weight: bold;">Top 10 groups <a ng-href="{{getVisualization('TopGroups', defMetricsFilter, 'from:now-7d,mode:quick,to:now', true)}}" target="_blank"><span class="glyphicon glyphicon-share"></span></a></label> <label style="font-weight: bold;">Top 10 groups <a ng-href="{{getVisualization('TopGroups', defMetricsFilter, 'from:now-7d,mode:quick,to:now', true)}}" target="_blank"><span class="glyphicon glyphicon-share"></span></a></label>
<iframe ng-src="{{getVisualization('TopGroups', defMetricsFilter, 'from:now-7d,mode:quick,to:now', false)}}" height="350" width="100%"></iframe> <iframe ng-src="{{getVisualization('TopGroups', defMetricsFilter, 'from:now-7d,mode:quick,to:now', false)}}" height="350" width="100%"></iframe>

View File

@ -7,7 +7,7 @@
</ul> </ul>
</div> </div>
<div ng-controller="kibanaIntegrationController" style="height:100vh;"> <div ng-controller="kibanaIntegrationController" style="height:100vh;">
<h2 class="container_page_title" style="margin-left: 90px; margin-top: 30px; margin-right: 90px;">CIS Dashboard <a ng-href="{{getDashboard('CISCompliance', defDashboardFilter, 'from:now-7d,mode:quick,to:now', true)}}" target="_blank"><span class="glyphicon glyphicon-share"></span></a> <span style="float: right; font-size: 16px; font-weight: bold;" ng-show="defDashboardFilter != ''">{{defDashboardFilter}}</span></h2> <h2 class="container_page_title" style="margin-left: 90px; margin-top: 30px; margin-right: 90px;">CIS Dashboard <a ng-href="{{getDashboard('CISCompliance', defDashboardFilter, 'from:now-7d,mode:quick,to:now', true)}}" target="_blank"><span class="glyphicon glyphicon-share"></span></a> <span class="filterSpan" ng-show="defDashboardFilter != ''">{{defDashboardFilter}}</span></h2>
<div style="margin-bottom: 25px; height: 100%;"> <div style="margin-bottom: 25px; height: 100%;">
<iframe ng-src="{{getDashboard('CISCompliance', defDashboardFilter, 'from:now-7d,mode:quick,to:now', false)}}" height="100%" width="100%"></iframe> <iframe ng-src="{{getDashboard('CISCompliance', defDashboardFilter, 'from:now-7d,mode:quick,to:now', false)}}" height="100%" width="100%"></iframe>
</div> </div>

View File

@ -7,7 +7,7 @@
</ul> </ul>
</div> </div>
<div ng-controller="kibanaIntegrationController" style="height:100vh;"> <div ng-controller="kibanaIntegrationController" style="height:100vh;">
<h2 class="container_page_title" style="margin-left: 90px; margin-top: 30px; margin-right: 90px;">PCI Dashboard <a ng-href="{{getDashboard('PCICompliance', defDashboardFilter, 'from:now-7d,mode:quick,to:now', true)}}" target="_blank"><span class="glyphicon glyphicon-share"></span></a> <span style="float: right; font-size: 16px; font-weight: bold;" ng-show="defDashboardFilter != ''">{{defDashboardFilter}}</span></h2> <h2 class="container_page_title" style="margin-left: 90px; margin-top: 30px; margin-right: 90px;">PCI Dashboard <a ng-href="{{getDashboard('PCICompliance', defDashboardFilter, 'from:now-7d,mode:quick,to:now', true)}}" target="_blank"><span class="glyphicon glyphicon-share"></span></a> <span class="filterSpan" ng-show="defDashboardFilter != ''">{{defDashboardFilter}}</span></h2>
<div style="margin-bottom: 25px; height: 100%;"> <div style="margin-bottom: 25px; height: 100%;">
<iframe ng-src="{{getDashboard('PCICompliance', defDashboardFilter, 'from:now-7d,mode:quick,to:now', false)}}" height="100%" width="100%"></iframe> <iframe ng-src="{{getDashboard('PCICompliance', defDashboardFilter, 'from:now-7d,mode:quick,to:now', false)}}" height="100%" width="100%"></iframe>
</div> </div>

View File

@ -7,7 +7,7 @@
</ul> </ul>
</div> </div>
<div ng-controller="kibanaIntegrationController" style="height:100vh;"> <div ng-controller="kibanaIntegrationController" style="height:100vh;">
<h2 class="container_page_title" style="margin-left: 90px; margin-top: 30px; margin-right: 90px;">Rootcheck Dashboard <a ng-href="{{getDashboard('Rootcheck', defDashboardFilter, 'from:now-7d,mode:quick,to:now', true)}}" target="_blank"><span class="glyphicon glyphicon-share"></span></a> <span style="float: right; font-size: 16px; font-weight: bold;" ng-show="defDashboardFilter != ''">{{defDashboardFilter}}</span></h2> <h2 class="container_page_title" style="margin-left: 90px; margin-top: 30px; margin-right: 90px;">Rootcheck Dashboard <a ng-href="{{getDashboard('Rootcheck', defDashboardFilter, 'from:now-7d,mode:quick,to:now', true)}}" target="_blank"><span class="glyphicon glyphicon-share"></span></a> <span class="filterSpan" ng-show="defDashboardFilter != ''">{{defDashboardFilter}}</span></h2>
<div style="margin-bottom: 25px; height: 100%;"> <div style="margin-bottom: 25px; height: 100%;">
<iframe ng-src="{{getDashboard('Rootcheck', defDashboardFilter, 'from:now-7d,mode:quick,to:now', false)}}" height="100%" width="100%"></iframe> <iframe ng-src="{{getDashboard('Rootcheck', defDashboardFilter, 'from:now-7d,mode:quick,to:now', false)}}" height="100%" width="100%"></iframe>
</div> </div>

View File

@ -25,27 +25,24 @@
</form> </form>
</div> </div>
</div> </div>
<div style="margin-left: 10px; width: 20%; height: 35px; border-radius: 4px; background-color: rgb(249, 249, 249); border: 1px solid rgb(204, 204, 204); float: left; text-align: left;"> <div style="margin-left: 10px; width: 25%; height: 35px; border-radius: 4px; background-color: rgb(249, 249, 249); border: 1px solid rgb(204, 204, 204); float: left; text-align: left;">
<div ng-class="{ event_filter_status_active: $parent.statusFilter == 'outstanding' }" ng-click="setStatusFilter('outstanding')" style="font-weight: bold;border-right: 1px solid #ccc; border-radius: 0px;" <div ng-class="{ event_filter_status_active: $parent.statusFilter == 'outstanding' }" ng-click="setStatusFilter('outstanding')" style="font-weight: bold;border-right: 1px solid #ccc; border-radius: 0px; width: 60%;"
class="eventFilter">Outstanding </div> class="eventFilter">Outstanding </div>
<div ng-class="{ event_filter_status_active: $parent.statusFilter == 'solved' }" ng-click="setTypeFilter('solved')" style="font-weight: bold; border-right: 1px solid rgb(204, 204, 204); border-radius: 0px; width: 100.5px;" <div ng-class="{ event_filter_status_active: $parent.statusFilter == 'solved' }" ng-click="setTypeFilter('solved')" style="font-weight: bold; border-right: 1px solid rgb(204, 204, 204); border-radius: 0px; width: 40%;"
class="eventFilter">Solved</div> class="eventFilter">Resolved</div>
</div> </div>
<div class="rcContentTabs"> <div class="rcContentTabs">
<div id="eventsTab"> <div id="eventsTab">
<div class="events_card_list" ng-repeat="event in events"> <div class="events_card_list" ng-repeat="event in events">
<div class="event_card" ng-class="{ event_card_active: showDetails }" ng-click="showDetails = ! showDetails;"> <div class="event_card" ng-class="{ event_card_active: showDetails }" ng-click="showDetails = ! showDetails;">
<div class="float_left"> <div class="float_left" style="width: 70%;">
<div class="text" style="width: 460px; height: 45px; overflow: hidden; white-space: nowrap;">{{event.event}}</div> <div class="text" style="height: 45px; overflow: hidden; white-space: nowrap;">{{event.event}}</div>
</div>
<div class="float_left">
<div class="fimEvent">First scan: {{event.oldDay}}</div>
</div> </div>
<div class="float_right"> <div class="float_right">
<div ng-class='getStatusClass(event.status);' class="status" ng-style="{ 'border-bottom-right-radius' : (showDetails) ? '0px' : '4px' }"></div> <div ng-class='getStatusClass(event.status);' class="status" ng-style="{ 'border-bottom-right-radius' : (showDetails) ? '0px' : '4px' }"></div>
</div> </div>
<div class="float_right"> <div class="float_right" style="border-left: 1px solid #ccc;">
<div class="fimDate">Last scan: {{event.readDay}}</div> <div class="dates"><span class="upperDate">First scan: {{event.oldDay}}</span><span class="bottomDate" style="padding-left: 2px;">Last scan: {{event.readDay}}</span></div>
</div> </div>
</div> </div>
<div style="" class="event_card_detail" ng-show="showDetails"> <div style="" class="event_card_detail" ng-show="showDetails">
@ -55,7 +52,7 @@
<table class="table-event-information"> <table class="table-event-information">
<tbody> <tbody>
<tr> <tr>
<td class="table-event-information-td-value ng-binding">{{event.event}}</td> <td class="table-event-information-td-value ng-binding"><b>Full log: </b>{{event.event}}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -1,5 +1,5 @@
<div ng-controller="kibanaIntegrationController" style="height:100vh;"> <div ng-controller="kibanaIntegrationController" style="height:100vh;">
<h2 class="container_page_title" style="margin-left: 90px; margin-top: 30px; margin-right: 90px;">OSSEC dashboard <a ng-href="{{getDashboard('OSSECAlerts', defDashboardFilter, 'from:now-7d,mode:quick,to:now', true)}}" target="_blank"><span class="glyphicon glyphicon-share"></span></a> <span style="float: right; font-size: 16px; font-weight: bold;" ng-show="defDashboardFilter != ''">{{defDashboardFilter}}</span></h2> <h2 class="container_page_title" style="margin-left: 90px; margin-top: 30px; margin-right: 90px;">OSSEC dashboard <a ng-href="{{getDashboard('OSSECAlerts', defDashboardFilter, 'from:now-7d,mode:quick,to:now', true)}}" target="_blank"><span class="glyphicon glyphicon-share"></span></a> <span class="filterSpan" ng-show="defDashboardFilter != ''">{{defDashboardFilter}}</span></h2>
<div style="margin-bottom: 25px; height: 100%;"> <div style="margin-bottom: 25px; height: 100%;">
<iframe ng-src="{{getDashboard('OSSECAlerts', defDashboardFilter, 'from:now-7d,mode:quick,to:now', false)}}" height="100%" width="100%"></iframe> <iframe ng-src="{{getDashboard('OSSECAlerts', defDashboardFilter, 'from:now-7d,mode:quick,to:now', false)}}" height="100%" width="100%"></iframe>
</div> </div>

View File

@ -5,7 +5,7 @@
</ul> </ul>
</div> </div>
<div ng-controller="kibanaIntegrationController" style="height:100vh;"> <div ng-controller="kibanaIntegrationController" style="height:100vh;">
<h2 class="container_page_title" style="margin-left: 90px; margin-top: 30px; margin-right: 90px;">FIM Dashboard <a ng-href="{{getDashboard('fim', defDashboardFilter, 'from:now-7d,mode:quick,to:now', true)}}" target="_blank"><span class="glyphicon glyphicon-share"></span></a> <span style="float: right; font-size: 16px; font-weight: bold;" ng-show="defDashboardFilter != ''">{{defDashboardFilter}}</span></h2> <h2 class="container_page_title" style="margin-left: 90px; margin-top: 30px; margin-right: 90px;">FIM Dashboard <a ng-href="{{getDashboard('fim', defDashboardFilter, 'from:now-7d,mode:quick,to:now', true)}}" target="_blank"><span class="glyphicon glyphicon-share"></span></a> <span class="filterSpan" ng-show="defDashboardFilter != ''">{{defDashboardFilter}}</span></h2>
<div style="margin-bottom: 25px; height: 100%;"> <div style="margin-bottom: 25px; height: 100%;">
<iframe ng-src="{{getDashboard('fim', defDashboardFilter, 'from:now-7d,mode:quick,to:now', false)}}" height="100%" width="100%"></iframe> <iframe ng-src="{{getDashboard('fim', defDashboardFilter, 'from:now-7d,mode:quick,to:now', false)}}" height="100%" width="100%"></iframe>
</div> </div>