Skip to content

Commit 320825d

Browse files
committed
Bump 7.2 into 7.3
1 parent f100668 commit 320825d

File tree

97 files changed

+4001
-6882
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+4001
-6882
lines changed

.yarnignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
plugins/wazuh/server/wazuh-version.json

config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
# Values must to be true or false.
4040
#extensions.pci : true
4141
#extensions.gdpr : true
42+
#extensions.hipaa : true
43+
#extensions.nist : true
4244
#extensions.audit : true
4345
#extensions.oscap : false
4446
#extensions.ciscat : false
@@ -57,11 +59,9 @@
5759
#
5860
# ------------------------------ Advanced indices ------------------------------
5961
#
60-
# Configure .wazuh and .wazuh-version indices shards and replicas.
62+
# Configure .wazuh indices shards and replicas.
6163
#wazuh.shards : 1
6264
#wazuh.replicas : 0
63-
#wazuh-version.shards : 1
64-
#wazuh-version.replicas: 0
6565
#
6666
# --------------------------- Index pattern selector ---------------------------
6767
#

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "wazuh",
3-
"version": "3.9.4",
4-
"revision": "0528",
5-
"code": "0528-0",
3+
"version": "3.10.0",
4+
"revision": "05269",
5+
"code": "0529-0",
66
"kibana": {
77
"version": "7.3.0"
88
},

public/components/eui-loader.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
} from '@elastic/eui';
2424

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

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

@@ -35,4 +36,5 @@ app
3536
.value('EuiBasicTable', EuiBasicTable)
3637
.value('EuiHealth', EuiHealth)
3738
.value('EuiCallOut', EuiCallOut)
38-
.value('BasicTable', BasicTable);
39+
.value('BasicTable', BasicTable)
40+
.value('Tabs', Tabs);

public/controllers/agent/agents-preview.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,12 @@ export class AgentsPreviewController {
9292

9393
this.$scope.$on('wazuhFetched', (ev, parameters) => {
9494
ev.stopPropagation();
95-
this.$scope.showNoAgents =
96-
!parameters.items.length > 0 && !parameters.filters.length;
9795
});
9896

97+
this.registerAgentsProps = {
98+
addNewAgent: flag => this.addNewAgent(flag)
99+
};
100+
99101
this.init = false;
100102
//Load
101103
this.load();
@@ -201,6 +203,9 @@ export class AgentsPreviewController {
201203
this.osPlatforms = unique.osPlatforms;
202204
this.lastAgent = unique.lastAgent;
203205
this.summary = unique.summary;
206+
if (!this.lastAgent || !this.lastAgent.id) {
207+
this.addNewAgent(true);
208+
}
204209

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

228-
registerNewAgent(flag) {
229-
this.$scope.registerNewAgent = flag;
233+
addNewAgent(flag) {
234+
this.addingNewAgent = flag;
230235
}
231236

232237
reloadList() {
@@ -245,6 +250,7 @@ export class AgentsPreviewController {
245250
} catch (error) {
246251
this.errorHandler.handle('Error refreshing agents stats');
247252
}
253+
this.$scope.$broadcast('reloadSearchFilterBar', {});
248254
}
249255

250256
openRegistrationDocs() {

public/controllers/agent/agents.js

+70-15
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { generateMetric } from '../../utils/generate-metric';
1414
import { TabNames } from '../../utils/tab-names';
1515
import * as FileSaver from '../../services/file-saver';
1616
import { TabDescription } from '../../../server/reporting/tab-description';
17+
import { UnsupportedComponents } from '../../utils/components-os-support';
1718
import {
1819
metricsGeneral,
1920
metricsAudit,
@@ -165,7 +166,7 @@ export class AgentsController {
165166
this.$scope.hostMonitoringTabs = ['general', 'fim', 'syscollector'];
166167
this.$scope.systemAuditTabs = ['pm', 'sca', 'audit', 'oscap', 'ciscat'];
167168
this.$scope.securityTabs = ['vuls', 'virustotal', 'osquery', 'docker'];
168-
this.$scope.complianceTabs = ['pci', 'gdpr'];
169+
this.$scope.complianceTabs = ['pci', 'gdpr', 'hipaa', 'nist'];
169170

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

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

218+
this.$scope.shouldShowComponent = component =>
219+
this.shouldShowComponent(component);
220+
217221
this.$scope.$on('$destroy', () => {
218222
this.visFactoryService.clearAll();
219223
});
@@ -225,6 +229,14 @@ export class AgentsController {
225229
this.$location.path('/manager/groups');
226230
};
227231

232+
this.$scope.exportConfiguration = enabledComponents => {
233+
this.reportingService.startConfigReport(
234+
this.$scope.agent,
235+
'agentConfig',
236+
enabledComponents
237+
);
238+
};
239+
228240
this.$scope.restartAgent = async agent => {
229241
this.$scope.restartingAgent = true;
230242
try {
@@ -437,14 +449,6 @@ export class AgentsController {
437449
};
438450

439451
this.$scope.expand = i => this.expand(i);
440-
441-
this.$scope.welcomeCardsProps = {
442-
switchTab: tab => this.switchTab(tab),
443-
extensions: this.$scope.extensions,
444-
api: this.appState.getCurrentAPI(),
445-
setExtensions: (api, extensions) =>
446-
this.appState.setExtensions(api, extensions)
447-
};
448452
}
449453
/**
450454
* Create metric for given object
@@ -562,7 +566,7 @@ export class AgentsController {
562566
this.$scope.agent.status =
563567
(((agentInfo || {}).data || {}).data || {}).status ||
564568
this.$scope.agent.status;
565-
} catch (error) {} // eslint-disable-line
569+
} catch (error) { } // eslint-disable-line
566570
}
567571

568572
try {
@@ -579,6 +583,18 @@ export class AgentsController {
579583
this.$scope.selectedGdprIndex = 0;
580584
}
581585

586+
if (tab === 'hipaa') {
587+
const hipaaTabs = await this.commonData.getHIPAA();
588+
this.$scope.hipaaTabs = hipaaTabs;
589+
this.$scope.selectedHipaaIndex = 0;
590+
}
591+
592+
if (tab === 'nist') {
593+
const nistTabs = await this.commonData.getNIST();
594+
this.$scope.nistTabs = nistTabs;
595+
this.$scope.selectedNistIndex = 0;
596+
}
597+
582598
if (tab === 'sca') {
583599
try {
584600
this.$scope.loadSca = true;
@@ -598,7 +614,7 @@ export class AgentsController {
598614
if (tab === 'syscollector')
599615
try {
600616
await this.loadSyscollector(this.$scope.agent.id);
601-
} catch (error) {} // eslint-disable-line
617+
} catch (error) { } // eslint-disable-line
602618
if (tab === 'configuration') {
603619
this.$scope.switchConfigurationTab('welcome');
604620
} else {
@@ -730,12 +746,13 @@ export class AgentsController {
730746
if (agentInfo && this.$scope.agent.os) {
731747
this.$scope.agentOS =
732748
this.$scope.agent.os.name + ' ' + this.$scope.agent.os.version;
733-
this.$scope.agent.isLinuxOS = this.$scope.agent.os.uname.includes(
734-
'Linux'
735-
);
749+
const isLinux = this.$scope.agent.os.uname.includes('Linux');
750+
this.$scope.agent.agentPlatform = isLinux
751+
? 'linux'
752+
: this.$scope.agent.os.platform;
736753
} else {
737754
this.$scope.agentOS = '-';
738-
this.$scope.agent.isLinuxOS = false;
755+
this.$scope.agent.agentPlatform = false;
739756
}
740757

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

768+
this.loadWelcomeCardsProps();
751769
this.$scope.load = false;
752770
this.$scope.$applyAsync();
753771
return;
@@ -767,11 +785,48 @@ export class AgentsController {
767785
this.$location.path('/agents-preview');
768786
}
769787
}
788+
770789
this.$scope.load = false;
771790
this.$scope.$applyAsync();
772791
return;
773792
}
774793

794+
shouldShowComponent(component) {
795+
return !(
796+
UnsupportedComponents[this.$scope.agent.agentPlatform] ||
797+
UnsupportedComponents['other']
798+
).includes(component);
799+
}
800+
801+
cleanExtensions(extensions) {
802+
const result = {};
803+
for (const extension in extensions) {
804+
if (
805+
!(
806+
UnsupportedComponents[this.$scope.agent.agentPlatform] ||
807+
UnsupportedComponents['other']
808+
).includes(extension)
809+
) {
810+
result[extension] = extensions[extension];
811+
}
812+
}
813+
return result;
814+
}
815+
816+
/**
817+
* Get available welcome cards after getting the agent
818+
*/
819+
loadWelcomeCardsProps() {
820+
this.$scope.welcomeCardsProps = {
821+
switchTab: tab => this.switchTab(tab),
822+
extensions: this.cleanExtensions(this.$scope.extensions),
823+
agent: this.$scope.agent,
824+
api: this.appState.getCurrentAPI(),
825+
setExtensions: (api, extensions) =>
826+
this.appState.setExtensions(api, extensions)
827+
};
828+
}
829+
775830
switchGroupEdit() {
776831
this.$scope.editGroup = !!!this.$scope.editGroup;
777832
this.$scope.$applyAsync();

0 commit comments

Comments
 (0)