TheHive-Project / TheHive-Project/Cortex
Analyzer config/mismatch makes TheHive unable to use Cortex after upgrading to 3.0.1
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 1.6k
- Forks
- 264
- PR merge metrics
- No merged PRs in 30d
Description
Request Type
Bug?
Work Environment
| Question | Answer |
|---|---|
| OS version (server) | Ubuntu 18.04 |
| Cortex version / git hash | 3.0.1 |
| Package Type | Deb Binary |
| Browser type & version | Firefox |
Problem Description
After upgrading Cortex from 3.0.0-1 -> 3.0.1-1, logging into the UI doesn't work
Steps to Reproduce
Authentication with the right password yields this error message in the logfile:
2020-03-21 21:42:56,487 [ERROR] from org.elastic4play.controllers.Authenticated in application-akka.actor.default-dispatcher-14 - Authentication failure:
session: AuthenticationError User session not found
pki: AuthenticationError Certificate authentication is not configured
key: AuthenticationError Authentication header not found
init: AuthenticationError Use of initial user is forbidden because users exist in database
2020-03-21 21:42:56,488 [INFO] from org.thp.cortex.services.ErrorHandler in application-akka.actor.default-dispatcher-14 - GET /api/user/current returned 401
org.elastic4play.AuthenticationError: Authentication failure
at org.elastic4play.controllers.Authenticated.$anonfun$getContext$4(Authenticated.scala:272)
[...]
Complementary information
If I try the wrong password, the log message a looks different (and the UI also gets a red popup box that says "Authentication Failure" :
2020-03-21 21:50:31,551 [INFO] from org.thp.cortex.services.ErrorHandler in application-akka.actor.default-dispatcher-14 - POST /api/login returned 401
org.elastic4play.AuthenticationError: Authentication failure
at org.elastic4play.services.auth.MultiAuthSrv$$anonfun$authenticate$2.applyOrElse(MultiAuthSrv.scala:54)
[...]
Other then that, I see very little of log messages that hints about something being wrong...
I noted that after restart, there are some complaints, but I doubt any of those are the root cause of this problem:
2020-03-21 21:12:10,489 [WARN] from application in main - /etc/cortex/application.conf: 116: analyzer.path is deprecated, use analyzer.urls instead
2020-03-21 21:12:10,489 [WARN] from application in main - /etc/cortex/application.conf: 134: responder.path is deprecated, use responder.urls instead
2020-03-21 21:12:11,974 [INFO] from org.apache.http.impl.execchain.RetryExec in jersey-client-async-executor-0 - I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: No such file or directory
2020-03-21 21:12:11,974 [INFO] from org.apache.http.impl.execchain.RetryExec in jersey-client-async-executor-0 - Retrying request to {}->unix://localhost:80
2020-03-21 21:12:11,975 [INFO] from org.apache.http.impl.execchain.RetryExec in jersey-client-async-executor-0 - I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: No such file or directory
2020-03-21 21:12:11,975 [INFO] from org.apache.http.impl.execchain.RetryExec in jersey-client-async-executor-0 - Retrying request to {}->unix://localhost:80
2020-03-21 21:12:11,975 [INFO] from org.apache.http.impl.execchain.RetryExec in jersey-client-async-executor-0 - I/O exception (java.io.IOException) caught when processing request to {}->unix://localhost:80: No such file or directory
2020-03-21 21:12:11,976 [INFO] from org.apache.http.impl.execchain.RetryExec in jersey-client-async-executor-0 - Retrying request to {}->unix://localhost:80
2020-03-21 21:12:11,980 [INFO] from org.thp.cortex.services.DockerJobRunnerSrv in main - Docker is not available
com.spotify.docker.client.exceptions.DockerException: java.util.concurrent.ExecutionException: javax.ws.rs.ProcessingException: java.io.IOException: No such file or directory ```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with /etc/cortex/application.conf and the 3.0.1 startup warnings about analyzer.path and analyzer.urls, then trace the authentication failure shown in the logs. Reproduce the upgrade from 3.0.0-1 to 3.0.1-1 and determine whether the analyzer configuration mismatch causes the login failure. Done means the upgraded Cortex UI authenticates successfully and TheHive can use Cortex.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100