IntegralDefense / ACE

Analysis Correlation Engine
Apache License 2.0
26 stars 10 forks source link

Default Install using localhost cert causes error #220

Open seanmcfeely opened 5 years ago

seanmcfeely commented 5 years ago

The nodes db table picks up the hostname and uses it to define the location:

mysql> select * from nodes;
+----+-----------------------+----------+------------+---------------------+------------+----------+----------+
| id | name                  | location | company_id | last_update         | is_primary | any_mode | is_local |
+----+-----------------------+----------+------------+---------------------+------------+----------+----------+
|  1 | localhost.localdomain | animus   |          1 | 2019-03-05 17:10:29 |          1 |        1 |        0 |
+----+-----------------------+----------+------------+---------------------+------------+----------+----------+

This does not agree with the default api prefix or default certs and cases the following error:

unable to submit alert: HTTPSConnectionPool(host='animus', port=443): Max retries exceeded with url: /api/analysis/submit (Caused by SSLError(CertificateError("hostname 'animus' doesn't match either of 'localhost', '127.0.0.1'",),)) 

A work around is to do this:

update nodes set location='localhost' where id=1;

This either needs to be fixed by making sure the nodes table location defaults to localhost or that the appropriate config item reflects the hostname of the system that gets added to the nodes entry.

unixfreak0037 commented 5 years ago

Thanks. api.prefix config option defaults to AUTO which uses the result of socket.getfqdn(), which returns localhost.localdomain, while the SSL cert is configured for localhost.