{"action":"created","issue":{"url":"https://api.github.com/repos/wazuh/wazuh/issues/914","repository_url":"https://api.github.com/repos/wazuh/wazuh","labels_url":"https://api.github.com/repos/wazuh/wazuh/issues/914/labels{/name}","comments_url":"https://api.github.com/repos/wazuh/wazuh/issues/914/comments","events_url":"https://api.github.com/repos/wazuh/wazuh/issues/914/events","html_url":"https://github.com/wazuh/wazuh/issues/914","id":339609394,"node_id":"MDU6SXNzdWUzMzk2MDkzOTQ=","number":914,"title":"Settings. Error. 2008 - Invalid url field","user":{"login":"matt-lucero","id":34253244,"node_id":"MDQ6VXNlcjM0MjUzMjQ0","avatar_url":"https://avatars0.githubusercontent.com/u/34253244?v=4","gravatar_id":"","url":"https://api.github.com/users/matt-lucero","html_url":"https://github.com/matt-lucero","followers_url":"https://api.github.com/users/matt-lucero/followers","following_url":"https://api.github.com/users/matt-lucero/following{/other_user}","gists_url":"https://api.github.com/users/matt-lucero/gists{/gist_id}","starred_url":"https://api.github.com/users/matt-lucero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matt-lucero/subscriptions","organizations_url":"https://api.github.com/users/matt-lucero/orgs","repos_url":"https://api.github.com/users/matt-lucero/repos","events_url":"https://api.github.com/users/matt-lucero/events{/privacy}","received_events_url":"https://api.github.com/users/matt-lucero/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-09T21:13:09Z","updated_at":"2018-07-10T07:19:08Z","closed_at":null,"author_association":"NONE","body":"For whatever reason, I'm unable to use a URL other than an IP address when attempting to add an API via the Wazuh Kibana app. I'm in the process of upgrading from Wazuh 2.2.1 to 3.3.1, using a DNS entry used to work in the previous version. Now I get the \"Invalid url field\" message when I use anything besides an IP address. I am able to successfully authenticate with the Wazuh API via the FQDN using curl on the Kibana instance. The DNS is valid and resolves fine outside the Wazuh app.\r\n\r\n![chrome developer tools - xhr](https://user-images.githubusercontent.com/34253244/42476228-1e1bf6c6-8382-11e8-888f-48698b85328b.png)\r\n\r\n\r\nWazuh App version: 3.3.1. Kibana Version: 6.2.4. Wazuh Server version 3.3.1 \r\n\r\nAny assistance you can provide would be helpful in troubleshooting this issue, thanks."},"comment":{"url":"https://api.github.com/repos/wazuh/wazuh/issues/comments/403725579","html_url":"https://github.com/wazuh/wazuh/issues/914#issuecomment-403725579","issue_url":"https://api.github.com/repos/wazuh/wazuh/issues/914","id":403725579,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzcyNTU3OQ==","user":{"login":"jesusgn90","id":8860227,"node_id":"MDQ6VXNlcjg4NjAyMjc=","avatar_url":"https://avatars2.githubusercontent.com/u/8860227?v=4","gravatar_id":"","url":"https://api.github.com/users/jesusgn90","html_url":"https://github.com/jesusgn90","followers_url":"https://api.github.com/users/jesusgn90/followers","following_url":"https://api.github.com/users/jesusgn90/following{/other_user}","gists_url":"https://api.github.com/users/jesusgn90/gists{/gist_id}","starred_url":"https://api.github.com/users/jesusgn90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jesusgn90/subscriptions","organizations_url":"https://api.github.com/users/jesusgn90/orgs","repos_url":"https://api.github.com/users/jesusgn90/repos","events_url":"https://api.github.com/users/jesusgn90/events{/privacy}","received_events_url":"https://api.github.com/users/jesusgn90/received_events","type":"User","site_admin":false},"created_at":"2018-07-10T07:19:08Z","updated_at":"2018-07-10T07:19:08Z","author_association":"MEMBER","body":"Hello @matt-lucero , the error code 2008 is related to the url field as you can see. Your DNS is not giving true with the next regex:\r\n\r\n```js\r\nconst urlRegEx    = new RegExp(/^https?:\\/\\/[a-zA-Z0-9]{1,300}$/);\r\nconst urlRegExIP = new RegExp(/^https?:\\/\\/[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}$/);\r\n```\r\nThat's a known bug with our validation system and we need to fix it. For now you can fix it by yourself modifying the file under **/usr/share/kibana/plugins/wazuh/server/controllers/wazuh-api-elastic.js**, replace the next line (line ~ 18 depending on your package):\r\n\r\n```js\r\nconst urlRegEx = new RegExp(/^https?:\\/\\/[a-zA-Z0-9]{1,300}$/);\r\n```\r\n\r\nby this one:\r\n\r\n```js\r\nconst urlRegEx = new RegExp(/^https?:\\/\\/[\\.\\-a-zA-Z0-9]{1,300}$/);\r\n```\r\n\r\nOnce done, please remove the Kibana bundles and restart Kibana:\r\n\r\n```\r\n# rm -rf /usr/share/kibana/optimize/bundles\r\n# systemctl restart kibana\r\n```\r\nKibana will re-optimize the app so wait few minutes before try again. Track the progress using the next command:\r\n\r\n```\r\n# watch -n0 'systemctl status kibana -l'\r\n```\r\n\r\nRegards,\r\nJesús"}}
{"actor":{"display_login":"jesusgn90"}}