Skip to content

Commit

Permalink
Bump 7.2 into 7.3
Browse files Browse the repository at this point in the history
  • Loading branch information
juankaromo committed Aug 7, 2019
1 parent f100668 commit 320825d
Show file tree
Hide file tree
Showing 97 changed files with 4,001 additions and 6,882 deletions.
1 change: 1 addition & 0 deletions .yarnignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
plugins/wazuh/server/wazuh-version.json
6 changes: 3 additions & 3 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
# Values must to be true or false.
#extensions.pci : true
#extensions.gdpr : true
#extensions.hipaa : true
#extensions.nist : true
#extensions.audit : true
#extensions.oscap : false
#extensions.ciscat : false
Expand All @@ -57,11 +59,9 @@
#
# ------------------------------ Advanced indices ------------------------------
#
# Configure .wazuh and .wazuh-version indices shards and replicas.
# Configure .wazuh indices shards and replicas.
#wazuh.shards : 1
#wazuh.replicas : 0
#wazuh-version.shards : 1
#wazuh-version.replicas: 0
#
# --------------------------- Index pattern selector ---------------------------
#
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "wazuh",
"version": "3.9.4",
"revision": "0528",
"code": "0528-0",
"version": "3.10.0",
"revision": "05269",
"code": "0529-0",
"kibana": {
"version": "7.3.0"
},
Expand Down
4 changes: 3 additions & 1 deletion public/components/eui-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
} from '@elastic/eui';

import { BasicTable } from '../directives/wz-table-eui/components/table';
import { Tabs } from '../directives/wz-tabs-eui/components/tabs';

const app = uiModules.get('app/wazuh', ['react']);

