Configuration & cache handling issues with random securityContext
See original GitHub issueHello everyone! Thanks for the great tool you’re providing! We would love to provide an internal ArtifactHub in our OpenShift cluster. Unfortunately we are facing some issues with the Helm chart and/or ArtifactHub’s configuration (and cache) handling in general.
When deploying ArtifactHub in an OpenShift cluster, it gets a random uid, which does not have a home directory in the container and does not have write permissions on /home/hub
.
This results in the following problems:
- The configuration files are not found (since
$HOME
is not set, but used when loading the configurations). - The cache cannot be written.
- Since
$HOME
is not set, it tries to write on/.cache
(subdirectory of root), which of course fails due to the missing root permissions. - Even if
$HOME
is set, the.cache
folder cannot be written (since the user which is running the container does not have write permissions on/home/hub
).
- Since
In my opinion there are two options:
- The
$HOME
environment variable can be set in the Helm chart (maybe even by providing a genericextraEnv
value) and/home/hub/.cache
is mounted as a writable ephemeral volume (emptyDir
). - Configurations and cache are not in the home directory. The config could for example be mounted at
/config
, and the cache could be written in thetmp
folder.
I can provide PRs, I just wanted to discuss the issue first (is it considered a problem, if so which approach would be preferred).
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Spring Security Reference
This may cause issues when you are using a cache of user objects, for example, to improve performance in a stateless application. If...
Read more >Embedding Infinispan caches in Java applications
Use the ConfigurationBuilder API to define cache configuration. Obtain caches with getCache() , createCache() , or getOrCreateCache() methods.
Read more >Exploring Spring-Boot and Spring-Security: Custom token ...
Custom token based authentication of REST services with Spring-Security and pinch of Spring Java Configuration and Spring Integration Testing.
Read more >Top 20 Dockerfile best practices for security - Sysdig
Learn how to prevent security issues and optimize containerized applications by applying 20 Dockerfile best practices in your image ...
Read more >Securing Applications and Services Guide - Keycloak
These are the basic steps for securing an application or a service in Keycloak. Configure a client using one of these options: A...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Given that I did not provide a
--cache-dir
in the client, it must be using that one by default. Trivy allows overriding this using$TRIVY_CACHE_DIR
, so we could allow this environment variable to be set and make sure it’s included in the environment passed to the trivy command by adding it here.No worries, my pleasure.
That sounds great to me, thanks! 👍