mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-07 18:28:55 +00:00
Merge branch '2.1' of github.com:wazuh/wazuh-kibana-app-dev into adding-os-version-49
Conflicts: public/controllers/agentsPreview.js
This commit is contained in:
commit
91f3cf8cc8
13
CHANGELOG.md
Normal file
13
CHANGELOG.md
Normal file
@ -0,0 +1,13 @@
|
||||
# Change Log
|
||||
All notable changes to this project will be documented in this file
|
||||
|
||||
## [v2.0.1]
|
||||
|
||||
### Changed
|
||||
- New index in Elasticsearch to save Wazuh set up configuration
|
||||
- Short URL's is now supported
|
||||
- Native base path from kibana.yml is now supported
|
||||
|
||||
### Fixed
|
||||
- Searchbar across panels now support parenthesis groupping
|
||||
- Several CSS fixes for IE browser
|
23
README.md
23
README.md
@ -9,16 +9,19 @@
|
||||
|
||||
## Installation
|
||||
|
||||
| Kibana version | Installation |
|
||||
| :---: | :--- |
|
||||
| 5.2.2 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.2.2.zip |
|
||||
| 5.3.0 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.3.0.zip |
|
||||
| 5.3.1 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.3.1.zip |
|
||||
| 5.4.0 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.4.0.zip |
|
||||
| 5.4.1 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.4.1.zip |
|
||||
| 5.4.2 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.4.2.zip |
|
||||
| 5.4.3 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.4.3.zip |
|
||||
| 5.5.0 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.5.0.zip |
|
||||
| Kibana version | Wazuh App version | Installation |
|
||||
| :---: | :---: | :--- |
|
||||
| 5.2.2 | 2.0 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.2.2.zip |
|
||||
| 5.3.0 | 2.0 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.3.0.zip |
|
||||
| 5.3.1 | 2.0 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.3.1.zip |
|
||||
| 5.4.0 | 2.0 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.4.0.zip |
|
||||
| 5.4.1 | 2.0 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.4.1.zip |
|
||||
| 5.4.2 | 2.0 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.4.2.zip |
|
||||
| 5.4.3 | 2.0 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.4.3.zip |
|
||||
| 5.5.0 | 2.0 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0_5.5.0.zip |
|
||||
| 5.5.0 | 2.0.1 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0.1_5.5.0.zip |
|
||||
| 5.5.1 | 2.0.1 | /usr/share/kibana/bin/kibana-plugin install https://packages.wazuh.com/wazuhapp/wazuhapp-2.0.1_5.5.1.zip |
|
||||
|
||||
## Upgrade
|
||||
|
||||
Remove the App using kibana-plugin tool
|
||||
|
@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "wazuh",
|
||||
"version": "2.1.0",
|
||||
"revision": "0337",
|
||||
"revision": "0342",
|
||||
"kibana": {
|
||||
"version" : "5.5.0"
|
||||
"version": "5.5.1"
|
||||
},
|
||||
"description": "Wazuh App",
|
||||
"main": "index.js",
|
||||
@ -29,7 +29,9 @@
|
||||
"angular-material": "1.1.1",
|
||||
"angular-md5": "^0.1.10",
|
||||
"bootstrap": "3.3.6",
|
||||
"install": "^0.10.1",
|
||||
"needle": "^1.0.0",
|
||||
"node-cron": "^1.1.2"
|
||||
"node-cron": "^1.1.2",
|
||||
"npm": "^5.3.0"
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ app.controller('agentsController', function ($scope, $q, DataFactory, Notifier,
|
||||
$scope._status = 'all';
|
||||
$scope._osPlatform = 'all';
|
||||
$scope._osVersion = 'all';
|
||||
$scope._bulkOperation = 'nothing';
|
||||
$scope.defaultManager = $scope.state.getDefaultManager().name;
|
||||
$scope.extensions = $scope.state.getExtensions().extensions;
|
||||
$scope.results = false;
|
||||
@ -148,8 +149,9 @@ app.controller('agentsController', function ($scope, $q, DataFactory, Notifier,
|
||||
|
||||
$scope.applyAgent = function (agent) {
|
||||
if (agent) {
|
||||
$scope.load = true;
|
||||
if($scope.submenuNavItem == 'preview'){
|
||||
$scope.submenuNavItem = 'overview';
|
||||
$scope.submenuNavItem = 'overview';
|
||||
$location.search('tab', $scope.submenuNavItem);
|
||||
}
|
||||
$scope.agentInfo = {};
|
||||
@ -241,7 +243,7 @@ app.controller('agentsController', function ($scope, $q, DataFactory, Notifier,
|
||||
}else{
|
||||
gParameter = $route.current.params._g;
|
||||
}
|
||||
if(gParameter != "()" && gParametercurrentTimeFilter.time && ($scope.timeGTE != currentTimeFilter.time.from || $scope.timeLT != currentTimeFilter.time.to)){
|
||||
if(gParameter != "()" && ($scope.timeGTE != currentTimeFilter.time.from || $scope.timeLT != currentTimeFilter.time.to)){
|
||||
$scope.timeGTE = currentTimeFilter.time.from;
|
||||
$scope.timeLT = currentTimeFilter.time.to;
|
||||
|
||||
|
@ -29,8 +29,7 @@ app.factory('Agents', function($http, DataFactory) {
|
||||
return Agents;
|
||||
});
|
||||
|
||||
app.controller('agentsPreviewController', function ($scope, DataFactory, Notifier, errlog, genericReq, Agents) {
|
||||
|
||||
app.controller('agentsPreviewController', function ($scope, $mdDialog, DataFactory, Notifier, errlog, genericReq, Agents, apiReq) {
|
||||
$scope.load = true;
|
||||
$scope.agents = [];
|
||||
$scope._status = 'all';
|
||||
@ -39,6 +38,12 @@ app.controller('agentsPreviewController', function ($scope, DataFactory, Notifie
|
||||
$scope.mostActiveAgent = {"name" : "", "id" : ""};
|
||||
$scope.osPlatforms = [];
|
||||
$scope.osVersions = new Set();
|
||||
$scope.agentsStatus = false;
|
||||
$scope.newAgent = {
|
||||
'name': '', 'ip': ''
|
||||
};
|
||||
$scope.newAgentKey = '';
|
||||
|
||||
const notify = new Notifier({location: 'Agents - Preview'});
|
||||
|
||||
var objectsArray = [];
|
||||
@ -131,7 +136,140 @@ app.controller('agentsPreviewController', function ($scope, DataFactory, Notifie
|
||||
|
||||
};
|
||||
|
||||
function bulkOperation(operation){
|
||||
var selectedAgents = [];
|
||||
angular.forEach($scope.agents.items, function(agent){
|
||||
if(agent.selected){
|
||||
selectedAgents.push(agent.id);
|
||||
}
|
||||
});
|
||||
var requestData = {
|
||||
'ids': selectedAgents
|
||||
}
|
||||
if(selectedAgents.length > 0){
|
||||
switch (operation){
|
||||
case "delete":
|
||||
apiReq.request('DELETE', '/agents', requestData)
|
||||
.then(function (data) {
|
||||
if(data.data.ids.length!=0){
|
||||
data.data.ids.forEach(function(id) {
|
||||
notify.error('The agent ' + id + ' was not deleted.');
|
||||
});
|
||||
}
|
||||
else{
|
||||
notify.info(data.data.msg);
|
||||
}
|
||||
load();
|
||||
}, printError);
|
||||
break;
|
||||
|
||||
case "restart":
|
||||
apiReq.request('POST', '/agents/restart', requestData)
|
||||
.then(function (data) {
|
||||
if(data.data.ids.length!=0){
|
||||
data.data.ids.forEach(function(id) {
|
||||
notify.error('The agent ' + id + ' was not restarted.');
|
||||
});
|
||||
}
|
||||
else{
|
||||
notify.info(data.data.msg);
|
||||
}
|
||||
load();
|
||||
}, printError);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$scope.$parent._bulkOperation="nothing";
|
||||
}
|
||||
|
||||
$scope.changeAgentsStatus = function (){
|
||||
angular.forEach($scope.agents.items, function(agent){
|
||||
agent.selected = $scope.agentsStatus;
|
||||
});
|
||||
}
|
||||
|
||||
$scope.saveNewAgent = function (){
|
||||
if($scope.newAgent.name != '') {
|
||||
var requestData = {
|
||||
'name': $scope.newAgent.name,
|
||||
'ip': $scope.newAgent.ip == '' ? 'any' : $scope.newAgent.ip
|
||||
}
|
||||
apiReq.request('POST', '/agents', requestData)
|
||||
.then(function (data) {
|
||||
if(data.error=='0'){
|
||||
notify.info('The agent was added successfully.');
|
||||
apiReq.request('GET', '/agents/' + data.data + '/key', {})
|
||||
.then(function(data) {
|
||||
$scope.newAgentKey = data.data;
|
||||
load();
|
||||
});
|
||||
}
|
||||
else{
|
||||
$scope.hidePrerenderedDialog();
|
||||
notify.error('There was an error adding the new agent.');
|
||||
}
|
||||
},
|
||||
function(error){
|
||||
printError(error);
|
||||
$scope.hidePrerenderedDialog();
|
||||
});
|
||||
}
|
||||
else{
|
||||
$scope.hidePrerenderedDialog();
|
||||
notify.error('The agent name is mandatory.');
|
||||
}
|
||||
}
|
||||
|
||||
$scope.showNewAgentDialog = function(ev) {
|
||||
$mdDialog.show({
|
||||
contentElement: '#newAgentDialog',
|
||||
parent: angular.element(document.body),
|
||||
targetEvent: ev,
|
||||
clickOutsideToClose: true
|
||||
});
|
||||
};
|
||||
|
||||
$scope.showDeletePrompt = function(ev) {
|
||||
// Appending dialog to document.body to cover sidenav in docs app
|
||||
var confirm = $mdDialog.prompt()
|
||||
.title('Remove selected agents')
|
||||
.textContent('Write REMOVE to remove all the selected agents. CAUTION! This action can not be undone.')
|
||||
.targetEvent(ev)
|
||||
.ok('Remove')
|
||||
.cancel('Close');
|
||||
|
||||
$mdDialog.show(confirm).then(function(result) {
|
||||
if(result==='REMOVE'){
|
||||
bulkOperation('delete');
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
$scope.showRestartConfirm = function(ev) {
|
||||
// Appending dialog to document.body to cover sidenav in docs app
|
||||
var confirm = $mdDialog.confirm()
|
||||
.title('Restart agents')
|
||||
.textContent('Confirm to restart all the selected agents.')
|
||||
.targetEvent(ev)
|
||||
.ok('Restart')
|
||||
.cancel('Close');
|
||||
|
||||
$mdDialog.show(confirm).then(function() {
|
||||
bulkOperation('restart');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.hidePrerenderedDialog = function(ev) {
|
||||
$scope.newAgentKey = '';
|
||||
$mdDialog.hide('#newAgentDialog');
|
||||
};
|
||||
|
||||
var load = function () {
|
||||
$scope.newAgent = {
|
||||
'name': '', 'ip': ''
|
||||
};
|
||||
$scope.agentsStatus = false;
|
||||
|
||||
DataFactory.initialize('get', '/agents', {}, 30, 0)
|
||||
.then(function (data) {
|
||||
objectsArray['/agents'] = data;
|
||||
|
@ -104,7 +104,7 @@ app.controller('overviewController', function ($scope, appState, $window, generi
|
||||
|
||||
// Watchers
|
||||
$scope.$watch('tabView', function() {
|
||||
$location.search('view', $scope.tabView);
|
||||
$location.search('view', $scope.tabView);
|
||||
});
|
||||
|
||||
// Watch for timefilter changes
|
||||
|
@ -153,7 +153,7 @@ app.controller('settingsController', function ($scope, $http, testConnection, ap
|
||||
testConnection.check(tmpData).then(function (data) {
|
||||
tmpData.manager = data;
|
||||
var index = $scope.apiEntries.indexOf(item);
|
||||
genericReq.request('PUT', '/api/wazuh-api/updateApiHostname/' + $scope.apiEntries[index]._id).then(function (data) {
|
||||
genericReq.request('PUT', '/api/wazuh-api/updateApiHostname/' + $scope.apiEntries[index]._id, {"manager":tmpData.manager}).then(function (data) {
|
||||
$scope.apiEntries[index]._source.manager = tmpData.manager;
|
||||
});
|
||||
notify.info("Connection success");
|
||||
@ -210,14 +210,14 @@ app.controller('settingsController', function ($scope, $http, testConnection, ap
|
||||
};
|
||||
|
||||
$scope.getAppInfo = function () {
|
||||
genericReq.request('GET', '/elasticsearch/.kibana/wazuh-setup/1').then(function (data, status) {
|
||||
$http.get("/api/wazuh-elastic/setup").success(function (data, status) {
|
||||
$scope.appInfo = {};
|
||||
$scope.appInfo["app-version"] = data._source["app-version"];
|
||||
$scope.appInfo["installationDate"] = data._source["installationDate"];
|
||||
$scope.appInfo["revision"] = data._source["revision"];
|
||||
}, function (data, status) {
|
||||
notify.error("Error when loading Wazuh setup info" + basePath);
|
||||
});
|
||||
$scope.appInfo["app-version"] = data.data["app-version"];
|
||||
$scope.appInfo["installationDate"] = data.data["installationDate"];
|
||||
$scope.appInfo["revision"] = data.data["revision"];
|
||||
}).error(function (data, status) {
|
||||
notify.error("Error when loading Wazuh setup info");
|
||||
})
|
||||
}
|
||||
|
||||
// Loading data
|
||||
|
@ -1,10 +1,8 @@
|
||||
require('plugins/kibana/discover/styles/main.less');
|
||||
require('ui/doc_table/doc_table.js');
|
||||
require('ui/styles/sidebar.less');
|
||||
require('ui/styles/table.less');
|
||||
require('ui/doc_viewer/doc_viewer.js');
|
||||
require('ui/doc_title/doc_title.js');
|
||||
require('ui/styles/truncate.less');
|
||||
require('ui/style_compile/style_compile.js');
|
||||
require('ui/registry/doc_views.js');
|
||||
require('plugins/kbn_doc_views/kbn_doc_views.js');
|
||||
@ -36,11 +34,12 @@ import PluginsKibanaDiscoverHitSortFnProvider from 'plugins/kibana/discover/_hit
|
||||
import { FilterBarQueryFilterProvider } from 'ui/filter_bar/query_filter';
|
||||
import { FilterManagerProvider } from 'ui/filter_manager';
|
||||
import { AggTypesBucketsIntervalOptionsProvider } from 'ui/agg_types/buckets/_interval_options';
|
||||
import { uiRoutes } from 'ui/routes';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import { indexTemplate } from 'plugins/wazuh/templates/directives/dis-template.html';
|
||||
import { StateProvider } from 'ui/state_management/state';
|
||||
import { stateMonitorFactory } from 'ui/state_management/state_monitor_factory';
|
||||
import uiRoutes from 'ui/routes';
|
||||
import { uiModules } from 'ui/modules';
|
||||
import indexTemplate from 'plugins/wazuh/templates/directives/dis-template.html';
|
||||
import { StateProvider } from 'ui/state_management/state';
|
||||
import { documentationLinks } from 'ui/documentation_links/documentation_links';
|
||||
import * as columnActions from 'ui/doc_table/actions/columns';
|
||||
import 'ui/debounce';
|
||||
import 'plugins/kibana/discover/saved_searches/saved_searches';
|
||||
@ -48,15 +47,17 @@ import 'plugins/kibana/discover/directives/no_results';
|
||||
import 'plugins/kibana/discover/directives/timechart';
|
||||
import 'ui/collapsible_sidebar';
|
||||
import 'plugins/kibana/discover/components/field_chooser/field_chooser';
|
||||
import 'plugins/kibana/discover/controllers/discover';
|
||||
import 'plugins/kibana/discover/styles/main.less';
|
||||
import 'ui/doc_table/components/table_row';
|
||||
|
||||
import { SavedObjectRegistryProvider } from 'ui/saved_objects/saved_object_registry';
|
||||
import { savedSearchProvider } from 'plugins/kibana/discover/saved_searches/saved_search_register';
|
||||
|
||||
SavedObjectRegistryProvider.register(require('plugins/kibana/discover/saved_searches/saved_search_register'));
|
||||
SavedObjectRegistryProvider.register(savedSearchProvider);
|
||||
|
||||
var app = require('ui/modules').get('app/wazuh', [])
|
||||
.directive('kbnDis', [function() {
|
||||
|
||||
var app = uiModules.get('app/wazuh', [])
|
||||
.directive('kbnDis', [function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
scope: {
|
||||
@ -71,7 +72,7 @@ var app = require('ui/modules').get('app/wazuh', [])
|
||||
}
|
||||
}]);
|
||||
|
||||
var app = require('ui/modules').get('app/wazuh', [])
|
||||
var app = uiModules.get('app/wazuh', [])
|
||||
.directive('kbnDisfull', [function() {
|
||||
return {
|
||||
restrict: 'E',
|
||||
@ -88,11 +89,10 @@ var app = require('ui/modules').get('app/wazuh', [])
|
||||
|
||||
|
||||
|
||||
require('ui/modules').get('app/wazuh', []).controller('discoverW', function($scope, config, courier, $route, $window, Notifier,
|
||||
uiModules.get('app/wazuh', []).controller('discoverW', function($scope, config, courier, $route, $window, Notifier,
|
||||
AppState, timefilter, Promise, Private, kbnUrl, $location, savedSearches, appState, $rootScope, getAppState) {
|
||||
|
||||
$scope.defaultManagerName = appState.getDefaultManager().name;
|
||||
|
||||
$scope.stateQuery = $scope.disFilter;
|
||||
$scope.chrome = {};
|
||||
$scope.removeColumn = function removeColumn(columnName) {
|
||||
@ -145,6 +145,7 @@ require('ui/modules').get('app/wazuh', []).controller('discoverW', function($sco
|
||||
const queryFilter = Private(FilterBarQueryFilterProvider);
|
||||
const filterManager = Private(FilterManagerProvider);
|
||||
|
||||
$scope.queryDocLinks = documentationLinks.query;
|
||||
$scope.intervalOptions = Private(AggTypesBucketsIntervalOptionsProvider);
|
||||
$scope.showInterval = false;
|
||||
|
||||
@ -197,23 +198,25 @@ require('ui/modules').get('app/wazuh', []).controller('discoverW', function($sco
|
||||
$scope.state.sort = disDecoded.sort.length > 0 ? disDecoded.sort : getSort.array(savedSearch.sort, $scope.indexPattern);
|
||||
}
|
||||
|
||||
const $appStatus = $scope.appStatus = {};
|
||||
let stateMonitor;
|
||||
const $appStatus = $scope.appStatus = {
|
||||
dirty: !savedSearch.id
|
||||
};
|
||||
const $state = $scope.state;
|
||||
$scope.uiState = $state.makeStateful('uiState');
|
||||
$scope.uiState.set('vis.legendOpen', false);
|
||||
$state.query = ($scope.stateQuery ? $scope.stateQuery : '*');
|
||||
|
||||
function getStateDefaults() {
|
||||
return {
|
||||
query: $scope.disFilter ? $scope.disFilter : '',
|
||||
sort: disDecoded.sort.length > 0 ? disDecoded.sort : getSort.array(savedSearch.sort, $scope.indexPattern),
|
||||
columns: disDecoded.columns.length > 0 ? disDecoded.columns : config.get('defaultColumns'),
|
||||
index: disDecoded.index ? disDecoded.index : $scope.indexPattern.id,
|
||||
interval: 'auto',
|
||||
filters: _.cloneDeep($scope.searchSource.getOwn('filter'))
|
||||
};
|
||||
}
|
||||
return {
|
||||
query: $scope.searchSource.get('query') || '',
|
||||
sort: getSort.array(savedSearch.sort, $scope.indexPattern),
|
||||
columns: savedSearch.columns.length > 0 ? savedSearch.columns : config.get('defaultColumns').slice(),
|
||||
index: $scope.indexPattern.id,
|
||||
interval: 'auto',
|
||||
filters: _.cloneDeep($scope.searchSource.getOwn('filter'))
|
||||
};
|
||||
}
|
||||
|
||||
$state.index = $scope.indexPattern.id;
|
||||
$state.sort = getSort.array($state.sort, $scope.indexPattern);
|
||||
@ -241,7 +244,7 @@ require('ui/modules').get('app/wazuh', []).controller('discoverW', function($sco
|
||||
|
||||
stateMonitor = stateMonitorFactory.create($state, getStateDefaults());
|
||||
stateMonitor.onChange((status) => {
|
||||
$appStatus.dirty = status.dirty;
|
||||
$appStatus.dirty = status.dirty || !savedSearch.id;
|
||||
});
|
||||
$scope.$on('$destroy', () => stateMonitor.destroy());
|
||||
|
||||
|
@ -47,7 +47,7 @@ import UtilsBrushEventProvider from 'ui/utils/brush_event';
|
||||
|
||||
import FilterBarFilterBarClickHandlerProvider from 'ui/filter_bar/filter_bar_click_handler';
|
||||
import uiRoutes from 'ui/routes';
|
||||
import uiModules from 'ui/modules';
|
||||
import { uiModules } from 'ui/modules';
|
||||
|
||||
import 'ui/state_management/app_state';
|
||||
import StateManagementAppStateProvider from 'ui/state_management/app_state';
|
||||
|
@ -3,10 +3,96 @@ body{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.md-button.md-fab {
|
||||
line-height: 5.6rem;
|
||||
min-width: 0;
|
||||
width: 5.6rem;
|
||||
height: 5.6rem;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.md-button.md-fab md-icon{
|
||||
color: white;
|
||||
}
|
||||
|
||||
div.agent-buttons {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
margin: 30px;
|
||||
z-index: 5;
|
||||
}
|
||||
.md-button.add-agent-icon {
|
||||
position:relative;
|
||||
margin: 0 10px 20px 0;
|
||||
}
|
||||
|
||||
.md-button.delete-agent-icon {
|
||||
background-color: #e8488b;
|
||||
position: relative;
|
||||
margin: 0 30px 20px 0;
|
||||
}
|
||||
|
||||
.md-button.restart-agent-icon {
|
||||
background-color: #7e3cd3;
|
||||
position: relative;
|
||||
margin: 0 10px 20px 0;
|
||||
}
|
||||
|
||||
.new-agent-key{
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
.top-bulk-action {
|
||||
margin-bottom:17px
|
||||
}
|
||||
|
||||
.sidebar-container {
|
||||
font-family: "Open Sans", Helvetica, Arial, sans-serif
|
||||
}
|
||||
kbn-vis-value table{
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
kbn-vis-value div{
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.filter-bar {
|
||||
background-color: #e4e4e4 !important;
|
||||
}
|
||||
|
||||
.fa-search-plus, .fa-search-minus {
|
||||
font-size: initial !important;
|
||||
}
|
||||
|
||||
.md-input-margin {
|
||||
margin:18px 20px 0 0
|
||||
}
|
||||
|
||||
.md-input-margin {
|
||||
margin: 18px 20px 0 0
|
||||
}
|
||||
|
||||
.vis-editor-content text, h2.index-pattern-label{
|
||||
font-weight: normal !important;
|
||||
}
|
||||
|
||||
.wazuh-discover-searchbar{
|
||||
margin-top: -60px !important;
|
||||
z-index:9999;
|
||||
}
|
||||
|
||||
.wazuh-discover-searchbar h1{
|
||||
padding-bottom: 10px !important;
|
||||
}
|
||||
|
||||
.wazuh-searchbar navbar{
|
||||
margin-top: -40px !important;
|
||||
}
|
||||
|
||||
.no-legend visualize-legend{
|
||||
visibility: hidden;
|
||||
width: 0px;
|
||||
@ -54,7 +140,7 @@ span.md-headline {
|
||||
.md-headline-small{
|
||||
font-size: 18px;
|
||||
}
|
||||
.h3, h3 {
|
||||
.wazuh-h3 {
|
||||
font-size: 18px !important;
|
||||
font-weight: 400 !important;
|
||||
}
|
||||
@ -448,7 +534,7 @@ md-toolbar.md-default-theme:not(.md-menu-toolbar), md-toolbar:not(.md-menu-toolb
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.md-toolbar-tools h1, .md-toolbar-tools h2, .md-toolbar-tools h3 {
|
||||
.md-toolbar-tools h1, .md-toolbar-tools .wazuh-h2, .md-toolbar-tools h3 {
|
||||
font-size: inherit;
|
||||
font-weight: 500;
|
||||
text-transform: uppercase;
|
||||
@ -592,9 +678,10 @@ md-autocomplete input:-ms-input-placeholder {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.h1, h1 {
|
||||
.wazuh-h1 {
|
||||
font-size: 24px !important;
|
||||
}
|
||||
|
||||
md-chips.md-default-theme .md-chips, md-chips .md-chips {
|
||||
box-shadow: none;
|
||||
}
|
||||
@ -813,10 +900,6 @@ md-select-menu.md-default-theme md-content md-option:not([disabled]):focus, md-s
|
||||
svg:not(:root) {
|
||||
overflow: visible !important;
|
||||
}
|
||||
.localBreadcrumbs {
|
||||
margin-left: 13px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
md-tooltip.md-default-theme, md-tooltip {
|
||||
color: white;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@ require('ui/modules').get('app/wazuh', [])
|
||||
'details': details
|
||||
}
|
||||
|
||||
$http.post('/api/wazuh-api/errlog', requestData)
|
||||
$http.post(chrome.addBasePath('/api/wazuh-api/errlog'), requestData)
|
||||
.success(function () {
|
||||
defered.resolve();
|
||||
}).error(function (data) {
|
||||
|
@ -16,14 +16,14 @@ require('ui/modules').get('app/wazuh', [])
|
||||
if (method == "GET") {
|
||||
$http.get(chrome.addBasePath(url), requestHeaders)
|
||||
.success(function (data) {
|
||||
if (data.error) {
|
||||
if (data.error && data.error != '0') {
|
||||
defered.reject(data);
|
||||
} else {
|
||||
defered.resolve(data);
|
||||
}
|
||||
})
|
||||
.error(function (data) {
|
||||
if (data.error) {
|
||||
if (data.error && data.error != '0') {
|
||||
defered.reject(data);
|
||||
} else {
|
||||
defered.reject({ 'error': -2, 'message': 'Error doing a request to Kibana API.' });
|
||||
@ -33,14 +33,14 @@ require('ui/modules').get('app/wazuh', [])
|
||||
if (method == "PUT") {
|
||||
$http.put(chrome.addBasePath(url), payload, requestHeaders)
|
||||
.success(function (data) {
|
||||
if (data.error) {
|
||||
if (data.error && data.error != '0') {
|
||||
defered.reject(data);
|
||||
} else {
|
||||
defered.resolve(data);
|
||||
}
|
||||
})
|
||||
.error(function (data) {
|
||||
if (data.error) {
|
||||
if (data.error && data.error != '0') {
|
||||
defered.reject(data);
|
||||
} else {
|
||||
defered.reject({ 'error': -2, 'message': 'Error doing a request to Kibana API.' });
|
||||
@ -50,14 +50,14 @@ require('ui/modules').get('app/wazuh', [])
|
||||
if (method == "POST") {
|
||||
$http.post(chrome.addBasePath(url), payload, requestHeaders)
|
||||
.success(function (data) {
|
||||
if (data.error) {
|
||||
if (data.error && data.error != '0') {
|
||||
defered.reject(data);
|
||||
} else {
|
||||
defered.resolve(data);
|
||||
}
|
||||
})
|
||||
.error(function (data) {
|
||||
if (data.error) {
|
||||
if (data.error && data.error != '0') {
|
||||
defered.reject(data);
|
||||
} else {
|
||||
defered.reject({ 'error': -2, 'message': 'Error doing a request to Kibana API.' });
|
||||
@ -68,14 +68,14 @@ require('ui/modules').get('app/wazuh', [])
|
||||
if (method == "DELETE") {
|
||||
$http.delete(chrome.addBasePath(url))
|
||||
.success(function (data) {
|
||||
if (data.error) {
|
||||
if (data.error && data.error != '0') {
|
||||
defered.reject(data);
|
||||
} else {
|
||||
defered.resolve(data);
|
||||
}
|
||||
})
|
||||
.error(function (data) {
|
||||
if (data.error) {
|
||||
if (data.error && data.error != '0') {
|
||||
defered.reject(data);
|
||||
} else {
|
||||
defered.reject({ 'error': -2, 'message': 'Error doing a request to Kibana API.' });
|
||||
|
@ -5,8 +5,7 @@ require('ui/modules').get('app/wazuh', [])
|
||||
check_stored: function () {
|
||||
var defered = $q.defer();
|
||||
var promise = defered.promise;
|
||||
|
||||
$http.get("/api/wazuh-api/check")
|
||||
$http.get(chrome.addBasePath("/api/wazuh-api/check"))
|
||||
.success(function (data) {
|
||||
if (data.error) {
|
||||
defered.reject(data);
|
||||
@ -22,7 +21,7 @@ require('ui/modules').get('app/wazuh', [])
|
||||
check: function (data) {
|
||||
var defered = $q.defer();
|
||||
var promise = defered.promise;
|
||||
$http.post("/api/wazuh-api/check", data)
|
||||
$http.post(chrome.addBasePath("/api/wazuh-api/check"), data)
|
||||
.success(function (data) {
|
||||
if (data.error) {
|
||||
defered.reject(data);
|
||||
|
@ -1,7 +1,7 @@
|
||||
<md-content ng-if="submenuNavItem == 'audit' && _agent" id="agents-audit" ng-controller="auditController">
|
||||
|
||||
<!-- Kibana search bar -->
|
||||
<kbn-searchbar ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
<kbn-searchbar class="wazuh-searchbar" ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
|
||||
<!-- No results message -->
|
||||
<md-content flex layout="row" layout-align="start start" ng-if="!results && tabView == 'panels'">
|
||||
@ -14,14 +14,14 @@
|
||||
|
||||
|
||||
<!-- View: Discover -->
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-if="tabView == 'discover'" >
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-show="tabView == 'discover'" >
|
||||
<kbn-disfull table-height="1000px;" dis-a="(columns:!(_source),filters:!(),index:'wazuh-alerts-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!('@timestamp',desc))"
|
||||
dis-filter="rule.groups:audit AND agent.name: {{_agent.name ? _agent.name : '*'}} AND manager.name: {{defaultManager ? defaultManager : '*'}}"
|
||||
infinite-scroll="true">
|
||||
</kbn-disfull>
|
||||
</md-content>
|
||||
|
||||
<div flex ng-if="tabView == 'panels' && results" layout="column">
|
||||
<div flex ng-if="tabView == 'panels' && results && !load" layout="column">
|
||||
<md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="load"></md-progress-linear>
|
||||
<md-content layout="row" layout-align="center stretch" class="no-legend">
|
||||
<md-card flex="10" layout="column">
|
||||
|
@ -1,7 +1,7 @@
|
||||
<md-content ng-if="submenuNavItem == 'fim' && _agent" id="agents-fim" ng-controller="fimController">
|
||||
|
||||
<!-- Kibana search bar -->
|
||||
<kbn-searchbar ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
<kbn-searchbar class="wazuh-searchbar" ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
|
||||
<!-- No results message -->
|
||||
<md-content flex layout="row" layout-align="start start" ng-if="!results && tabView == 'panels'">
|
||||
@ -21,7 +21,7 @@
|
||||
</md-content>
|
||||
|
||||
<!-- View: Panels -->
|
||||
<div flex layout="column" ng-if="tabView == 'panels' && results">
|
||||
<div flex layout="column" ng-if="tabView == 'panels' && results && !load">
|
||||
<md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="load"></md-progress-linear>
|
||||
<md-content layout="row">
|
||||
<md-card flex="33">
|
||||
|
@ -1,7 +1,7 @@
|
||||
<md-content ng-if="submenuNavItem == 'oscap' && _agent" id="agents-oscap" ng-controller="oscapController">
|
||||
|
||||
<!-- Kibana search bar -->
|
||||
<kbn-searchbar ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
<kbn-searchbar class="wazuh-searchbar" ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
|
||||
<!-- No results message -->
|
||||
<md-content flex layout="row" layout-align="start start" ng-if="!results && tabView == 'panels'">
|
||||
@ -14,14 +14,14 @@
|
||||
|
||||
|
||||
<!-- View: Discover -->
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-if="tabView == 'discover'" >
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-show="tabView == 'discover'" >
|
||||
<kbn-disfull table-height="1000px;" dis-a="(columns:!(_source),filters:!(),index:'wazuh-alerts-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!('@timestamp',desc))"
|
||||
dis-filter="rule.groups:oscap AND agent.name: {{_agent.name ? _agent.name : '*'}} AND manager.name: {{defaultManager ? defaultManager : '*'}}"
|
||||
infinite-scroll="true">
|
||||
</kbn-disfull>
|
||||
</md-content>
|
||||
|
||||
<div flex ng-if="tabView == 'panels' && results" layout="column">
|
||||
<div flex ng-if="tabView == 'panels' && results && !load" layout="column">
|
||||
<md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="load"></md-progress-linear>
|
||||
<md-content layout="row" layout-align="center stretch" class="no-legend">
|
||||
<md-card flex="20" layout="column">
|
||||
@ -147,7 +147,7 @@
|
||||
|
||||
</md-content>
|
||||
|
||||
<md-content layout="row" layout-align="center stretch" >
|
||||
<md-content layout="row" layout-align="center stretch" class="no-legend">
|
||||
<md-card flex="100" layout="column">
|
||||
<md-card-content style="text-align: center;">
|
||||
<kbn-vis-value vis-height="44px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'*')),uiState:(vis:(params:(sort:(columnIndex:!n,direction:!n)))),vis:(aggs:!((enabled:!t,id:'1',params:(),schema:metric,type:count),(enabled:!t,id:'2',params:(field:oscap.check.title,order:desc,orderBy:'1',size:1),schema:bucket,type:terms)),listeners:(),params:(perPage:1,showMeticsAtAllLevels:!f,showPartialRows:!f,showTotal:!f,sort:(columnIndex:!n,direction:!n),totalFunc:sum),title:'New%20Visualization',type:table))" vis-filter="oscap.check.result: fail AND rule.groups:oscap AND agent.name: {{_agent.name ? _agent.name : '*'}}">
|
||||
|
@ -1,10 +1,10 @@
|
||||
<md-content ng-if="submenuNavItem == 'overview' && agentInfo" ng-controller="agentsOverviewController">
|
||||
|
||||
<!-- Kibana search bar -->
|
||||
<kbn-searchbar ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
<kbn-searchbar class="wazuh-searchbar" ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
|
||||
<div ng-if="tabView == 'panels'">
|
||||
<md-content layout="row">
|
||||
<md-content class="no-legend" layout="row">
|
||||
<md-card flex layout="column">
|
||||
<md-card-content style="text-align: center;">
|
||||
<div class="metric-value ng-binding" style="font-size: 14pt;">{{agentInfo.name}}</div>
|
||||
@ -79,7 +79,7 @@
|
||||
</md-content>
|
||||
|
||||
<!-- View: Discover -->
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-if="tabView == 'discover'" >
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-show="tabView == 'discover'" >
|
||||
<kbn-disfull table-height="1000px;" dis-a="(columns:!(_source),filters:!(),index:'wazuh-alerts-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!('@timestamp',desc))"
|
||||
dis-filter="agent.name: {{_agent.name ? _agent.name : '*'}} AND manager.name: {{defaultManager ? defaultManager : '*'}}"
|
||||
infinite-scroll="true">
|
||||
@ -88,7 +88,7 @@
|
||||
|
||||
|
||||
<!-- View: Panels -->
|
||||
<div ng-if="tabView == 'panels' && results">
|
||||
<div ng-if="tabView == 'panels' && results && !load">
|
||||
<md-content layout="row">
|
||||
<md-card flex="33">
|
||||
<md-card-title>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<md-content ng-if="submenuNavItem == 'pci' && _agent" id="agents-pci" ng-controller="PCIController">
|
||||
|
||||
<!-- Kibana search bar -->
|
||||
<kbn-searchbar ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
<kbn-searchbar class="wazuh-searchbar" ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
|
||||
<!-- No results message -->
|
||||
<md-content flex layout="row" layout-align="start start" ng-if="!results && tabView == 'panels'">
|
||||
@ -14,21 +14,21 @@
|
||||
|
||||
|
||||
<!-- View: Discover -->
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-if="tabView == 'discover'" >
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-show="tabView == 'discover'" >
|
||||
<kbn-disfull table-height="1000px;" dis-a="(columns:!(_source),filters:!(),index:'wazuh-alerts-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!('@timestamp',desc))"
|
||||
dis-filter="_exists_:rule.pci_dss AND agent.name: {{_agent.name ? _agent.name : '*'}} AND manager.name: {{defaultManager ? defaultManager : '*'}}"
|
||||
infinite-scroll="true">
|
||||
</kbn-disfull>
|
||||
</md-content>
|
||||
|
||||
<div flex ng-if="tabView == 'panels' && results" layout="column">
|
||||
<div flex ng-if="tabView == 'panels' && results && !load" layout="column">
|
||||
<md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="load"></md-progress-linear>
|
||||
<md-content layout="row" layout-align="center stretch">
|
||||
<md-card flex>
|
||||
<md-tabs md-selected="selectedIndex" md-border-bottom md-dynamic-height id="pciReq_tab">
|
||||
<md-tab ng-repeat="tab in tabs" ng-disabled="tab.disabled" label="{{tab.title}}">
|
||||
<md-content style="background-color: white;" class="md-padding">
|
||||
<h1 class="md-display-2" style="line-height: 40px; margin: 0;">PCI DSS Requirement: {{tab.title}}</h1>
|
||||
<h1 class="md-display-2 wazuh-h1" style="line-height: 40px; margin: 0;">PCI DSS Requirement: {{tab.title}}</h1>
|
||||
<div ng-bind-html="tab.content"></div>
|
||||
</md-content>
|
||||
</md-tab>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<md-content ng-if="submenuNavItem == 'policy_monitoring' && _agent" id="agents-pm" ng-controller="pmController">
|
||||
|
||||
<!-- Kibana search bar -->
|
||||
<kbn-searchbar ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
<kbn-searchbar class="wazuh-searchbar" ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
|
||||
<!-- No results message -->
|
||||
<md-content flex layout="row" layout-align="start start" ng-if="!results && tabView == 'panels'">
|
||||
@ -14,14 +14,14 @@
|
||||
|
||||
|
||||
<!-- View: Discover -->
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-if="tabView == 'discover'" >
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-show="tabView == 'discover'" >
|
||||
<kbn-disfull table-height="1000px;" dis-a="(columns:!(_source),filters:!(),index:'wazuh-alerts-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!('@timestamp',desc))"
|
||||
dis-filter="rule.groups:rootcheck AND agent.name: {{_agent.name ? _agent.name : '*'}} AND manager.name: {{defaultManager ? defaultManager : '*'}}"
|
||||
infinite-scroll="true">
|
||||
</kbn-disfull>
|
||||
</md-content>
|
||||
|
||||
<div flex ng-if="tabView == 'panels' && results" layout="column">
|
||||
<div flex ng-if="tabView == 'panels' && results && !load" layout="column">
|
||||
<md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="load"></md-progress-linear>
|
||||
<md-content layout="row">
|
||||
<md-card flex="50">
|
||||
|
@ -1,3 +1,5 @@
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
|
||||
<div ng-if="submenuNavItem == 'preview'">
|
||||
<md-content flex class="agentsPreview" ng-controller="agentsPreviewController" layout="column" style="height: 100%;" class="md-padding" layout-align="start space-around">
|
||||
<div infinite-scroll-module='agents.nextPage()' infinite-scroll-disabled='agents.busy' infinite-scroll-distance='0' style="padding: 0">
|
||||
@ -85,11 +87,13 @@
|
||||
</md-input-container>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<md-toolbar layout="row">
|
||||
<div class="md-toolbar-tools">
|
||||
<span flex="10" ng-click="setSort('id')">ID
|
||||
<span flex="5">
|
||||
<input class="agent-checkbox" ng-model="agentsStatus" value="all-agents-status" ng-change="changeAgentsStatus()" type="checkbox"/>
|
||||
</span>
|
||||
<span flex="5" ng-click="setSort('id')">ID
|
||||
<i class="fa" ng-class="_sort === 'id' ? (_sortOrder ? 'fa-sort-asc' : 'fa-sort-desc') : 'fa-sort'" aria-hidden="true"></i></span>
|
||||
<span flex="25" ng-click="setSort('name')">Name
|
||||
<i class="fa" ng-class="_sort === 'name' ? (_sortOrder ? 'fa-sort-asc' : 'fa-sort-desc') : 'fa-sort'" aria-hidden="true"></i></span>
|
||||
@ -105,19 +109,68 @@
|
||||
</md-toolbar>
|
||||
</div>
|
||||
</div>
|
||||
<md-list ng-repeat='agent in agents.items' class="agents-preview-table" ng-click="applyAgent(agent)">
|
||||
<md-list ng-repeat='agent in agents.items' class="agents-preview-table">
|
||||
<md-list-item>
|
||||
<span flex="10">{{agent.id}}</span>
|
||||
<span flex="25">{{agent.name}}</span>
|
||||
<span flex="20">{{agent.ip}}</span>
|
||||
<span flex="10">{{agent.status}}</span>
|
||||
<span flex="10"> <span ng-class="getAgentStatusClass(agent.status)" class="round status"></span></span>
|
||||
<span flex="15">{{agent.os.platform}}</span>
|
||||
<span flex="10">{{agent.os.version}}</span>
|
||||
<span flex="5">
|
||||
<input class="agent-checkbox" ng-model="agent.selected" value="{{agent.id}}" type="checkbox"/>
|
||||
</span>
|
||||
<span flex="5" ng-click="applyAgent(agent)">{{agent.id}}</span>
|
||||
<span flex="25" ng-click="applyAgent(agent)">{{agent.name}}</span>
|
||||
<span flex="20" ng-click="applyAgent(agent)">{{agent.ip}}</span>
|
||||
<span flex="10" ng-click="applyAgent(agent)">{{agent.status}}</span>
|
||||
<span flex="10" ng-click="applyAgent(agent)"> <span ng-class="getAgentStatusClass(agent.status)" class="round status"></span></span>
|
||||
<span flex="15" ng-click="applyAgent(agent)">{{agent.os.platform}}</span>
|
||||
<span flex="10" ng-click="applyAgent(agent)">{{agent.os.version}}</span>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
<md-divider></md-divider>
|
||||
</div>
|
||||
<div class="agent-buttons">
|
||||
<md-button class="md-fab add-agent-icon" ng-click="showNewAgentDialog($event)" >
|
||||
<md-icon md-font-library="material-icons">add</md-icon>
|
||||
</md-button>
|
||||
|
||||
<md-button class="md-fab restart-agent-icon" ng-click="showRestartConfirm($event)" >
|
||||
<md-icon md-font-library="material-icons">refresh</md-icon>
|
||||
</md-button>
|
||||
|
||||
<md-button class="md-fab delete-agent-icon" ng-click="showDeletePrompt($event)" >
|
||||
<md-icon md-font-library="material-icons">delete</md-icon>
|
||||
</md-button>
|
||||
</div>
|
||||
<div style="visibility: hidden">
|
||||
<div class="md-dialog-container" id="newAgentDialog">
|
||||
<div ng-show="newAgentKey != ''">
|
||||
<md-dialog class="new-agent-key" layout-padding>
|
||||
<h3 class="agent-key">Agent key</h3>
|
||||
<p class="agent-key">{{newAgentKey}}</p>
|
||||
<md-button ng-click="hidePrerenderedDialog()">Close</md-button>
|
||||
</md-dialog>
|
||||
</div>
|
||||
<div ng-show="newAgentKey == ''">
|
||||
<md-dialog layout-padding>
|
||||
<h3>New agent</h3>
|
||||
<form name="newAgentForm">
|
||||
<div layout="row">
|
||||
<md-input-container class="md-block" flex-gt-sm>
|
||||
<label>Name</label>
|
||||
<input required name="name" ng-model="newAgent.name" />
|
||||
</md-input-container>
|
||||
<md-input-container class="md-block" flex-gt-sm>
|
||||
<label>IP</label>
|
||||
<input required name="ip" ng-model="newAgent.ip" />
|
||||
</md-input-container>
|
||||
</div>
|
||||
<section layout="row" layout-sm="column" layout-align="center center" layout-wrap>
|
||||
<md-button ng-click="saveNewAgent()">Add</md-button>
|
||||
<md-button ng-click="hidePrerenderedDialog()">Close</md-button>
|
||||
</section>
|
||||
</form>
|
||||
</md-dialog>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<md-content><md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="agents.busy"></md-progress-linear></md-content>
|
||||
</md-content>
|
||||
</div>
|
||||
|
@ -39,7 +39,7 @@
|
||||
</div>
|
||||
|
||||
<div ng-if="!_agent">
|
||||
<h2 style="text-transform: none; font-size: 20px;">
|
||||
<h2 class="wazuh-h2" style="text-transform: none; font-size: 20px;">
|
||||
<i style="margin-right: 5px; " class="fa fa-desktop" aria-hidden="true"></i> Agents overview
|
||||
</h2>
|
||||
</div>
|
||||
|
@ -1,52 +1,78 @@
|
||||
<div ng-controller="discoverW" class="app-container">
|
||||
|
||||
<kbn-top-nav name="discover-search" config="topNavMenu">
|
||||
<kbn-top-nav name="discover" config="topNavMenu">
|
||||
<!-- Transcluded elements. -->
|
||||
|
||||
<div data-transclude-slots>
|
||||
<!-- Breadcrumbs. -->
|
||||
<div data-transclude-slot="topLeftCorner" class="localBreadcrumbs">
|
||||
<div class="localBreadcrumb">
|
||||
<span ng-show="opts.savedSearch.id" class="localBreadcrumb__emphasis">
|
||||
<span data-test-subj="discoverCurrentQuery" ng-bind="::opts.savedSearch.title"></span>
|
||||
<i aria-label="Reload Saved Search" tooltip="Reload Saved Search" ng-click="resetQuery();" class="fa fa-undo small"></i>
|
||||
</span>
|
||||
<span data-test-subj="discoverQueryHits" class="localBreadcrumb__emphasis">{{(hits || 0) | number:0}}</span>
|
||||
<ng-pluralize count="hits" when="{'1':'hit', 'other':'hits'}"></ng-pluralize>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</kbn-top-nav>
|
||||
|
||||
<navbar name="discover-search">
|
||||
<form role="form" class="fill inline-form" ng-submit="fetch()" name="discoverSearch">
|
||||
<div class="typeahead" kbn-typeahead="discover">
|
||||
<div class="input-group"
|
||||
ng-class="discoverSearch.$invalid ? 'has-error' : ''">
|
||||
<input
|
||||
parse-query
|
||||
input-focus
|
||||
kbn-typeahead-input
|
||||
ng-model="stateQuery"
|
||||
placeholder="Search..."
|
||||
aria-label="Search input"
|
||||
type="text"
|
||||
class="form-control">
|
||||
<button type="submit"
|
||||
ng-disabled="discoverSearch.$invalid"
|
||||
aria-label="Search">
|
||||
<span aria-hidden="true" class="fa fa-search"></span></button>
|
||||
</div>
|
||||
<kbn-typeahead-items></kbn-typeahead-items>
|
||||
<div data-transclude-slots class="wazuh-discover-searchbar">
|
||||
<!-- Breadcrumbs. -->
|
||||
<div data-transclude-slot="topLeftCorner" class="kuiLocalBreadcrumbs">
|
||||
<h1 tabindex="0" id="kui_local_breadcrumb" class="kuiLocalBreadcrumb">
|
||||
<span ng-show="opts.savedSearch.id" class="kuiLocalBreadcrumb__emphasis">
|
||||
<span data-test-subj="discoverCurrentQuery" ng-bind="opts.savedSearch.lastSavedTitle"></span>
|
||||
<i id="reload_saved_search" tabindex="0" aria-label="Reload Saved Search" tooltip="Reload Saved Search" ng-click="resetQuery();" class="fa fa-undo small"></i>
|
||||
</span>
|
||||
<span data-test-subj="discoverQueryHits" class="kuiLocalBreadcrumb__emphasis">{{(hits || 0) | number:0}}</span>
|
||||
<ng-pluralize count="hits" when="{'1':'hit', 'other':'hits'}"></ng-pluralize>
|
||||
</h1>
|
||||
</div>
|
||||
</form>
|
||||
<div class="button-group" role="toolbar"></div>
|
||||
</navbar>
|
||||
|
||||
|
||||
<!-- Search. -->
|
||||
<navbar name="discover-search">
|
||||
<form
|
||||
class="fullWidth"
|
||||
role="form"
|
||||
name="discoverSearch"
|
||||
ng-submit="fetch()"
|
||||
>
|
||||
<div class="typeahead" kbn-typeahead="discover" on-select="">
|
||||
<div class="kuiLocalSearch">
|
||||
<div class="kuiLocalSearchAssistedInput">
|
||||
<input
|
||||
parse-query
|
||||
input-focus
|
||||
kbn-typeahead-input
|
||||
ng-model="stateQuery"
|
||||
placeholder="Search... (e.g. status:200 AND extension:PHP)"
|
||||
aria-label="Search input"
|
||||
type="text"
|
||||
class="kuiLocalSearchInput kuiLocalSearchInput--lucene"
|
||||
ng-class="{'kuiLocalSearchInput-isInvalid': discoverSearch.$invalid}"
|
||||
>
|
||||
<div class="kuiLocalSearchAssistedInput__assistance">
|
||||
<p class="kuiText">
|
||||
<a
|
||||
class="kuiLink"
|
||||
ng-href="{{queryDocLinks.luceneQuerySyntax}}"
|
||||
target="_blank"
|
||||
>
|
||||
Uses lucene query syntax
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
type="submit"
|
||||
aria-label="Search"
|
||||
class="kuiLocalSearchButton"
|
||||
ng-disabled="discoverSearch.$invalid"
|
||||
>
|
||||
<span class="kuiIcon fa-search" aria-hidden="true"></span>
|
||||
</button>
|
||||
</div>
|
||||
<kbn-typeahead-items></kbn-typeahead-items>
|
||||
</div>
|
||||
</form>
|
||||
</navbar>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="container-fluid" role="main">
|
||||
<div class="row">
|
||||
<filter-bar state="state"></filter-bar>
|
||||
<filter-bar
|
||||
state="state"
|
||||
index-patterns="[indexPattern]"
|
||||
></filter-bar>
|
||||
</div>
|
||||
|
||||
|
||||
@ -55,13 +81,14 @@
|
||||
<div class="col-md-2 sidebar-container collapsible-sidebar">
|
||||
<disc-field-chooser
|
||||
columns="state.columns"
|
||||
refresh="refreshFieldList"
|
||||
hits="rows"
|
||||
field-counts="fieldCounts"
|
||||
filter="filterQuery"
|
||||
index-pattern="searchSource.get('index')"
|
||||
index-pattern-list="opts.indexPatternList"
|
||||
state="state">
|
||||
state="state"
|
||||
on-add-field="addColumn"
|
||||
on-add-filter="filterQuery"
|
||||
on-remove-field="removeColumn">
|
||||
</disc-field-chooser>
|
||||
</div>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
<navbar name="discover-search">
|
||||
<form role="form" class="fill inline-form" ng-submit="fetch()" name="discoverSearch">
|
||||
<div class="typeahead" kbn-typeahead="discover">
|
||||
<div class="typeahead" kbn-typeahead="discover" on-select="">
|
||||
<div class="input-group"
|
||||
ng-class="discoverSearch.$invalid ? 'has-error' : ''">
|
||||
<input
|
||||
|
@ -16,7 +16,7 @@
|
||||
<div class="fill bitty-modal-container">
|
||||
|
||||
<form ng-if="vis.type.requiresSearch && $state.linked" class="inline-form fill" name="queryInput">
|
||||
<div class="typeahead">
|
||||
<div class="typeahead" on-select="">
|
||||
<div class="input-group">
|
||||
<input disabled type="text" class="form-control">
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
</form>
|
||||
|
||||
<form ng-if="vis.type.requiresSearch && !$state.linked" ng-submit="fetch()" class="inline-form fill" name="queryInput">
|
||||
<div class="typeahead" kbn-typeahead="visualize">
|
||||
<div class="typeahead" kbn-typeahead="visualize" on-select="">
|
||||
<div class="input-group" ng-class="queryInput.$invalid ? 'has-error' : ''">
|
||||
<input ng-model="filter.current" parse-query kbn-typeahead-input placeholder="Search..." type="text" class="form-control">
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
<div class="fill bitty-modal-container">
|
||||
|
||||
<form ng-if="vis.type.requiresSearch && $state.linked" class="inline-form fill" name="queryInput">
|
||||
<div class="typeahead">
|
||||
<div class="typeahead" on-select="">
|
||||
<div class="input-group">
|
||||
<input disabled type="text" class="form-control">
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
</form>
|
||||
|
||||
<form ng-if="vis.type.requiresSearch && !$state.linked" ng-submit="fetch()" class="inline-form fill" name="queryInput">
|
||||
<div class="typeahead" kbn-typeahead="visualize">
|
||||
<div class="typeahead" kbn-typeahead="visualize" on-select="">
|
||||
<div class="input-group" ng-class="queryInput.$invalid ? 'has-error' : ''">
|
||||
<input ng-model="filter.current" parse-query kbn-typeahead-input placeholder="Search..." type="text" class="form-control">
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
||||
<div layout="row" layout-align="start start">
|
||||
<md-card layout="column" flex="50">
|
||||
<md-card-content>
|
||||
<h3>Manager information</h3>
|
||||
<h3 class="wazuh-h3">Manager information</h3>
|
||||
<div layout="column">
|
||||
<span layout="row">
|
||||
<p style="font-weight: bold; min-width: 150px" >Version</p>
|
||||
@ -88,7 +88,7 @@
|
||||
|
||||
<md-card layout="column" flex="50">
|
||||
<md-card-content>
|
||||
<h3>Last registered agent</h3>
|
||||
<h3 class="wazuh-h3">Last registered agent</h3>
|
||||
<div layout="column" flex>
|
||||
<span layout="row">
|
||||
<p style="font-weight: bold; min-width: 150px" >Name</p>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<md-content flex layout="column" ng-if="submenuNavItem == 'audit'" ng-controller="overviewAuditController" layout-align="space-around">
|
||||
|
||||
<!-- Kibana search bar -->
|
||||
<kbn-searchbar ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
<kbn-searchbar class="wazuh-searchbar" ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
|
||||
<!-- No results message -->
|
||||
<md-content flex layout="row" layout-align="start start" ng-if="!results && tabView == 'panels'">
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
<!-- View: Discover -->
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-if="tabView == 'discover'">
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-show="tabView == 'discover'">
|
||||
<kbn-disfull table-height="1000px;" dis-a="(columns:!(_source),filters:!(),index:'wazuh-alerts-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!('@timestamp',desc))"
|
||||
dis-filter="rule.groups:audit AND manager.name: {{defaultManager ? defaultManager : '*'}}"
|
||||
infinite-scroll="true">
|
||||
|
@ -1,7 +1,7 @@
|
||||
<md-content flex layout="column" ng-if="submenuNavItem == 'fim'" ng-controller="overviewFimController">
|
||||
|
||||
<!-- Kibana search bar -->
|
||||
<kbn-searchbar ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
<kbn-searchbar class="wazuh-searchbar" ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
|
||||
<!-- No results message -->
|
||||
<md-content flex layout="row" layout-align="start start" ng-if="!results && tabView == 'panels'">
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
<!-- View: Discover -->
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-if="tabView == 'discover'">
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-show="tabView == 'discover'">
|
||||
<kbn-disfull table-height="1000px;" dis-a="(columns:!(_source),filters:!(),index:'wazuh-alerts-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!('@timestamp',desc))"
|
||||
dis-filter="rule.groups:syscheck AND manager.name: {{defaultManager ? defaultManager : '*'}}"
|
||||
infinite-scroll="true">
|
||||
@ -27,19 +27,19 @@
|
||||
<div flex="10" layout="column" class="no-legend">
|
||||
<md-card>
|
||||
<md-card-content>
|
||||
<kbn-vis vis-height="72px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'rule.groups:%22syscheck%22')),uiState:(),vis:(aggs:!((enabled:!t,id:'1',params:(customLabel:Added),schema:metric,type:count)),listeners:(),params:(fontSize:20,handleNoResults:!t),title:'New%20Visualization',type:metric))" vis-filter='rule.id: 554'>
|
||||
<kbn-vis vis-height="105px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'rule.groups:%22syscheck%22')),uiState:(),vis:(aggs:!((enabled:!t,id:'1',params:(customLabel:Added),schema:metric,type:count)),listeners:(),params:(fontSize:20,handleNoResults:!t),title:'New%20Visualization',type:metric))" vis-filter='rule.id: 554'>
|
||||
</kbn-vis>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
<md-card>
|
||||
<md-card-content>
|
||||
<kbn-vis vis-height="72px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'rule.groups:%22syscheck%22%20AND%20full_log:%22Integrity%20checksum%20changed%22%20NOT%20location:%20syscheck-registry')),uiState:(),vis:(aggs:!((enabled:!t,id:'1',params:(customLabel:'Modified'),schema:metric,type:count)),listeners:(),params:(fontSize:20,handleNoResults:!t),title:'New%20Visualization',type:metric))" vis-filter='(rule.id: 550 OR rule.id: 551 OR rule.id: 552 OR rule.id: 555)'>
|
||||
<kbn-vis vis-height="105px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'rule.groups:%22syscheck%22%20AND%20full_log:%22Integrity%20checksum%20changed%22%20NOT%20location:%20syscheck-registry')),uiState:(),vis:(aggs:!((enabled:!t,id:'1',params:(customLabel:'Modified'),schema:metric,type:count)),listeners:(),params:(fontSize:20,handleNoResults:!t),title:'New%20Visualization',type:metric))" vis-filter='(rule.id: 550 OR rule.id: 551 OR rule.id: 552 OR rule.id: 555)'>
|
||||
</kbn-vis>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
<md-card>
|
||||
<md-card-content>
|
||||
<kbn-vis vis-height="72px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'rule.groups:%22syscheck%22%20AND%20full_log:%22was%20deleted%22%20NOT%20location:%20syscheck-registry')),uiState:(),vis:(aggs:!((enabled:!t,id:'1',params:(customLabel:Deleted),schema:metric,type:count)),listeners:(),params:(fontSize:20,handleNoResults:!t),title:'New%20Visualization',type:metric))" vis-filter='rule.id: 553'>
|
||||
<kbn-vis vis-height="104px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'rule.groups:%22syscheck%22%20AND%20full_log:%22was%20deleted%22%20NOT%20location:%20syscheck-registry')),uiState:(),vis:(aggs:!((enabled:!t,id:'1',params:(customLabel:Deleted),schema:metric,type:count)),listeners:(),params:(fontSize:20,handleNoResults:!t),title:'New%20Visualization',type:metric))" vis-filter='rule.id: 553'>
|
||||
</kbn-vis>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
@ -50,7 +50,7 @@
|
||||
<md-card>
|
||||
<md-card-content>
|
||||
<span class="md-headline">Events over time</span>
|
||||
<kbn-vis vis-height="280px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'rule.groups:%22syscheck%22')),uiState:(vis:(legendOpen:!t)),vis:(aggs:!((enabled:!t,id:'1',params:(),schema:metric,type:count),(enabled:!t,id:'3',params:(customInterval:'2h',extended_bounds:(),field:'@timestamp',interval:auto,min_doc_count:1),schema:segment,type:date_histogram),(enabled:!t,id:'2',params:(field:rule.description,order:desc,orderBy:'1',size:8),schema:group,type:terms)),listeners:(),params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,interpolate:step-after,legendPosition:right,mode:stacked,orderBucketsBySum:!t,scale:linear,setYExtents:!f,shareYAxis:!t,smoothLines:!t,times:!(),yAxis:()),title:'FIM%20Alerts%20over%20time',type:area))"
|
||||
<kbn-vis vis-height="380px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'rule.groups:%22syscheck%22')),uiState:(vis:(legendOpen:!t)),vis:(aggs:!((enabled:!t,id:'1',params:(),schema:metric,type:count),(enabled:!t,id:'3',params:(customInterval:'2h',extended_bounds:(),field:'@timestamp',interval:auto,min_doc_count:1),schema:segment,type:date_histogram),(enabled:!t,id:'2',params:(field:rule.description,order:desc,orderBy:'1',size:8),schema:group,type:terms)),listeners:(),params:(addLegend:!t,addTimeMarker:!f,addTooltip:!t,defaultYExtents:!f,interpolate:step-after,legendPosition:right,mode:stacked,orderBucketsBySum:!t,scale:linear,setYExtents:!f,shareYAxis:!t,smoothLines:!t,times:!(),yAxis:()),title:'FIM%20Alerts%20over%20time',type:area))"
|
||||
vis-filter='rule.groups:"syscheck"'>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
@ -61,14 +61,14 @@
|
||||
<md-card>
|
||||
<md-card-content>
|
||||
<span class="md-headline">Top user owners</span>
|
||||
<kbn-vis vis-height="100px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'*')),uiState:(vis:(legendOpen:!t)),vis:(aggs:!((enabled:!t,id:'1',params:(),schema:metric,type:count),(enabled:!t,id:'3',params:(field:syscheck.uname_after,order:desc,orderBy:'1',size:3),schema:segment,type:terms)),listeners:(),params:(addLegend:!t,addTooltip:!t,isDonut:!t,shareYAxis:!t),title:'FIM%20Top%2015%20new%20users',type:pie))"
|
||||
<kbn-vis vis-height="150px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'*')),uiState:(vis:(legendOpen:!t)),vis:(aggs:!((enabled:!t,id:'1',params:(),schema:metric,type:count),(enabled:!t,id:'3',params:(field:syscheck.uname_after,order:desc,orderBy:'1',size:3),schema:segment,type:terms)),listeners:(),params:(addLegend:!t,addTooltip:!t,isDonut:!t,shareYAxis:!t),title:'FIM%20Top%2015%20new%20users',type:pie))"
|
||||
vis-filter='rule.groups:"syscheck"'>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
<md-card>
|
||||
<md-card-content>
|
||||
<span class="md-headline">Top group owners</span>
|
||||
<kbn-vis vis-height="100px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'*')),uiState:(vis:(legendOpen:!t)),vis:(aggs:!((enabled:!t,id:'1',params:(),schema:metric,type:count),(enabled:!t,id:'3',params:(field:syscheck.gname_after,order:desc,orderBy:'1',size:3),schema:segment,type:terms)),listeners:(),params:(addLegend:!t,addTooltip:!t,isDonut:!t,shareYAxis:!t),title:'FIM%20Top%2015%20new%20users',type:pie))" vis-filter='rule.groups:"syscheck"'>
|
||||
<kbn-vis vis-height="150px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'*')),uiState:(vis:(legendOpen:!t)),vis:(aggs:!((enabled:!t,id:'1',params:(),schema:metric,type:count),(enabled:!t,id:'3',params:(field:syscheck.gname_after,order:desc,orderBy:'1',size:3),schema:segment,type:terms)),listeners:(),params:(addLegend:!t,addTooltip:!t,isDonut:!t,shareYAxis:!t),title:'FIM%20Top%2015%20new%20users',type:pie))" vis-filter='rule.groups:"syscheck"'>
|
||||
</md-card-content>
|
||||
</md-card>
|
||||
|
||||
@ -77,7 +77,7 @@
|
||||
|
||||
</md-content>
|
||||
|
||||
<md-content layout="row">
|
||||
<md-content class="no-legend" layout="row">
|
||||
<md-card flex layout="column">
|
||||
<md-card-content style="text-align: center;">
|
||||
<kbn-vis-value vis-height="37px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'*')),uiState:(vis:(params:(sort:(columnIndex:!n,direction:!n)))),vis:(aggs:!((enabled:!t,id:'1',params:(field:'@timestamp'),schema:metric,type:max),(enabled:!t,id:'2',params:(field:syscheck.path,order:desc,orderBy:'1',size:1),schema:bucket,type:terms)),listeners:(),params:(perPage:1,showMeticsAtAllLevels:!f,showPartialRows:!f,showTotal:!f,sort:(columnIndex:!n,direction:!n),totalFunc:sum),title:'New%20Visualization',type:table))"
|
||||
@ -146,7 +146,7 @@
|
||||
|
||||
</md-content>
|
||||
|
||||
<md-content layout="row" flex="100">
|
||||
<md-content layout="row" flex="100" class="no-legend">
|
||||
<md-card flex="20" layout="column">
|
||||
<md-card-content style="text-align: center;">
|
||||
<kbn-vis-value vis-height="37px" vis-index-pattern="wazuh-alerts-*"vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'*')),uiState:(vis:(params:(sort:(columnIndex:!n,direction:!n)))),vis:(aggs:!((enabled:!t,id:'1',params:(),schema:metric,type:count),(enabled:!t,id:'2',params:(field:agent.name,order:desc,orderBy:'1',size:1),schema:bucket,type:terms)),listeners:(),params:(perPage:1,showMeticsAtAllLevels:!f,showPartialRows:!f,showTotal:!f,sort:(columnIndex:!n,direction:!n),totalFunc:sum),title:'New%20Visualization',type:table))" vis-filter="location: syscheck"></kbn-vis-value>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<md-content flex layout="column" ng-if="submenuNavItem == 'general'" ng-controller="overviewGeneralController" layout-align="start">
|
||||
|
||||
<!-- Kibana search bar -->
|
||||
<kbn-searchbar ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
<kbn-searchbar class="wazuh-searchbar" ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
|
||||
<!-- No results message -->
|
||||
<md-content flex layout="row" layout-align="start start" ng-if="!results && tabView == 'panels'">
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
<!-- View: Discover -->
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-if="tabView == 'discover'">
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-show="tabView == 'discover'">
|
||||
<kbn-disfull table-height="1000px;" dis-a="(columns:!(_source),filters:!(),index:'wazuh-alerts-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!('@timestamp',desc))"
|
||||
dis-filter="manager.name: {{defaultManager ? defaultManager : '*'}}"
|
||||
infinite-scroll="true">
|
||||
@ -108,7 +108,7 @@
|
||||
</md-card>
|
||||
</div>
|
||||
|
||||
<div layout="row" layout-align="center stretch">
|
||||
<div class="no-legend" layout="row" layout-align="center stretch">
|
||||
<md-card flex layout="column">
|
||||
<md-card-content style="text-align: center;">
|
||||
<kbn-vis-value vis-height="29px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'*')),uiState:(vis:(params:(sort:(columnIndex:!n,direction:!n)))),vis:(aggs:!((enabled:!t,id:'1',params:(),schema:metric,type:count),(enabled:!t,id:'2',params:(field:srcuser,order:desc,orderBy:'1',size:1),schema:bucket,type:terms)),listeners:(),params:(perPage:1,showMeticsAtAllLevels:!f,showPartialRows:!f,showTotal:!f,sort:(columnIndex:!n,direction:!n),totalFunc:sum),title:'Top source user',type:table))" vis-filter="*"></kbn-vis-value>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<md-content flex layout="column" ng-if="submenuNavItem == 'oscap'" ng-controller="overviewOSCAPController" layout-align="start">
|
||||
|
||||
<!-- Kibana search bar -->
|
||||
<kbn-searchbar ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
<kbn-searchbar class="wazuh-searchbar" ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
|
||||
<!-- No results message -->
|
||||
<md-content flex layout="row" layout-align="start start" ng-if="!results && tabView == 'panels'">
|
||||
@ -13,7 +13,7 @@
|
||||
</md-content>
|
||||
|
||||
<!-- View: Discover -->
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-if="tabView == 'discover'">
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-show="tabView == 'discover'">
|
||||
<kbn-disfull table-height="1000px;" dis-a="(columns:!(_source),filters:!(),index:'wazuh-alerts-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!('@timestamp',desc))"
|
||||
dis-filter="rule.groups:oscap AND manager.name: {{defaultManager ? defaultManager : '*'}}"
|
||||
infinite-scroll="true">
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
<!-- View: Panels -->
|
||||
<div ng-if="tabView == 'panels' && results">
|
||||
<md-content layout="row" layout-align="center stretch">
|
||||
<md-content class="no-legend" layout="row" layout-align="center stretch">
|
||||
<md-card flex="20" layout="column">
|
||||
<md-card-content style="text-align: center;">
|
||||
<kbn-vis-value vis-height="37px" vis-index-pattern="wazuh-alerts-*" vis-a="(filters:!(),linked:!f,query:(query_string:(analyze_wildcard:!t,query:'*')),uiState:(vis:(params:(sort:(columnIndex:!n,direction:!n)))),vis:(aggs:!((enabled:!t,id:'1',params:(field:'@timestamp'),schema:metric,type:max),(enabled:!t,id:'2',params:(field:oscap.scan.score,order:desc,orderBy:'1',size:1),schema:bucket,type:terms)),listeners:(),params:(perPage:1,showMeticsAtAllLevels:!f,showPartialRows:!f,showTotal:!f,sort:(columnIndex:!n,direction:!n),totalFunc:sum),title:'New%20Visualization',type:table))" vis-filter="*"></kbn-vis-value>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<md-content flex layout="column" ng-if="submenuNavItem == 'pci'" ng-controller="overviewPCIController" layout-align="start">
|
||||
|
||||
<!-- Kibana search bar -->
|
||||
<kbn-searchbar ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
<kbn-searchbar class="wazuh-searchbar" ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
|
||||
<!-- No results message -->
|
||||
<md-content flex layout="row" layout-align="start start" ng-if="!results && tabView == 'panels'">
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
<!-- View: Discover -->
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-if="tabView == 'discover'">
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-show="tabView == 'discover'">
|
||||
<kbn-disfull table-height="1000px;" dis-a="(columns:!(_source),filters:!(),index:'wazuh-alerts-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!('@timestamp',desc))"
|
||||
dis-filter="_exists_:rule.pci_dss AND manager.name: {{defaultManager ? defaultManager : '*'}}"
|
||||
infinite-scroll="true">
|
||||
@ -28,7 +28,7 @@
|
||||
<md-tabs md-selected="selectedIndex" md-border-bottom md-dynamic-height id="pciReq_tab">
|
||||
<md-tab ng-repeat="tab in tabs" ng-disabled="tab.disabled" label="{{tab.title}}">
|
||||
<md-content style="background-color: white;" class="md-padding">
|
||||
<h1 class="md-display-2" style="line-height: 40px; margin: 0;">PCI DSS Requirement: {{tab.title}}</h1>
|
||||
<h1 class="md-display-2 wazuh-h1" style="line-height: 40px; margin: 0;">PCI DSS Requirement: {{tab.title}}</h1>
|
||||
<div ng-bind-html="tab.content"></div>
|
||||
</md-content>
|
||||
</md-tab>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<md-content flex layout="column" ng-if="submenuNavItem == 'pm'" ng-controller="overviewPMController">
|
||||
|
||||
<!-- Kibana search bar -->
|
||||
<kbn-searchbar ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
<kbn-searchbar class="wazuh-searchbar" ng-if="tabView == 'panels'"></kbn-searchbar>
|
||||
|
||||
<!-- No results message -->
|
||||
<md-content flex layout="row" layout-align="start start" ng-if="!results && tabView == 'panels'">
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
|
||||
<!-- View: Discover -->
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-if="tabView == 'discover'">
|
||||
<md-content style="background-color: white" flex layout="column" layout-align="start space-around" ng-show="tabView == 'discover'">
|
||||
<kbn-disfull table-height="1000px;" dis-a="(columns:!(_source),filters:!(),index:'wazuh-alerts-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'*')),sort:!('@timestamp',desc))"
|
||||
dis-filter="rule.groups:rootcheck AND manager.name: {{defaultManager ? defaultManager : '*'}}"
|
||||
infinite-scroll="true">
|
||||
|
@ -150,7 +150,7 @@
|
||||
|
||||
<md-card flex layout="column" ng-if="rule.groups.length > 0">
|
||||
<md-card-content>
|
||||
<h3>Groups</h3>
|
||||
<h3 class="wazuh-h3">Groups</h3>
|
||||
<span ng-repeat="group in rule.groups">
|
||||
<span class="listHover" ng-click="rulesApplyFilter({type: 'group', value: group})" layout="row" layout-align="space-between center"><p>{{ group }}</p></span>
|
||||
<md-divider ng-if="!$last"></md-divider>
|
||||
@ -160,7 +160,7 @@
|
||||
|
||||
<md-card flex layout="column" ng-if="rule.pci.length > 0">
|
||||
<md-card-content>
|
||||
<h3>PCI DSS </h3>
|
||||
<h3 class="wazuh-h3">PCI DSS </h3>
|
||||
<span ng-repeat="pci in rule.pci">
|
||||
<span class="listHover" ng-click="rulesApplyFilter({type: 'pci', value: pci})" layout="row" layout-align="space-between center"><p>{{ pci }}</p></span>
|
||||
<md-divider ng-if="!$last"></md-divider>
|
||||
@ -170,7 +170,7 @@
|
||||
|
||||
<md-card flex layout="column">
|
||||
<md-card-content>
|
||||
<h3>Extra settings</h3>
|
||||
<h3 class="wazuh-h3">Extra settings</h3>
|
||||
<span ng-repeat="(detailk, detailv) in rule.details">
|
||||
<span layout="row" layout-align="space-between center">
|
||||
<p>{{detailk}}</p>
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<md-card layout-padding layout-align="start stretch" ng-if="submenuNavItem == 'api' && apiEntries.length == 0">
|
||||
|
||||
<h1>Welcome to the Wazuh App for Kibana 5</h1>
|
||||
<h1 class="wazuh-h1">Welcome to the Wazuh App for Kibana 5</h1>
|
||||
<div>
|
||||
<p>The Wazuh App brings together a new and useful web interface for managing and monitoring your Wazuh infrastructure. You can check agent status, alert evolution, most recent events, popular alerts, top alert groups, etc. You can also display configuration and logs of the manager.</p>
|
||||
<p>In addition, make use of any or all of these extensions:</p>
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
<md-card layout-padding layout-align="start stretch" ng-if="submenuNavItem == 'api'">
|
||||
|
||||
<h1><i class="fa fa-cog ng-scope" aria-hidden="true" style="font-size: 25px;"></i> Wazuh App: API configuration</h1>
|
||||
<h1 class="wazuh-h1"><i class="fa fa-cog ng-scope" aria-hidden="true" style="font-size: 25px;"></i> Wazuh App: API configuration</h1>
|
||||
|
||||
<span layout="row" layout-align="start start">
|
||||
<p flex="20" style="font-weight: bold;">Manager</p>
|
||||
@ -106,7 +106,7 @@
|
||||
|
||||
<md-card flex layout-padding layout-align="start stretch" ng-if="submenuNavItem == 'extensions'">
|
||||
|
||||
<h1><i class="fa fa-cog ng-scope" aria-hidden="true" style="font-size: 25px;"></i> Wazuh App: Extensions</h1>
|
||||
<h1 class="wazuh-h1"><i class="fa fa-cog ng-scope" aria-hidden="true" style="font-size: 25px;"></i> Wazuh App: Extensions</h1>
|
||||
|
||||
<p flex>Enable or disable extensions according to your needs. The extension includes: Panels, discover and dashboards, for agents / overview.</p>
|
||||
|
||||
@ -154,7 +154,7 @@
|
||||
|
||||
<md-card layout-align="start stretch">
|
||||
<md-card-content>
|
||||
<h1>About</h1>
|
||||
<h1 class="wazuh-h1">About</h1>
|
||||
<div>
|
||||
<p>The Wazuh App brings together a new and useful web interface for managing and monitoring your Wazuh infrastructure. You can check agent status, alert evolution, most recent events, popular alerts, top alert groups, etc. You can also display configuration and logs of the manager.</p>
|
||||
<p>In addition, make use of any or all of these extensions:</p>
|
||||
@ -172,7 +172,7 @@
|
||||
|
||||
<md-card layout-align="start stretch">
|
||||
<md-card-content style="width: 500px;">
|
||||
<h1>Version</h1>
|
||||
<h1 class="wazuh-h1">Version</h1>
|
||||
<span layout="row" layout-align="space-between center">
|
||||
<p>App version</p>
|
||||
<p>{{appInfo["app-version"]}}</p>
|
||||
|
@ -39,7 +39,7 @@ module.exports = function (server, options) {
|
||||
//Handlers - Generic
|
||||
|
||||
var getConfig = function (callback) {
|
||||
elasticRequest.callWithInternalUser('search', { index: '.kibana', type: 'wazuh-configuration', q: 'active:true'}).then(
|
||||
elasticRequest.callWithInternalUser('search', { index: '.wazuh', type: 'wazuh-configuration', q: 'active:true'}).then(
|
||||
function (data) {
|
||||
if (data.hits.total == 1) {
|
||||
callback({ 'user': data.hits.hits[0]._source.api_user, 'password': new Buffer(data.hits.hits[0]._source.api_password, 'base64').toString("ascii"), 'url': data.hits.hits[0]._source.url, 'port': data.hits.hits[0]._source.api_port, 'insecure': data.hits.hits[0]._source.insecure, 'manager': data.hits.hits[0]._source.manager, 'extensions': data.hits.hits[0]._source.extensions });
|
||||
@ -52,7 +52,7 @@ module.exports = function (server, options) {
|
||||
};
|
||||
|
||||
var getAPI_entries = function (req,reply) {
|
||||
elasticRequest.callWithRequest(req, 'search', { index: '.kibana', type: 'wazuh-configuration'}).then(
|
||||
elasticRequest.callWithRequest(req, 'search', { index: '.wazuh', type: 'wazuh-configuration'}).then(
|
||||
function (data) {
|
||||
reply(data.hits.hits);
|
||||
}, function (data, error) {
|
||||
@ -61,7 +61,7 @@ module.exports = function (server, options) {
|
||||
};
|
||||
|
||||
var deleteAPI_entries = function (req,reply) {
|
||||
elasticRequest.callWithRequest(req, 'delete', { index: '.kibana', type: 'wazuh-configuration', id: req.params.id}).then(
|
||||
elasticRequest.callWithRequest(req, 'delete', { index: '.wazuh', type: 'wazuh-configuration', id: req.params.id}).then(
|
||||
function (data) {
|
||||
reply(data);
|
||||
}, function (data, error) {
|
||||
@ -71,15 +71,15 @@ module.exports = function (server, options) {
|
||||
|
||||
var setAPI_entry_default = function (req,reply) {
|
||||
// Searching for previous default
|
||||
elasticRequest.callWithRequest(req, 'search', { index: '.kibana', type: 'wazuh-configuration', q: 'active:true'}).then(
|
||||
elasticRequest.callWithRequest(req, 'search', { index: '.wazuh', type: 'wazuh-configuration', q: 'active:true'}).then(
|
||||
function (data) {
|
||||
if (data.hits.total == 1) {
|
||||
// Setting off previous default
|
||||
var idPreviousActive = data.hits.hits[0]._id;
|
||||
elasticRequest.callWithRequest(req, 'update', { index: '.kibana', type: 'wazuh-configuration', id: idPreviousActive, body: {doc: {"active": "false"}} }).then(
|
||||
elasticRequest.callWithRequest(req, 'update', { index: '.wazuh', type: 'wazuh-configuration', id: idPreviousActive, body: {doc: {"active": "false"}} }).then(
|
||||
function () {
|
||||
// Set new default
|
||||
elasticRequest.callWithRequest(req, 'update', { index: '.kibana', type: 'wazuh-configuration', id: req.params.id, body: {doc: {"active": "true"}} }).then(
|
||||
elasticRequest.callWithRequest(req, 'update', { index: '.wazuh', type: 'wazuh-configuration', id: req.params.id, body: {doc: {"active": "true"}} }).then(
|
||||
function () {
|
||||
reply({ 'statusCode': 200, 'message': 'ok' });
|
||||
}, function (error) {
|
||||
@ -90,7 +90,7 @@ module.exports = function (server, options) {
|
||||
});
|
||||
}else{
|
||||
// Set new default
|
||||
elasticRequest.callWithRequest(req, 'update', { index: '.kibana', type: 'wazuh-configuration', id: req.params.id, body: {doc: {"active": "true"}} }).then(
|
||||
elasticRequest.callWithRequest(req, 'update', { index: '.wazuh', type: 'wazuh-configuration', id: req.params.id, body: {doc: {"active": "true"}} }).then(
|
||||
function () {
|
||||
reply({ 'statusCode': 200, 'message': 'ok' });
|
||||
}, function (error) {
|
||||
@ -129,7 +129,7 @@ module.exports = function (server, options) {
|
||||
};
|
||||
|
||||
var getExtensions = function (req,reply) {
|
||||
elasticRequest.callWithRequest(req, 'search', { index: '.kibana', type: 'wazuh-configuration'}).then(
|
||||
elasticRequest.callWithRequest(req, 'search', { index: '.wazuh', type: 'wazuh-configuration'}).then(
|
||||
function (data) {
|
||||
reply(data.hits.hits);
|
||||
}, function (data, error) {
|
||||
@ -142,7 +142,7 @@ module.exports = function (server, options) {
|
||||
var extension = {};
|
||||
extension[req.params.extensionName] = (req.params.extensionValue == "true") ? true : false;
|
||||
|
||||
elasticRequest.callWithRequest(req, 'update',{ index: '.kibana', type: 'wazuh-configuration', id: req.params.id, body: {doc: {"extensions" : extension}} }).then(
|
||||
elasticRequest.callWithRequest(req, 'update',{ index: '.wazuh', type: 'wazuh-configuration', id: req.params.id, body: {doc: {"extensions" : extension}} }).then(
|
||||
function () {
|
||||
reply({ 'statusCode': 200, 'message': 'ok' });
|
||||
}, function (error) {
|
||||
@ -344,7 +344,7 @@ module.exports = function (server, options) {
|
||||
|
||||
var settings = { 'api_user': req.payload.user, 'api_password': req.payload.password, 'url': req.payload.url, 'api_port': req.payload.port , 'insecure': req.payload.insecure, 'component' : 'API', 'active' : req.payload.active, 'manager' : req.payload.manager, 'extensions' : req.payload.extensions};
|
||||
|
||||
elasticRequest.callWithRequest(req, 'index', { index: '.kibana', type: 'wazuh-configuration', body: settings, refresh: true })
|
||||
elasticRequest.callWithRequest(req, 'index', { index: '.wazuh', type: 'wazuh-configuration', body: settings, refresh: true })
|
||||
.then(function (response) {
|
||||
reply({ 'statusCode': 200, 'message': 'ok', 'response' : response });
|
||||
}, function (error) {
|
||||
|
@ -120,6 +120,21 @@ module.exports = function (server, options) {
|
||||
});
|
||||
};
|
||||
|
||||
var getSetupInfo = function (req, reply) {
|
||||
elasticRequest.callWithRequest(req, 'search', { index: '.wazuh', type: 'wazuh-setup' })
|
||||
.then(function (data) {
|
||||
if (data.hits.total == 0) {
|
||||
reply({ 'statusCode': 200, 'data': '' });
|
||||
}
|
||||
else {
|
||||
reply({ 'statusCode': 200, 'data': data.hits.hits[0]._source });
|
||||
}
|
||||
}, function (error) {
|
||||
console.log(error);
|
||||
reply({ 'statusCode': 500, 'error': 9, 'message': 'Could not get data from elasticsearch' }).code(500);
|
||||
});
|
||||
};
|
||||
|
||||
var putWazuhAlertsPattern = function (req, reply) {
|
||||
|
||||
try {
|
||||
@ -313,6 +328,17 @@ module.exports = function (server, options) {
|
||||
handler: getLastField
|
||||
});
|
||||
|
||||
/*
|
||||
* GET /api/wazuh-elastic/setup
|
||||
* Return Wazuh Appsetup info
|
||||
*
|
||||
**/
|
||||
server.route({
|
||||
method: 'GET',
|
||||
path: '/api/wazuh-elastic/setup',
|
||||
handler: getSetupInfo
|
||||
});
|
||||
|
||||
/*
|
||||
* PUT /api/wazuh-elastic/wazuh-pattern
|
||||
* Set wazuh index pattern
|
||||
|
@ -47,7 +47,7 @@ module.exports = function (server, options) {
|
||||
var setup_info = {"name" : "Wazuh App", "app-version": packageJSON.version, "revision": packageJSON.revision, "installationDate": new Date().toISOString() };
|
||||
|
||||
if(type == "install"){
|
||||
elasticRequest.callWithInternalUser('create', { index: ".kibana", type: 'wazuh-setup', id: 1, body: setup_info }).then(
|
||||
elasticRequest.callWithInternalUser('create', { index: ".wazuh", type: 'wazuh-setup', id: 1, body: setup_info }).then(
|
||||
function () {
|
||||
server.log([blueWazuh, 'initialize', 'info'], 'Wazuh set up info inserted');
|
||||
}, function () {
|
||||
@ -56,13 +56,23 @@ module.exports = function (server, options) {
|
||||
}
|
||||
|
||||
if(type == "upgrade"){
|
||||
elasticRequest.callWithInternalUser('update', { index: ".kibana", type: 'wazuh-setup', id: 1, body: {doc: setup_info}}).then(
|
||||
elasticRequest.callWithInternalUser('update', { index: ".wazuh", type: 'wazuh-setup', id: 1, body: {doc: setup_info}}).then(
|
||||
function () {
|
||||
server.log([blueWazuh, 'initialize', 'info'], 'Wazuh set up info updated');
|
||||
}, function () {
|
||||
server.log([blueWazuh, 'initialize', 'error'], 'Could not upgrade Wazuh set up info');
|
||||
});
|
||||
}
|
||||
|
||||
if(type == "migration"){
|
||||
elasticRequest.callWithInternalUser('create', { index: ".wazuh", type: 'wazuh-setup', id: 1, body: setup_info }).then(
|
||||
function () {
|
||||
server.log([blueWazuh, 'initialize', 'info'], 'Wazuh set up info inserted');
|
||||
}, function (error) {
|
||||
server.log([blueWazuh, 'initialize', 'error'], 'Could not insert Wazuh set up info');
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -122,7 +132,7 @@ module.exports = function (server, options) {
|
||||
var setDefaultKibanaSettings = function () {
|
||||
server.log([blueWazuh, 'initialize', 'info'], 'Setting Kibana default values: Index pattern, time picker and metaFields...');
|
||||
|
||||
uiSettings.setMany(req,{'defaultIndex':'wazuh-alerts-*', 'timepicker:timeDefaults':'{ \"from\": \"now-24h\", \"to\": \"now\", \"mode\": \"quick\"}','metaFields':[]})
|
||||
uiSettings.setMany(req,{'defaultIndex':'wazuh-alerts-*', 'timepicker:timeDefaults':'{ \"from\": \"now-24h\", \"to\": \"now\", \"mode\": \"quick\"}','metaFields':['_source']})
|
||||
.then(function (data) {
|
||||
server.log([blueWazuh, 'initialize', 'info'], 'Kibana default values set');
|
||||
}).catch(function (data) {
|
||||
@ -131,6 +141,32 @@ module.exports = function (server, options) {
|
||||
});
|
||||
};
|
||||
|
||||
var importConfigurationFromKibana = function () {
|
||||
elasticRequest.callWithInternalUser('search',{ index: '.kibana', type: 'wazuh-configuration'})
|
||||
.then(function (data) {
|
||||
if (data.hits.total > 0) {
|
||||
var body = '';
|
||||
data.hits.hits.forEach(function (element) {
|
||||
body += '{ "index": { "_index": ".wazuh", "_type": "wazuh-configuration", "_id": "'+element._id+'" } }\n';
|
||||
body += JSON.stringify(element._source) + "\n";
|
||||
});
|
||||
elasticRequest.callWithInternalUser('bulk',{
|
||||
index: '.wazuh',
|
||||
body: body
|
||||
}).then(function () {
|
||||
elasticRequest.callWithInternalUser('indices.refresh',{ index: '.wazuh' });
|
||||
server.log([blueWazuh, 'initialize', 'info'], 'wazuh-configuration documents were successfully imported.');
|
||||
}, function (err) {
|
||||
server.log([blueWazuh, 'initialize', 'error'], 'Error importing wazuh-configuration documents into .wazuh index. Bulk request failed.');
|
||||
});
|
||||
}
|
||||
else{
|
||||
server.log([blueWazuh, 'initialize', 'info'], 'No wazuh-configuration documents were found in .kibana index.');
|
||||
}
|
||||
}, function () {
|
||||
server.log([blueWazuh, 'initialize', 'error'], 'wazuh-configuration documents could not be imported from .kibana index to .wazuh index.');
|
||||
});
|
||||
}
|
||||
|
||||
// Configure Kibana status: Index pattern, default index pattern, default time, import dashboards.
|
||||
var configureKibana = function (type) {
|
||||
@ -144,6 +180,10 @@ module.exports = function (server, options) {
|
||||
importObjects();
|
||||
}
|
||||
|
||||
if(type == "migration"){
|
||||
importConfigurationFromKibana();
|
||||
importObjects();
|
||||
}
|
||||
// Save Setup Info
|
||||
saveSetupInfo(type);
|
||||
|
||||
@ -152,13 +192,19 @@ module.exports = function (server, options) {
|
||||
|
||||
// Init function. Check for "wazuh-setup" document existance.
|
||||
var init = function () {
|
||||
elasticRequest.callWithInternalUser('get', { index: ".kibana", type: "wazuh-setup", id: "1" }).then(
|
||||
elasticRequest.callWithInternalUser('get', { index: ".wazuh", type: "wazuh-setup", id: "1" }).then(
|
||||
function (data) {
|
||||
server.log([blueWazuh, 'initialize', 'info'], 'Wazuh-setup document already exists. Proceed to upgrade.');
|
||||
configure("upgrade");
|
||||
}, function (data) {
|
||||
server.log([blueWazuh, 'initialize', 'info'], 'Wazuh-setup document does not exist. Initializating configuration...');
|
||||
configure("install");
|
||||
elasticRequest.callWithInternalUser('get', { index: ".kibana", type: "wazuh-setup", id: "1" }).then(
|
||||
function (result) {
|
||||
configure("migration");
|
||||
}, function () {
|
||||
configure("install");
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
@ -207,7 +207,7 @@ module.exports = function (server, options) {
|
||||
|
||||
// Get API configuration from elastic and callback to loadCredentials
|
||||
var getConfig = function (callback) {
|
||||
elasticRequest.callWithInternalUser('search',{ index: '.kibana', type: 'wazuh-configuration'})
|
||||
elasticRequest.callWithInternalUser('search',{ index: '.wazuh', type: 'wazuh-configuration'})
|
||||
.then(function (data) {
|
||||
if (data.hits.total > 0) {
|
||||
callback(data.hits);
|
||||
|
Loading…
Reference in New Issue
Block a user