Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed WAZUH_PROTOCOL param suggestion #4849

Merged
merged 2 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ commands of Start the agent in the deploy new agent section [#4458](https://gith
- Improved the message displayed when there is a versions mismatch between the Wazuh API and the Wazuh APP [#4529](https://github.com/wazuh/wazuh-kibana-app/pull/4529)
- Changed the endpoint that updates the plugin configuration to support multiple settings. [#4501](https://github.com/wazuh/wazuh-kibana-app/pull/4501)
- Allowed to upload an image for the `customization.logo.*` settings in `Settings/Configuration` [#4504](https://github.com/wazuh/wazuh-kibana-app/pull/4504)
- Fixed WAZUH_PROTOCOL param suggestion [#4849](https://github.com/wazuh/wazuh-kibana-app/pull/4849)

### Fixed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ describe('Register agent service', () => {
jest.clearAllMocks();
})

it('should return UDP when the server address is typed manually (custom)', async () => {
it('should return IS NOT UDP when the server address is typed manually (custom)', async () => {
const nodeSelected: ServerAddressOptions = {
label: 'node-selected',
value: 'node-selected',
Expand Down Expand Up @@ -225,11 +225,11 @@ describe('Register agent service', () => {
WzRequest.apiReq = jest.fn().mockResolvedValueOnce(mockedResponse);

const config = await RegisterAgentService.getConnectionConfig(nodeSelected, 'default-dns-address');
expect(config.udpProtocol).toEqual(true);
expect(config.udpProtocol).toEqual(false);
expect(config.serverAddress).toBe('default-dns-address');
})

it('should return UDP when the server address is received like default server address dns (custom)', async () => {
it('should return IS NOT UDP when the server address is received like default server address dns (custom)', async () => {
const nodeSelected: ServerAddressOptions = {
label: 'node-selected',
value: 'node-selected',
Expand Down Expand Up @@ -265,8 +265,8 @@ describe('Register agent service', () => {
};
WzRequest.apiReq = jest.fn().mockResolvedValueOnce(mockedResponse);

const config = await RegisterAgentService.getConnectionConfig(nodeSelected);
expect(config.udpProtocol).toEqual(true);
const config = await RegisterAgentService.getConnectionConfig(nodeSelected, 'custom-server-address');
expect(config.udpProtocol).toEqual(false);
})
})
});
4 changes: 2 additions & 2 deletions public/controllers/agent/components/register-agent-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ async function getConnectionConfig(nodeSelected: ServerAddressOptions, defaultSe
const remoteConfig = await getRemoteConfiguration(nodeName);
return { serverAddress: remoteConfig.name, udpProtocol: remoteConfig.isUdp, connectionSecure: remoteConfig.haveSecureConnection };
}else{
return { serverAddress: nodeName, udpProtocol: true, connectionSecure: true };
return { serverAddress: nodeName, udpProtocol: false, connectionSecure: true };
}
}else{
return { serverAddress: defaultServerAddress, udpProtocol: true, connectionSecure: true };
return { serverAddress: defaultServerAddress, udpProtocol: false, connectionSecure: true };
}
}

Expand Down