[SERVER-10339] MONGODB-X509 user authentication should not require the clusterAuthMode option. Created: 25/Jul/13 Updated: 11/Jul/16 Resolved: 12/Sep/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Security |
| Affects Version/s: | 2.5.1 |
| Fix Version/s: | 2.5.3 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Bernie Hackett | Assignee: | Andreas Nilsson |
| Resolution: | Done | Votes: | 0 |
| Labels: | 26qa | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
|||||||||||||||||||||||
| Issue Links: |
|
|||||||||||||||||||||||
| Operating System: | ALL | |||||||||||||||||||||||
| Steps To Reproduce: | Configure mongod without clusterAuthMode:
The shell fails authentication:
Restart mongod with clusterAuthMode x509:
Shell authentication succeeds:
|
|||||||||||||||||||||||
| Participants: | ||||||||||||||||||||||||
| Description |
|
To use the MONGODB-X509 mechanism you currently have to configure mongod with "--clusterAuthMode x509", but that option is for internal (keyFile replacement) authentication, not user auth. |
| Comments |
| Comment by auto [ 12/Sep/13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'agralius', u'name': u'Andreas Nilsson', u'email': u'andreas.nilsson@10gen.com'}Message: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by auto [ 12/Sep/13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'agralius', u'name': u'Andreas Nilsson', u'email': u'andreas.nilsson@10gen.com'}Message: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bernie Hackett [ 23/Aug/13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
andreas.nilsson@10gen.com, well, ca.pem (I assume) is used to validate the client cert, and I figured changing the subject might cause that to no longer work? I'm probably just confused. As for the log message, maybe just add something about the provided "user" matching the clusterauth user before "X509 authentication is not allowed for cluster authentication"? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Eric Milkie [ 23/Aug/13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
attached new client.pem with ou of "kerneluser" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andreas Nilsson [ 23/Aug/13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
agree with both points, With regards to the error message I'm not sure how we can distinguish between a client using an incorrect certificate and a server not running with clusterAuthMode when it should. I guess the message could be extended to include both scenarios. behackett why would ca.pem need to be changed? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bernie Hackett [ 22/Aug/13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
andreas.nilsson@10gen.com, indeed that is the problem. The server.pem and client.pem files in jstest/libs have the same subject name. My apologies. I think we need a better error message here. I would imagine end users are going to be equally confused. We should probably also change client.pem to use a different subject (or add a new client pem file) and update ca.pem to make testing easier and less confusing. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andreas Nilsson [ 22/Aug/13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
behackett this is expected behavior if the subject name of the client certificate matches the subject name of the server certificate. The client is then assumed to be part of the cluster and not a client. Can you verify that this is not the case. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Bernie Hackett [ 21/Aug/13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This issue isn't fixed. I still have the same problem with github master at commit 3ae747331fc37e7826f6cd20088bee76b3a7bb00 Without --clusterAuthMode x509:
The server log message:
Once I add --clusterAuthMode x509:
Buildinfo:
Commit a277977911509f91e19847b85c2498437d8859a1 is definitely in my tree and included in this build, but it doesn't appear to have anything to do with this issue. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by auto [ 30/Jul/13 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'agralius', u'name': u'Andreas Nilsson', u'email': u'andreas.nilsson@10gen.com'}Message: |