question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Configuration & cache handling issues with random securityContext

See original GitHub issue

Hello 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).

In my opinion there are two options:

  • The $HOME environment variable can be set in the Helm chart (maybe even by providing a generic extraEnv 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 the tmp 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:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
tegiozcommented, Jan 25, 2021

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.

0reactions
tegiozcommented, Jan 25, 2021

No worries, my pleasure.

That sounds great to me, thanks! 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found