[BUG] EJBCA instance needs restart before SuperAdmin certificate can be used #787
Replies: 11 comments
-
FYI: I also tried the clear system cache button, but it didn't help |
Beta Was this translation helpful? Give feedback.
-
I think that is expected. Using "simple" means that TLS configuration is not done for requiring client certificate and WildFly need to be re-configured. I assume the restart didn't use "simple"? |
Beta Was this translation helpful? Give feedback.
-
Hi primetomas, |
Beta Was this translation helpful? Give feedback.
-
Ah and if it was expected I really wonder why it's nowhere mentioned in the documentation 🤔 |
Beta Was this translation helpful? Give feedback.
-
You will find that at https://hub.docker.com/r/keyfactor/ejbca-ce "Quick start - classic workflow" and among the tutorials https://docs.keyfactor.com/ejbca/latest/quick-start-guide-start-ejbca-container-with-clien "simple" is not meant to be a production start step, but an unsecure demo mode. To do a secure installation with client certificate authentication use the classic workflow. |
Beta Was this translation helpful? Give feedback.
-
Good morning! I got the idea of the "simple" workflow, which I'm not using in my current use case. I just used it to compile some easy reproduction steps for you to check the issue ;-) Maybe the issue I'm describing is not yet described well enough. But here's the gist:
Not sure if it's related to the problem: I use a postgres database and am running it on a M1 Mac. The issue is also reproducible on a different Mac. BR |
Beta Was this translation helpful? Give feedback.
-
What I am telling you is to NOT start the container with TLS setup "simple" if you want to use a client certificate authentication. Follow the tutorial instead and you do not have to restart the container. As you can see in the tutorial the container is started with TLS_SETUP_ENABLED="true. |
Beta Was this translation helpful? Give feedback.
-
I see, but still if I start the container with TLS_SETUP_ENABLED = true it doesn't work.
|
Beta Was this translation helpful? Give feedback.
-
You might want to check that the roles are probably already pre-populated, not need to change roles that are already set up for you. Sounds like you try to do too many steps yourself, perhaps you are used to a pure software install from before? The container startup already does everything for you except hand you the P12. Read the console output from the container carefully and run through the tutorial first at least once before modifying the process. Using the Admin UI worked fine for me, I just tried. Than if you want to script to get the p12 from the CLI instead of the UI...you should do only that step and nothing else. When following the classic workflow install you should pay attention to the part that says "Delete default public access role after superadmin enrollment", to ensure that you have no more access than you want. |
Beta Was this translation helpful? Give feedback.
-
Thanks again Primetomas, |
Beta Was this translation helpful? Give feedback.
-
Yes because in this scenario you have to add certificates to the TLS trust store, which I guess you do file mounts? And since it is a container, which is not supposed to be operated as a VM, i.e. you go in and to configuration inside the container (which is then not active on another started container), bouncing the container with the proper configs/files mounted is the proper way to to do it. A container should be treated as ephemeral and any started container should be completely identical. This enables things like multiple pods for HA, auto-scaling and other kubernetes things. Bouncing a container/pod on configuration changes should be the expected way. For TLS trust anchors an envoy proxy or ingress in the pod is typically used for highly automated scenarios. |
Beta Was this translation helpful? Give feedback.
-
Describe the Bug
After setting up a fresh EJBCA instance in docker with a superadmin user, it's not possible to access EJBCA WebUI or the REST API using the p12 file of the superadmin. When doing so, EJBCA always responds with an empty response / closes the connection. The EJBCA instance needs to be restarted first and after the restart the instance can be accessed with the superadmin user
To Reproduce
Steps to reproduce the behavior:
You can either try to access the WebUI which will fail, or try to access the REST API using nodejs:
Expected Behavior
I woulde expect EJBCA to work right after creating the SuperAdmin user instead of needing a restart.
Screenshots and Logs
Product Deployment
Please complete the following information:
Desktop
Please complete the following information:
Beta Was this translation helpful? Give feedback.
All reactions