diff --git a/public/controllers/agent/agents-preview.js b/public/controllers/agent/agents-preview.js index 17ff741b9..98bf5dac6 100644 --- a/public/controllers/agent/agents-preview.js +++ b/public/controllers/agent/agents-preview.js @@ -99,11 +99,9 @@ export class AgentsPreviewController { this.registerAgentsProps = { addNewAgent: flag => this.addNewAgent(flag), - getWazuhVersion: () => this.getWazuhVersion(), - getCurrentApiAddress: () => this.getCurrentApiAddress(), - needsPassword: () => this.needsPassword() + getWazuhVersion: () => this.getWazuhVersion() }; - this.hasAgents = true; + this.init = false; //Load this.load(); @@ -232,12 +230,7 @@ export class AgentsPreviewController { this.lastAgent = unique.lastAgent; this.summary = unique.summary; if (!this.lastAgent || !this.lastAgent.id) { - if (this.addingNewAgent === undefined) { - this.addNewAgent(true); - } - this.hasAgents = false; - } else { - this.hasAgents = true; + this.addNewAgent(true); } if (agentsTop.data.data === '') { @@ -292,37 +285,6 @@ export class AgentsPreviewController { ); } - /** - * Returns if the password is neccesary to register a new agent - */ - async needsPassword() { - try { - const result = await this.apiReq.request('GET', '/agents/000/config/auth/auth', {}); - const auth = ((result.data || {}).data || {}).auth || {}; - const usePassword = auth.use_password === 'yes'; - return usePassword; - - } catch (error) { - return false; - } - } - - /** - * Returns the current API address - */ - async getCurrentApiAddress() { - try { - const result = await this.genericReq.request('GET', '/elastic/apis'); - const entries = result.data || []; - const host = entries.filter(e => {return e._id == this.api}); - const url = host[0]._source.url; - const numToClean = url.startsWith('https://') ? 8 : 7; - return url.substr(numToClean); - } catch (error) { - return false; - } - } - /** * Returns the Wazuh version as x.y.z */ diff --git a/public/controllers/agent/components/register-agent.js b/public/controllers/agent/components/register-agent.js index aa8f824c7..00f4592ae 100644 --- a/public/controllers/agent/components/register-agent.js +++ b/public/controllers/agent/components/register-agent.js @@ -39,25 +39,15 @@ export class RegisterAgent extends Component { this.state = { status: 'incomplete', selectedOS: '', - serverAddress: '', - wazuhPassword: '' + serverAddress: '' }; } async componentDidMount() { try { - const wazuhVersion = await this.props.getWazuhVersion(); - const apiAddress = await this.props.getCurrentApiAddress(); - const needsPassword = await this.props.needsPassword(); - this.setState({ - serverAddress: apiAddress, - needsPassword: needsPassword, - wazuhVersion: wazuhVersion - }) + this.wazuhVersion = await this.props.getWazuhVersion(); } catch (error) { - this.setState({ - wazuhVersion: version - }) + this.wazuhVersion = version; } } @@ -69,21 +59,6 @@ export class RegisterAgent extends Component { this.setState({ serverAddress: event.target.value }); } - setWazuhPassword(event) { - this.setState({ wazuhPassword: event.target.value }); - } - - /** - * Checks if the password is not needed, in that case remove the input password step - * @param {Array} steps - */ - cleanSteps(steps) { - if (this.state.needsPassword) return steps; - steps.splice(2,1); - return steps; - } - - render() { const rpmButton = ( ); - const passwordInput = ( - this.setWazuhPassword(event)} - /> - ); - const copyButton = { position: 'relative', float: 'right', @@ -145,10 +112,10 @@ export class RegisterAgent extends Component { zIndex: '100' }; const customTexts = { - rpmText: `sudo WAZUH_MANAGER_IP='${this.state.serverAddress}'${this.state.needsPassword ? ` WAZUH_PASSWORD='${this.state.wazuhPassword}' ` : ' '}yum install https://packages.wazuh.com/3.x/yum/wazuh-agent-${this.state.wazuhVersion}-1.x86_64.rpm`, - debText: `curl -so wazuh-agent.deb https://packages.wazuh.com/3.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.state.wazuhVersion}-1_amd64.deb && sudo WAZUH_MANAGER_IP='${this.state.serverAddress}'${this.state.needsPassword ? ` WAZUH_PASSWORD='${this.state.wazuhPassword}' ` : ' '} dpkg -i ./wazuh-agent.deb`, - macosText: `curl -so wazuh-agent.pkg https://packages.wazuh.com/3.x/osx/wazuh-agent-${this.state.wazuhVersion}-1.pkg && sudo launchctl setenv WAZUH_MANAGER_IP '${this.state.serverAddress}'${this.state.needsPassword ? ` setenv WAZUH_PASSWORD '${this.state.wazuhPassword}' ` : ' '} && 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='${this.state.serverAddress}' AUTHD_SERVER='${this.state.serverAddress}'${this.state.needsPassword ? ` PASSWORD='${this.state.wazuhPassword}' ` : ' '}` + rpmText: `sudo WAZUH_MANAGER_IP='${this.state.serverAddress}' yum install https://packages.wazuh.com/3.x/yum/wazuh-agent-${this.wazuhVersion}-1.x86_64.rpm`, + debText: `curl -so wazuh-agent.deb https://packages.wazuh.com/3.x/apt/pool/main/w/wazuh-agent/wazuh-agent_${this.wazuhVersion}-1_amd64.deb && sudo WAZUH_MANAGER_IP='${this.state.serverAddress}' dpkg -i ./wazuh-agent.deb`, + macosText: `curl -so wazuh-agent.pkg https://packages.wazuh.com/3.x/osx/wazuh-agent-${this.wazuhVersion}-1.pkg && sudo launchctl setenv WAZUH_MANAGER_IP '${this.state.serverAddress}' && sudo installer -pkg ./wazuh-agent.pkg -target /`, + winText: `Invoke-WebRequest -Uri https://packages.wazuh.com/3.x/windows/wazuh-agent-${this.wazuhVersion}-1.msi -OutFile wazuh-agent.msi; wazuh-agent.msi /q ADDRESS='${this.state.serverAddress}' AUTHD_SERVER='${this.state.serverAddress}'` }; const field = `${this.state.selectedOS}Text`; @@ -199,10 +166,6 @@ export class RegisterAgent extends Component { title: 'Wazuh server address', children: {ipInput} }, - { - title: 'Wazuh password', - children: {passwordInput} - }, { title: 'Complete the installation', children: ( @@ -217,12 +180,12 @@ export class RegisterAgent extends Component { return (
- + -

Deploy a new agent

+

Add a new agent

@@ -239,7 +202,7 @@ export class RegisterAgent extends Component { - + @@ -253,7 +216,5 @@ export class RegisterAgent extends Component { RegisterAgent.propTypes = { addNewAgent: PropTypes.func, - getWazuhVersion: PropTypes.func, - getCurrentApiAddress: PropTypes.func, - needsPassword: PropTypes.func + getWazuhVersion: PropTypes.func }; diff --git a/public/templates/management/groups/groups.html b/public/templates/management/groups/groups.html index 92f0fa9d4..f3fde4994 100644 --- a/public/templates/management/groups/groups.html +++ b/public/templates/management/groups/groups.html @@ -85,71 +85,102 @@
-
-
-
-
- - Cancel - - - - Apply changes - - - - It is not possible to apply changes of more than 500 additions or deletions - -
+
+
+ + Cancel + + Apply changes + It is not + possible to apply changes of more than 500 additions or deletions +
+ + +
+ +
+ + +
- -
- -
- - - -
- - -
-
-
- - - + +
+
- + + - - +
+ + + + + +
+ + +
+
+ +
+
+
+ + +
+ + + + + + +
+ + + {{error.id}}{{$last + ? '' : ', '}}: {{group[0].message}} + + + + +
- - +
-
-
- -
- - - - - - -
- - - {{error.id}}{{$last - ? '' : ', '}}: {{group[0].message}} - - + + + + + + + +
+ + +
+
- -
- -
- -
-
- - -
-
-
- - - - - - - - -
- - -
-
- - -
-
-
- - - - - - - -
-
-
- {{ filename }} - - -
-
-
-
-
-
- -
- -
-
-
-
- - - No agents were added to this manager. +
+ +
+ + + + + + + + + +
+
+
+ {{ filename }} + + +
+
+
- -
-
- +{{currentAdding}} -{{currentDeleting}} - -
+ +
+ +
+ +{{currentAdding}} -{{currentDeleting}} + +
diff --git a/public/templates/overview/footer.foot b/public/templates/overview/footer.foot deleted file mode 100644 index 2d8bb3eb2..000000000 --- a/public/templates/overview/footer.foot +++ /dev/null @@ -1,3 +0,0 @@ -
-
-
\ No newline at end of file diff --git a/public/templates/overview/overview-fim.html b/public/templates/overview/overview-fim.html index ee62f7c31..ed57b48ba 100644 --- a/public/templates/overview/overview-fim.html +++ b/public/templates/overview/overview-fim.html @@ -1,116 +1,99 @@ -
-
- + + +
+ + + Alerts by action over time + + + + + + + + + +
+
+ + + Top 5 agents + + + + + + + + + + + + Events summary + + + + + + + + + +
-
- -
-
- - - No agents were added to this manager: - - - Deploy new agent - -
- -
- -
- - - Alerts by action over time - - - - - - - - - -
-
- - - Top 5 agents - - - - - - - - - - - - Events summary - - - - - - - - - - -
-
- - - Rule distribution - - - - - - - - - +
+ + + Rule distribution + + + + + + + + + - - - Actions - - - - - - - - - - - - - Top 5 users - - - - - - - - - -
-
- - - Alerts summary - - - - - - - - - -
- + + + Actions + + + + + + + + + + + + + Top 5 users + + + + + + + + + +
+
+ + + Alerts summary + + + + + + + + + +
+
\ No newline at end of file diff --git a/public/templates/overview/overview-general.html b/public/templates/overview/overview-general.html index acf172c52..c60d54ee9 100644 --- a/public/templates/overview/overview-general.html +++ b/public/templates/overview/overview-general.html @@ -1,5 +1,5 @@ + ng-class="{'no-opacity': resultState !== 'ready' || !rendered}">
- diff --git a/public/templates/overview/overview.head b/public/templates/overview/overview.head index 15b1051b4..e28bbf571 100644 --- a/public/templates/overview/overview.head +++ b/public/templates/overview/overview.head @@ -1,98 +1,80 @@ -
-
- +
+ +
+ +
+ +
+ Overview + / + {{ octrl.tabNames[octrl.tab] }} +
+
+ + + + + + + +
+ + +
+ + + +
+ + +
+
-
-
- -
- -
- -
- Overview - / - {{ octrl.tabNames[octrl.tab] }} -
-
- + - - - + +
+ +
+ - -
- - -
- + + + - -
- - -
- -
- + +
+
+
{{loadingStatus}}
+
+ - -
- -
- + +
+
+
{{reportStatus}}
+
+ - - - - - -
-
-
{{loadingStatus}}
-
- - - -
-
-
{{reportStatus}}
-
- - - -
- -
- -
-
- - - No agents were added to this manager: - - - Deploy new agent - -
- -
- \ No newline at end of file + +
+ +
+ \ No newline at end of file diff --git a/public/templates/overview/overview.pug b/public/templates/overview/overview.pug index 6b637166b..496468d78 100644 --- a/public/templates/overview/overview.pug +++ b/public/templates/overview/overview.pug @@ -15,4 +15,4 @@ include ./overview-aws.html include ./overview-virustotal.html include ./overview-osquery.html include ./overview-docker.html -include ./footer.foot +include ../footer.foot