Skip to content

Commit

Permalink
Backports for Wazuh 3.12.0 [7.4.2] (#2133)
Browse files Browse the repository at this point in the history
* Adapt for 7.6.0

* Update routes kibana

* Modified upgrade guide

* Bump for 3.11.4

* Update kibana-discover.js

* Update package.json

* Update CHANGELOG.md

* Delete wazuh-registry.json

* update changelog master

* Adapt for 7.6.1

* Fix reporting syscheck negative values in atrributes

* Adapt discover

* Fix visualizations report on chrome

* Restructure optimize/wazuh folder (#2116)

* Restructure optimize/wazuh folder

* Update protocol of initial config example

* Replace path with a constant

* Remove wazuh.yml file

* Update README upgrade guide

* Fix plugin helper error

Co-authored-by: Pablo Torres <pablotr9@correo.ugr.es>

* hide manager alerts

* Add rule group win_auth_failure to metrics (#2099)

* Add PCI 11.2.1 y 11.2.3 rules. (#2062)

* Discover in monitoring

* Close 3.12-7.6

* Update changelog

* Update package.json

* Update package.json

* merge 7.6

* merge 7.6

* merge 7.6

* Allow disabling known fields health check (#2037)

* Add https to initial wazuh configuration

* Add https to Wazuh config example

* update changelog

* Fix reports path error

* Close 6.8.7

* Close 7.4.2

* Add checks.fields to initial default config

* Update update-configuration.js

* Fix kibana-discover

Co-authored-by: JuanCarlos <juanca.romo9@gmail.com>
Co-authored-by: Pablo Torres <pablotr9@correo.ugr.es>
Co-authored-by: Victor Santaella <victorst79@gmail.com>
  • Loading branch information
4 people committed Mar 12, 2020
1 parent 72d901d commit 2ab5697
Show file tree
Hide file tree
Showing 43 changed files with 1,245 additions and 376 deletions.
3 changes: 1 addition & 2 deletions .kibana-plugin-helpers.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
"package.json",
"LICENSE",
"tsconfig.json",
"wazuh.yml",
"index.js",
"init.js",
"server/**/*",
"public/**/*",
"util/**/*"
]
}
}
40 changes: 38 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,49 @@

All notable changes to the Wazuh app project will be documented in this file.

## Wazuh v3.11.4 - Kibana v6.8.6, v7.4.2, v7.6.0 - Revision 575

## Wazuh v3.12.0 - Kibana v6.8.7, v7.4.2, v7.6.1 - Revision 590

### Added

- Support for Wazuh v3.12.0
- Added a new setting to hide manager alerts from dashboards. [#2102](https://github.com/wazuh/wazuh-kibana-app/pull/2102)
- Added a new setting to enable/disable the known fields health check [#2037](https://github.com/wazuh/wazuh-kibana-app/pull/2037)
- Added suport for PCI 11.2.1 and 11.2.3 rules. [#2062](https://github.com/wazuh/wazuh-kibana-app/pull/2062)

### Changed

- Restructuring of the optimize/wazuh directory. Now the Wazuh configuration file (wazuh.yml) is placed on /usr/share/kibana/optimize/wazuh/config. [#2116](https://github.com/wazuh/wazuh-kibana-app/pull/2116)
- Improve performance of Dasboards reports generation. [1802344](https://github.com/wazuh/wazuh-kibana-app/commit/18023447c6279d385df84d7f4a5663ed2167fdb5)

### Fixed

- Discover time range selector is now displayed on the Cluster section. [08901df](https://github.com/wazuh/wazuh-kibana-app/commit/08901dfcbe509f17e4fab26877c8b7dae8a66bff)
- Added the win_auth_failure rule group to Authentication failure metrics. [#2099](https://github.com/wazuh/wazuh-kibana-app/pull/2099)
- Negative values in Syscheck attributes now have their correct value in reports. [7c3e84e](https://github.com/wazuh/wazuh-kibana-app/commit/7c3e84ec8f00760b4f650cfc00a885d868123f99)


## Wazuh v3.11.4 - Kibana v7.6.1 - Revision 858

### Added

- Support for Kibana v7.6.1


## Wazuh v3.11.4 - Kibana v6.8.6, v7.4.2, v7.6.0 - Revision 857

### Added

- Support for Wazuh v3.11.4


## Wazuh v3.11.3 - Kibana v7.6.0 - Revision 856

### Added

- Support for Kibana v7.6.0


## Wazuh v3.11.3 - Kibana v7.4.2 - Revision 855

### Added
Expand Down Expand Up @@ -1467,4 +1503,4 @@ All notable changes to the Wazuh app project will be documented in this file.
### Fixed

- Search bar across panels now support parenthesis grouping
- Several CSS fixes for IE browser
- Several CSS fixes for IE browser
266 changes: 136 additions & 130 deletions README.md

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "wazuh",
"version": "3.11.4",
"revision": "0575",
"code": "0575-0",
"version": "3.12.0",
"revision": "0590",
"code": "0590-0",
"kibana": {
"version": "7.4.2"
},
Expand Down Expand Up @@ -39,7 +39,6 @@
"angular-cookies": "1.6.5",
"angular-material": "1.1.18",
"babel-polyfill": "^6.13.0",
"dom-to-image": "^2.6.0",
"install": "^0.10.1",
"js2xmlparser": "^3.0.0",
"json2csv": "^4.1.2",
Expand Down Expand Up @@ -67,4 +66,4 @@
"typescript": "^3.0.1",
"typescript-eslint-parser": "^18.0.0"
}
}
}
44 changes: 4 additions & 40 deletions public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import 'uiExports/autocompleteProviders';

// Require CSS
import './less/loader';
// Require lib to dashboards PDFs
require ('./utils/dom-to-image.js');
import { uiModules } from 'ui/modules';
import chrome from 'ui/chrome';

Expand Down Expand Up @@ -84,49 +86,11 @@ app.config([
}
]);

app.run(function ($rootScope, $route, $location, appState) {
app.run(function () {
chrome
.setRootTemplate('<wz-menu></wz-menu><div ng-view></div>')
.setRootController(() => require('./app'));
changeWazuhNavLogo();
appState.setNavigation({ status: false });
appState.setNavigation({
reloaded: false,
discoverPrevious: false,
discoverSections: ['/overview/', '/agents', '/wazuh-dev']
});

$rootScope.$on('$routeChangeSuccess', () => {
appState.setNavigation({ prevLocation: $location.path() });
if (!appState.getNavigation().reloaded) {
appState.setNavigation({ status: true });
} else {
appState.setNavigation({ reloaded: false });
}
});

$rootScope.$on('$locationChangeSuccess', () => {
const navigation = appState.getNavigation();
appState.setNavigation({ currLocation: $location.path() });
if (navigation.currLocation !== navigation.prevLocation) {
if (navigation.discoverSections.includes(navigation.currLocation)) {
appState.setNavigation({ discoverPrevious: navigation.prevLocation });
}
} else {
if (!navigation.status && navigation.prevLocation) {
if (
!navigation.discoverSections.includes(navigation.currLocation) &&
$location.search().tabView !== 'cluster-monitoring'
) {
appState.setNavigation({ reloaded: true });
$location.search('configSubTab', null);
$location.search('editingFile', null);
$route.reload();
}
}
}
appState.setNavigation({ status: false });
});
});

// Added due to Kibana 6.3.0. Do not modify.
Expand All @@ -149,4 +113,4 @@ uiModules.get('kibana').provider('dashboardConfig', () => {
};
}
};
});
});
2 changes: 1 addition & 1 deletion public/controllers/agent/components/register-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class RegisterAgent extends Component {
} && sudo installer -pkg ./wazuh-agent.pkg -target /`,
winText: `Invoke-WebRequest -Uri https://packages.wazuh.com/3.x/windows/wazuh-agent-${
this.state.wazuhVersion
}-1.msi -OutFile wazuh-agent.msi; wazuh-agent.msi /q ADDRESS='${
}-1.msi -OutFile wazuh-agent.msi; ./wazuh-agent.msi /q ADDRESS='${
this.state.serverAddress
}' AUTHD_SERVER='${this.state.serverAddress}'${
this.state.needsPassword
Expand Down
17 changes: 10 additions & 7 deletions public/controllers/misc/health-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ export class HealthCheck {
this.checks.template = configuration['checks.template'];
this.checks.api = configuration['checks.api'];
this.checks.setup = configuration['checks.setup'];
this.checks.fields = configuration['checks.fields'];

this.results.push(
{
Expand All @@ -249,7 +250,7 @@ export class HealthCheck {
{
id: 4,
description: 'Check index pattern known fields',
status: 'Checking...'
status: this.checks.fields ? 'Checking...' : 'disabled'
}
);

Expand All @@ -261,12 +262,14 @@ export class HealthCheck {

this.checksDone = true;

try {
await this.genericReq.request('GET', '/elastic/known-fields/all', {});
this.results[this.results.length - 1].status = 'Ready';
} catch (error) {
this.results[this.results.length - 1].status = 'Error';
this.handleError(error);
if(this.checks.fields){
try {
await this.genericReq.request('GET', '/elastic/known-fields/all', {});
this.results[this.results.length - 1].status = 'Ready';
} catch (error) {
this.results[this.results.length - 1].status = 'Error';
this.handleError(error);
}
}

if (!this.errors || !this.errors.length) {
Expand Down
2 changes: 1 addition & 1 deletion public/controllers/settings/components/add-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class AddApi extends Component {
const editConfigChildren = (
<div>
<EuiText>
Modify <EuiCode>kibana/plugins/wazuh/wazuh.yml</EuiCode> to set the
Modify <EuiCode>/usr/share/kibana/optimize/wazuh/config/wazuh.yml</EuiCode> to set the
connection information.
</EuiText>
<EuiSpacer />
Expand Down
4 changes: 2 additions & 2 deletions public/controllers/settings/components/api-is-down.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class ApiIsDown extends Component {
const apiExample = `# Example Wazuh API configuration
hosts:
- production:
url: http://172.16.1.2
url: https://172.16.1.2
port: 55000
user: foo
password: bar
Expand Down Expand Up @@ -223,7 +223,7 @@ hosts:
<div>
<EuiText>
Review the settings in the{' '}
<EuiCode>kibana/plugins/wazuh/wazuh.yml</EuiCode> file.
<EuiCode>/usr/share/kibana/optimize/wazuh/config/wazuh.yml</EuiCode> file.
</EuiText>
<EuiSpacer />
<EuiCodeBlock language="yaml">{apiExample}</EuiCodeBlock>
Expand Down
31 changes: 15 additions & 16 deletions public/controllers/settings/components/api-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,19 @@ export class ApiTable extends Component {
</EuiToolTip>
</span>
) : (
<span>
<EuiHealth color="danger">Offline</EuiHealth>
<EuiToolTip position="top" content={item.downReason}>
<EuiButtonIcon
color="primary"
style={{ marginTop: '-12px' }}
iconType="questionInCircle"
aria-label="Info about the error"
onClick={() => this.props.copyToClipBoard(item.downReason)}
/>
</EuiToolTip>
</span>
);
<span>
<EuiHealth color="danger">Offline</EuiHealth>
<EuiToolTip position="top" content={item.downReason}>
<EuiButtonIcon
color="primary"
style={{ marginTop: '-12px' }}
iconType="questionInCircle"
aria-label="Info about the error"
onClick={() => this.props.copyToClipBoard(item.downReason)}
/>
</EuiToolTip>
</span>
);
} else {
return (
<span>
Expand Down Expand Up @@ -257,7 +257,7 @@ export class ApiTable extends Component {
<EuiFlexGroup>
<EuiFlexItem>
<EuiTitle>
<h2>Wazuh hosts</h2>
<h2>Wazuh API configuration</h2>
</EuiTitle>
</EuiFlexItem>
</EuiFlexGroup>
Expand All @@ -282,8 +282,7 @@ export class ApiTable extends Component {
<EuiFlexGroup>
<EuiFlexItem>
<EuiText color="subdued" style={{ paddingBottom: '15px' }}>
From here you can see how to set up your Wazuh host, establish as
default, and check their connection and status.
From here you can manage and configure the API entries. You can also check their connection and status.
</EuiText>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
10 changes: 5 additions & 5 deletions public/directives/wz-menu/wz-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ class WzMenu {
$scope.currentSelectedPattern = appState.getCurrentPattern();
}
if (!$scope.menuNavItem) {
$scope.menuNavItem = appState
$scope.menuNavItem = (appState
.getNavigation()
.currLocation.replace(/\//g, '');
.currLocation || '').replace(/\//g, '');
}

if (appState.getCurrentAPI()) {
Expand All @@ -111,15 +111,15 @@ class WzMenu {
let height = false;
try {
height = $('#navDrawerMenu > ul:nth-child(2)')[0].clientHeight;
} catch (error) {} // eslint-disable-line
} catch (error) { } // eslint-disable-line
const barHeight = (height || 51) + 2;
$scope.settedMenuHeight = true;
$('.md-toolbar-tools, md-toolbar')
.css('height', barHeight, 'important')
.css('max-height', barHeight, 'important');
};

$($window).on('resize', function() {
$($window).on('resize', function () {
calcHeight();
});

Expand Down Expand Up @@ -183,4 +183,4 @@ class WzMenu {
}
}

app.directive('wzMenu', () => new WzMenu());
app.directive('wzMenu', () => new WzMenu());
2 changes: 1 addition & 1 deletion public/directives/wz-tabs-eui/components/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class Tabs extends Component {
super(props);

this.tabs = [];
this.props.tabs.forEach(tab => {
(this.props.tabs || []).forEach(tab => {
this.tabs.push({
id: tab.id,
name: tab.name
Expand Down
5 changes: 3 additions & 2 deletions public/factories/vis2png.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Find more information about this on the LICENSE file.
*/

import domtoimage from 'dom-to-image';
import domtoimage from '../utils/dom-to-image';

export class Vis2PNG {
/**
Expand Down Expand Up @@ -38,13 +38,14 @@ export class Vis2PNG {
const tmpNode = this.htmlObject[currentValue];
try {
const tmpResult = await domtoimage.toPng(tmpNode[0]);
if (tmpResult === 'data:,') return;
this.rawArray.push({
element: tmpResult,
width: tmpNode.width(),
height: tmpNode.height(),
id: currentValue
});
} catch (error) {} // eslint-disable-line
} catch (error) { } // eslint-disable-line
currentCompleted++;
this.$rootScope.reportStatus = `Generating report...${Math.round(
(currentCompleted / len) * 100
Expand Down

0 comments on commit 2ab5697

Please sign in to comment.