Expand All @@ -35,4 +36,5 @@ app
.value('EuiBasicTable', EuiBasicTable)
.value('EuiHealth', EuiHealth)
.value('EuiCallOut', EuiCallOut)
.value('BasicTable', BasicTable);
.value('BasicTable', BasicTable)
.value('Tabs', Tabs);
14 changes: 10 additions & 4 deletions public/controllers/agent/agents-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,12 @@ export class AgentsPreviewController {

this.$scope.$on('wazuhFetched', (ev, parameters) => {
ev.stopPropagation();
this.$scope.showNoAgents =
!parameters.items.length > 0 && !parameters.filters.length;
});

this.registerAgentsProps = {
addNewAgent: flag => this.addNewAgent(flag)
};

this.init = false;
//Load
this.load();
Expand Down Expand Up @@ -201,6 +203,9 @@ export class AgentsPreviewController {
this.osPlatforms = unique.osPlatforms;
this.lastAgent = unique.lastAgent;
this.summary = unique.summary;
if (!this.lastAgent || !this.lastAgent.id) {
this.addNewAgent(true);
}

if (agentsTop.data.data === '') {
this.mostActiveAgent.name = this.appState.getClusterInfo().manager;
Expand All @@ -225,8 +230,8 @@ export class AgentsPreviewController {
return;
}

registerNewAgent(flag) {
this.$scope.registerNewAgent = flag;
addNewAgent(flag) {
this.addingNewAgent = flag;
}

reloadList() {
Expand All @@ -245,6 +250,7 @@ export class AgentsPreviewController {
} catch (error) {
this.errorHandler.handle('Error refreshing agents stats');
}
this.$scope.$broadcast('reloadSearchFilterBar', {});
}

openRegistrationDocs() {
Expand Down
85 changes: 70 additions & 15 deletions public/controllers/agent/agents.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { generateMetric } from '../../utils/generate-metric';
import { TabNames } from '../../utils/tab-names';
import * as FileSaver from '../../services/file-saver';
import { TabDescription } from '../../../server/reporting/tab-description';
import { UnsupportedComponents } from '../../utils/components-os-support';
import {
metricsGeneral,
metricsAudit,
Expand Down Expand Up @@ -165,7 +166,7 @@ export class AgentsController {
this.$scope.hostMonitoringTabs = ['general', 'fim', 'syscollector'];
this.$scope.systemAuditTabs = ['pm', 'sca', 'audit', 'oscap', 'ciscat'];
this.$scope.securityTabs = ['vuls', 'virustotal', 'osquery', 'docker'];
this.$scope.complianceTabs = ['pci', 'gdpr'];
this.$scope.complianceTabs = ['pci', 'gdpr', 'hipaa', 'nist'];

/**
* This check if given array of items contais a single given item
Expand Down Expand Up @@ -214,6 +215,9 @@ export class AgentsController {

this.$scope.startVis2Png = () => this.startVis2Png();

this.$scope.shouldShowComponent = component =>
this.shouldShowComponent(component);

this.$scope.$on('$destroy', () => {
this.visFactoryService.clearAll();
});
Expand All @@ -225,6 +229,14 @@ export class AgentsController {
this.$location.path('/manager/groups');
};

this.$scope.exportConfiguration = enabledComponents => {
this.reportingService.startConfigReport(
this.$scope.agent,
'agentConfig',
enabledComponents
);
};

this.$scope.restartAgent = async agent => {
this.$scope.restartingAgent = true;
try {
Expand Down Expand Up @@ -437,14 +449,6 @@ export class AgentsController {
};

this.$scope.expand = i => this.expand(i);

this.$scope.welcomeCardsProps = {
switchTab: tab => this.switchTab(tab),
extensions: this.$scope.extensions,
api: this.appState.getCurrentAPI(),
setExtensions: (api, extensions) =>
this.appState.setExtensions(api, extensions)
};
}
/**
* Create metric for given object
Expand Down Expand Up @@ -562,7 +566,7 @@ export class AgentsController {
this.$scope.agent.status =
(((agentInfo || {}).data || {}).data || {}).status ||
this.$scope.agent.status;
} catch (error) {} // eslint-disable-line
} catch (error) { } // eslint-disable-line
}

try {
Expand All @@ -579,6 +583,18 @@ export class AgentsController {
this.$scope.selectedGdprIndex = 0;
}

if (tab === 'hipaa') {
const hipaaTabs = await this.commonData.getHIPAA();
this.$scope.hipaaTabs = hipaaTabs;
this.$scope.selectedHipaaIndex = 0;
}

if (tab === 'nist') {
const nistTabs = await this.commonData.getNIST();
this.$scope.nistTabs = nistTabs;
this.$scope.selectedNistIndex = 0;
}

if (tab === 'sca') {
try {
this.$scope.loadSca = true;
Expand All @@ -598,7 +614,7 @@ export class AgentsController {
if (tab === 'syscollector')
try {
await this.loadSyscollector(this.$scope.agent.id);
} catch (error) {} // eslint-disable-line
} catch (error) { } // eslint-disable-line
if (tab === 'configuration') {
this.$scope.switchConfigurationTab('welcome');
} else {
Expand Down Expand Up @@ -730,12 +746,13 @@ export class AgentsController {
if (agentInfo && this.$scope.agent.os) {
this.$scope.agentOS =
this.$scope.agent.os.name + ' ' + this.$scope.agent.os.version;
this.$scope.agent.isLinuxOS = this.$scope.agent.os.uname.includes(
'Linux'
);
const isLinux = this.$scope.agent.os.uname.includes('Linux');
this.$scope.agent.agentPlatform = isLinux
? 'linux'
: this.$scope.agent.os.platform;
} else {
this.$scope.agentOS = '-';
this.$scope.agent.isLinuxOS = false;
this.$scope.agent.agentPlatform = false;
}

await this.$scope.switchTab(this.$scope.tab, true);
Expand All @@ -748,6 +765,7 @@ export class AgentsController {
this.$scope.agent.group && !this.$scope.agent.group.includes(item)
);

this.loadWelcomeCardsProps();
this.$scope.load = false;
this.$scope.$applyAsync();
return;
Expand All @@ -767,11 +785,48 @@ export class AgentsController {
this.$location.path('/agents-preview');
}
}

this.$scope.load = false;
this.$scope.$applyAsync();
return;
}

shouldShowComponent(component) {
return !(
UnsupportedComponents[this.$scope.agent.agentPlatform] ||
UnsupportedComponents['other']
).includes(component);
}

cleanExtensions(extensions) {
const result = {};
for (const extension in extensions) {
if (
!(
UnsupportedComponents[this.$scope.agent.agentPlatform] ||
UnsupportedComponents['other']
).includes(extension)
) {
result[extension] = extensions[extension];
}
}
return result;
}

/**
* Get available welcome cards after getting the agent
*/
loadWelcomeCardsProps() {
this.$scope.welcomeCardsProps = {
switchTab: tab => this.switchTab(tab),
extensions: this.cleanExtensions(this.$scope.extensions),
agent: this.$scope.agent,
api: this.appState.getCurrentAPI(),
setExtensions: (api, extensions) =>
this.appState.setExtensions(api, extensions)
};
}

switchGroupEdit() {
this.$scope.editGroup = !!!this.$scope.editGroup;
this.$scope.$applyAsync();
Expand Down
Loading

0 comments on commit 320825d

Please sign in to comment.