it-at-m / digiwf-core

central workflow automation and integration platform based on the free process framework Camunda.
MIT License
19 stars 7 forks source link

Import Self-Signed Certificates from Volume on Docker Container Start #1369

Closed vosiander closed 6 months ago

vosiander commented 6 months ago

Is your feature request related to a problem? Please describe.

Yes, the problem revolves around handling self-signed certificates within Docker containers. Currently, there's no streamlined process to automatically import (self-signed) certificates when a container starts. This lack of automation requires manual intervention to ensure that containers trust self-signed certificates, which is both time-consuming and prone to human error. This is especially frustrating in environments that heavily rely on self-signed certificates for internal services, leading to trust issues and additional overhead in container setup.

Describe the solution you'd like

I propose that each Docker container should automatically import self-signed certificates from a specified volume upon start. This feature would look for a predefined directory within the container (e.g., /etc/ssl/certs/custom/) where self-signed certificates can be placed. Upon container startup, the system should automatically scan this directory and import any certificates found into the container's trusted certificate store. This process should be logged for audit purposes, ensuring visibility into which certificates were imported and when.

Describe alternatives you've considered

Acceptance Criteria

Additional context

In environments where self-signed certificates are frequently used (e.g., company internal certs, development, testing, and even some production scenarios), automating the process of trusting these certificates within containers can significantly streamline workflows and reduce setup errors. This feature would be particularly beneficial for organizations that use a large number of microservices or deploy containers dynamically.

simonhir commented 6 months ago

Hi Veit,

we internally also use custom certificates which we provide via environment vars for the java truststore. In my opinion that is also the best practice way to do it. In specific we mount the custom certificates via a Kubernetes deployment to /mnt/cacerts/cacerts-lhm, define the environment variable JAVA_OPTS_APPEND: "-Djavax.net.ssl.trustStore=/mnt/cacerts/cacerts-lhm" (could also be done as JAVAX_NET_SSL_TRUSTSTORE: /mnt/cacerts/cacerts-lhm) and if needed JAVAX_NET_SSL_TRUSTSTOREPASSWORD. Hope that answers and solves the problem.

Best regards Simon