-
Notifications
You must be signed in to change notification settings - Fork 94
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
The validation of DNS doesn't support some expected valid values in wazuh_install.sh
#2350
Comments
Update ReportResearchIn https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address, the following regex is considered one of the best regex to match valid DNS: This regex specifies that:
The following screenshot shows some valid and invalid matches: Notice that the string The previous regex |
Update ReportAfter talking with the team, the The regex is the following: |
Update ReportTestingUsing valid DNS
nodes:
# Wazuh indexer nodes
indexer:
- name: node-1
ip: www.google.es
#- name: node-2
# ip: <indexer-node-ip>
#- name: node-3d
# ip: <indexer-node-ip>
# Wazuh server nodes
# If there is more than one Wazuh server
# node, each one must have a node_type
server:
- name: wazuh-1
ip: foo.bar1.com Output: 24/08/2023 09:40:13 DEBUG: Creating the Wazuh indexer certificates.
Ignoring -days without -x509; not generating a certificate
.....+...+..................+.....+.........+.+.....................+........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+..+....+..+...+......+....+..+....+...+..+...+.+..+.......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+...+.......+...+..+.......+.....+.......+........+.......+...+..+...+.+.....+.+........+...+...+............+....+...+..+.+...+..+.........+..........+...+.....+......+...................+..+................+..+.+..+....+...+..+.+..................+.........+..+...+.+....................+.+...........+...+.+...+.....+.+......+.....+.+.....+.......+...+..+..........+...+...+.....+....+...+.....+.........+......+....+.........+.........+.....+.+...........+.........+.......+.......................+.........+............................+.....+...+.......+..+.+.....+.+.....+..................+.......+...+..+......+...+....+..+......+.............+.........+........+....+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
..+...+....+...........+....+......+..+............+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*........+...+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..........+............+...+.....+.........+...+.+.........+...........+....+...........+.+........+...+...+....+...+........+....+......+..+.......+...+..............+.........+.+......+.....+.......+..................+..+.+.....+......+.+............+......+..+.......+......+..+....+...........+...+.........+...+....+...+...+..+.+......+.....+.+..+..................+...+.+......+...+.....+...................+.....+.......+......+..+.+..+....+......+..............+...+..........+...+..+............+.+.....+...+....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
Certificate request self-signature ok
subject=C = US, L = California, O = Wazuh, OU = Wazuh, CN = node-1
24/08/2023 09:40:13 DEBUG: Creating the Wazuh server certificates.
Ignoring -days without -x509; not generating a certificate
........+..+..........+..+.+..+....+........+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.........+.....+......+.+..+.......+...+.....+.......+........+.+..+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+.+...+..+..........+........+............+..........+..+.+......+...+.....+.+.....+....+.....+...+...+..............................+.+...........+....+......+..............+.+...+.........+...........+....+...+..+......+......+...+.+......+.........+......+.....+.+........+..........+.........+..+.+..+.+.........+............+...+...+...+......+..............+.+..............+.+......+..+..........+..+.+........+......+.+..+.+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
..+.......+..+.........+...............+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+......+.....................+.+............+.....+...+.........+.+........+......+....+..+.............+...............+...........+.........+.+........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*........+..+...+................+...+...............+.....+.......+......+...+............+.....+.......+...+.....+.......+..+.+...+.........+.....+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
Certificate request self-signature ok
subject=C = US, L = California, O = Wazuh, OU = Wazuh, CN = wazuh-1 Using invalid DNS
nodes:
# Wazuh indexer nodes
indexer:
- name: node-1
ip: localhost Output: 24/08/2023 09:44:00 DEBUG: Creating the Wazuh indexer certificates.
24/08/2023 09:44:00 ERROR: Invalid IP or DNS localhost
nodes:
# Wazuh indexer nodes
indexer:
- name: node-1
ip: localhost.123 Output: 24/08/2023 09:44:00 DEBUG: Creating the Wazuh indexer certificates.
24/08/2023 09:44:00 ERROR: Invalid IP or DNS localhost.123 Using valid IP address
nodes:
# Wazuh indexer nodes
indexer:
- name: node-1
ip: 127.0.0.1 Output: 24/08/2023 09:45:42 DEBUG: Creating the Wazuh indexer certificates.
Ignoring -days without -x509; not generating a certificate
....+.........+.+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.....+.........+..............+....+..+......+............+...+.......+...+..+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*..+.........+...........................+.........+......+.....+......+...+...................+...+.....+...+....+...+..+..................+...+.+...+...+..+...+.......+......+......+......+..+......+......+...................+...........+.+.....+....+...+........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
.+...+.+...............+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.........+..+............+.+...+...........+....+..+.......+.....+.......+...............+.........+.....+..........+.........+..+.+.....+.........+......+...+.......+..+.+...........+......+............+.+......+......+...+.....+.........+.+.....+.+.....+......+.......+..+.+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
Certificate request self-signature ok
subject=C = US, L = California, O = Wazuh, OU = Wazuh, CN = node-1
Using invalid IP address (public)
nodes:
# Wazuh indexer nodes
indexer:
- name: node-1
ip: 82.129.80.111 Output: 24/08/2023 09:47:20 INFO: --- Configuration files ---
24/08/2023 09:47:20 INFO: Generating configuration files.
24/08/2023 09:47:20 ERROR: The IP 82.129.80.111 is public.
New bug found
The server:
- name: wazuh-1
ip: www.google.es
ip: localhost
ip: wikipedia.org The certificates are created: 24/08/2023 11:25:37 DEBUG: Creating the Wazuh server certificates.
Ignoring -days without -x509; not generating a certificate
........+......+..................+..+......+....+...+..+....+.........+...+..+...............+...+....+......+...+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*...+........+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*........+..............+...+......+....+............+.....+.+...+.....+.........+...+....+...........+....+...+..+.+...............+...+......+...+.....+......+.......+.........+...+.....+......+.......+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
..+...+..........+......+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+...+............+..................+.+..+....+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*.+..+...+...............+.+...+..+.+.....+...+......+....+...........+...+.+.....+....+.....+..........+.....+.+.....+......+.+..+.......+...+.....+................+...............+..+....+.....+...+.+..+.......+...+..+............+.+..+.............+..+.+...........+.+.........+.....+....+..+...+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----
Certificate request self-signature ok
subject=C = US, L = California, O = Wazuh, OU = Wazuh, CN = wazuh-1 But, if the code is debugged, it seems that the invalid DNS is ignored: ++ server_node_ip_1=("www.google.es" "wikipedia.org")
+ set +x A new issue has been created to report this problem: #2371 |
The
wazuh_install.sh
script that installs the unattended Wazuh installation, has a check to validate the DNS. This validation could not pass for some expected valid DNS as:foo.bar1.com
.Related code in the script:
This was reported by a community user.
The text was updated successfully, but these errors were encountered: