-
Regulatory Compliance
-
- Show extensions list
-
-
-
-
- -
-
- PCI DSS
-
- -
-
- GDPR
-
- -
-
- HIPAA
-
- -
-
- NIST 800-53
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/SplunkAppForWazuh/appserver/static/js/controllers/overview/welcome/overviewWelcomeCtrl.js b/SplunkAppForWazuh/appserver/static/js/controllers/overview/welcome/overviewWelcomeCtrl.js
index 266c20654..26c4aea73 100644
--- a/SplunkAppForWazuh/appserver/static/js/controllers/overview/welcome/overviewWelcomeCtrl.js
+++ b/SplunkAppForWazuh/appserver/static/js/controllers/overview/welcome/overviewWelcomeCtrl.js
@@ -25,6 +25,7 @@ define(['../../module'], function(controllers) {
threadDetection: false,
regulatory: false
}
+ this.scope.showRegisterGuide = false
try {
this.scope.agentsCountTotal = agentsInfo.data.data.Total - 1
this.scope.agentsCountActive = agentsInfo.data.data.Active - 1
@@ -45,6 +46,7 @@ define(['../../module'], function(controllers) {
$onInit() {
this.refreshExtensions()
this.scope.showExtensionsLists = card => this.showExtensionsLists(card)
+ this.scope.showRegisterAgent = () => this.showRegisterAgent()
this.scope.toggleExtension = (extension, state) =>
this.toggleExtension(extension, state)
this.scope.$applyAsync()
@@ -63,6 +65,17 @@ define(['../../module'], function(controllers) {
}
}
+ /**
+ * Shows/hide the register agent guide
+ */
+ showRegisterAgent() {
+ try {
+ this.scope.showRegisterGuide = !this.scope.showRegisterGuide
+ } catch (error) {
+ console.error('Error showing the register agent guide ', error)
+ }
+ }
+
/**
* Enable or disable extension
* @param {String} extension
diff --git a/SplunkAppForWazuh/appserver/static/js/directives/wz-register-agent/wz-register-agent.html b/SplunkAppForWazuh/appserver/static/js/directives/wz-register-agent/wz-register-agent.html
index 7d79b7828..feb982cc0 100644
--- a/SplunkAppForWazuh/appserver/static/js/directives/wz-register-agent/wz-register-agent.html
+++ b/SplunkAppForWazuh/appserver/static/js/directives/wz-register-agent/wz-register-agent.html
@@ -1,8 +1,11 @@
-
+
+
-
+
1
Choose your OS
@@ -36,10 +39,21 @@
ng-change="selectManagerAddress(managerAddress)">
+
+
+
+
3
+
+
Wazuh password
+
+
+
+
-
3
+
{{passwordNeeded ? 4 : 3}}
Complete the installation
@@ -64,7 +78,12 @@
Copy to clipboard
- sudo WAZUH_MANAGER_IP='{{config.managerIp}}' yum install https://packages.wazuh.com/3.x/yum/wazuh-agent-{{wazuhVersion}}-1.x86_64.rpm
+
+ sudo WAZUH_MANAGER_IP='{{config.managerIp}}' WAZUH_PASSWORD='{{config.wazuhPassword}}' yum install https://packages.wazuh.com/3.x/yum/wazuh-agent-{{wazuhVersion}}-1.x86_64.rpm
+
+
+ sudo WAZUH_MANAGER_IP='{{config.managerIp}}' yum install https://packages.wazuh.com/3.x/yum/wazuh-agent-{{wazuhVersion}}-1.x86_64.rpm
+
@@ -76,7 +95,12 @@
Copy to clipboard
- curl -so wazuh-agent.deb https://packages.wazuh.com/3.x/apt/pool/main/w/wazuh-agent/wazuh-agent_{{wazuhVersion}}-1_amd64.deb && sudo WAZUH_MANAGER_IP='{{config.managerIp}}' dpkg -i ./wazuh-agent.deb
+
+ curl -so wazuh-agent.deb https://packages.wazuh.com/3.x/apt/pool/main/w/wazuh-agent/wazuh-agent_{{wazuhVersion}}-1_amd64.deb && sudo WAZUH_MANAGER_IP='{{config.managerIp}}' WAZUH_PASSWORD='{{config.wazuhPassword}}' dpkg -i ./wazuh-agent.deb
+
+
+ curl -so wazuh-agent.deb https://packages.wazuh.com/3.x/apt/pool/main/w/wazuh-agent/wazuh-agent_{{wazuhVersion}}-1_amd64.deb && sudo WAZUH_MANAGER_IP='{{config.managerIp}}' dpkg -i ./wazuh-agent.deb
+
@@ -88,7 +112,12 @@
Copy to clipboard
- Invoke-WebRequest -Uri https://packages.wazuh.com/3.x/windows/wazuh-agent-{{wazuhVersion}}-1.msi -OutFile wazuh-agent.msi; wazuh-agent.msi /q ADDRESS='{{config.managerIp}}' AUTHD_SERVER='{{config.managerIp}}'
+
+ Invoke-WebRequest -Uri https://packages.wazuh.com/3.x/windows/wazuh-agent-{{wazuhVersion}}-1.msi -OutFile wazuh-agent.msi; wazuh-agent.msi /q ADDRESS='{{config.managerIp}}' AUTHD_SERVER='{{config.managerIp}} PASSWORD='{{config.wazuhPassword}}' '
+
+
+ Invoke-WebRequest -Uri https://packages.wazuh.com/3.x/windows/wazuh-agent-{{wazuhVersion}}-1.msi -OutFile wazuh-agent.msi; wazuh-agent.msi /q ADDRESS='{{config.managerIp}}' AUTHD_SERVER='{{config.managerIp}} '
+
diff --git a/SplunkAppForWazuh/appserver/static/js/directives/wz-register-agent/wz-register-agent.js b/SplunkAppForWazuh/appserver/static/js/directives/wz-register-agent/wz-register-agent.js
index 2f1a3c3c5..630c17a51 100644
--- a/SplunkAppForWazuh/appserver/static/js/directives/wz-register-agent/wz-register-agent.js
+++ b/SplunkAppForWazuh/appserver/static/js/directives/wz-register-agent/wz-register-agent.js
@@ -18,15 +18,43 @@ define(['../module'], function(directives) {
scope: {},
controller($scope, $notificationService, $requestService) {
const apiReq = $requestService.apiReq
+
+ /**
+ * Obtain the current selected API from the session storage and removes the "http://" or "https://" from the URL
+ */
+ this.getSelectedApi = () => {
+ var api_url = window.sessionStorage.selectedAPI ? JSON.parse(window.sessionStorage.selectedAPI).url : ''
+ const numToClean = api_url.startsWith('https://') ? 8 : 7;
+ api_url = api_url.substr(numToClean);
+ $scope.managerAddress = api_url
+ return api_url
+ }
+
+ this.isPasswordNeeded = async () => {
+ try{
+ $scope.isLoading = true
+ const result = await $requestService.apiReq('/agents/000/config/auth/auth')
+ const auth = ((result.data || {}).data || {}).auth || {};
+ const usePassword = auth.use_password === 'yes';
+ $scope.passwordNeeded = usePassword;
+ } catch (error) {
+ $scope.passwordNeeded = false;
+ }
+ $scope.isLoading = false
+ $scope.$applyAsync()
+ }
+
$scope.config = {
osSelected: 'redhat',
- managerIp: '',
+ managerIp: this.getSelectedApi(),
+ wazuhPassword: '',
agentName: '',
agentKey: ''
}
$scope.newInstall = true
$scope.registeredAgent = false
$scope.showNavTab = false
+ this.isPasswordNeeded()
// Functions
$scope.selectOs = os => {
@@ -49,6 +77,11 @@ define(['../module'], function(directives) {
$scope.$applyAsync()
}
+ $scope.selectWazuhPassword = wazuhPassword => {
+ $scope.config.wazuhPassword = wazuhPassword
+ $scope.$applyAsync()
+ }
+
$scope.selectAgentName = agentName => {
$scope.config.agentName = agentName
$scope.registeredAgent = false
@@ -86,7 +119,7 @@ define(['../module'], function(directives) {
)
}
}
-
+
$scope.getVersion = async () => {
$scope.wazuhVersion = await $requestService.apiReq('/version')
$scope.wazuhVersion = ((($scope.wazuhVersion || {}).data || {}).data || {})