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

Reject connection if client has a different cluster name #892

Merged
merged 2 commits into from
Jul 12, 2018

Conversation

mgmacias95
Copy link
Contributor

Hello team,

This PR fixes #803.

The error shown in the master node is:

# /var/ossec/bin/wazuh-clusterd -f
2018-07-04 04:24:52,047 INFO    : [Master] PID: 12853
2018-07-04 04:24:52,048 INFO    : [Master] Listening '0.0.0.0:1516'.
2018-07-04 04:24:52,293 ERROR   : [Transport-ServerHandler] Error accepting connection from 192.168.185.7: Incoming connection from '192.168.185.7' rejected: cluster name is different (wazuh2/wazuh).
2018-07-04 04:24:52,293 INFO    : [Master] Connection with 192.168.185.7 closed.
2018-07-04 04:24:54,052 INFO    : [Master] [Internal-COM ]: Ready.
2018-07-04 04:25:03,241 ERROR   : [Transport-ServerHandler] Error accepting connection from 192.168.185.7: Incoming connection from '192.168.185.7' rejected: cluster name is different (wazuh2/wazuh).
2018-07-04 04:25:03,242 INFO    : [Master] Connection with 192.168.185.7 closed.
^C2018-07-04 04:25:13,629 INFO    : [Master] Exiting. Reason: 'Signal [2-Interrupt] received.'.

This is the output from a client node:

# /var/ossec/bin/wazuh-clusterd -f
2018-07-04 04:24:52,063 INFO    : [Client] PID: 2806
2018-07-04 04:24:52,186 INFO    : [Client] Connecting to 192.168.185.6:1516.
2018-07-04 04:24:52,187 INFO    : [Client] Connected.
2018-07-04 04:24:52,296 INFO    : [Client] Disconnected.
2018-07-04 04:24:52,296 ERROR   : [Client] Disconnected. Trying to connect again in 10s.
2018-07-04 04:24:54,067 INFO    : [Client] [Internal-COM ]: Ready.
2018-07-04 04:25:03,242 INFO    : [Client] Connecting to 192.168.185.6:1516.
2018-07-04 04:25:03,243 INFO    : [Client] Connected.
2018-07-04 04:25:03,244 INFO    : [Client] Disconnected.
2018-07-04 04:25:03,244 ERROR   : [Client] Disconnected. Trying to connect again in 10s.
^C2018-07-04 04:25:13,624 INFO    : [Client] Exiting. Reason: 'Signal [2-Interrupt] received.'.

Best regards,
Marta

@jesuslinares jesuslinares merged commit ad1a8df into 3.5 Jul 12, 2018
@jesuslinares jesuslinares deleted the dev-3.4-fix-different-cluster-names-bug branch July 12, 2018 16:22
mgmacias95 pushed a commit that referenced this pull request Jul 13, 2018
vikman90 pushed a commit that referenced this pull request Jul 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants