Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readOnlyRootFilesystem to true in Kubernetes #7330

Closed
albundy83 opened this issue Mar 29, 2024 · 11 comments
Closed

readOnlyRootFilesystem to true in Kubernetes #7330

albundy83 opened this issue Mar 29, 2024 · 11 comments
Assignees
Milestone

Comments

@albundy83
Copy link

Describe the solution you'd like
Hello,

it will be nice that files that are updated by entrypoint.sh file be written to a dedicated empty folder.
At least file /pgadmin4/config_distro.py.

For moment, we can't use an emptyDir or persistentVolumeClaim as there are many files in /pgadmin4 folder.

I will be a nice step to achieve a more secure pgadmin4 Deployment by being capable to set readOnlyRootFilesystem to true.

A clear and concise description of what you want to happen.

Describe alternatives you've considered
Generate my self the /pgadmin4/config_distro.py as ConfigMap or Secret and mount it but we should be able to disable generation.

Specify a custom path for /pgadmin4/config_distro.py with ENV var.

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

@oldboys92
Copy link
Contributor

also looking for a solution to this 👍

@balazsjdp
Copy link

Hey, is there any solution for this?

yogeshmahajan-1903 added a commit to yogeshmahajan-1903/pgadmin4 that referenced this issue Dec 2, 2024
yogeshmahajan-1903 added a commit to yogeshmahajan-1903/pgadmin4 that referenced this issue Dec 2, 2024
yogeshmahajan-1903 added a commit to yogeshmahajan-1903/pgadmin4 that referenced this issue Dec 2, 2024
yogeshmahajan-1903 added a commit to yogeshmahajan-1903/pgadmin4 that referenced this issue Dec 2, 2024
@akshay-joshi akshay-joshi moved this from 🆕 New to In Review in Current Sprint (182) Dec 3, 2024
yogeshmahajan-1903 added a commit to yogeshmahajan-1903/pgadmin4 that referenced this issue Dec 3, 2024
@akshay-joshi akshay-joshi moved this from In Review to In Testing in Current Sprint (182) Dec 4, 2024
@akshay-joshi akshay-joshi added this to the 8.14 milestone Dec 4, 2024
@pravesh-sharma pravesh-sharma self-assigned this Dec 4, 2024
yogeshmahajan-1903 added a commit to yogeshmahajan-1903/pgadmin4 that referenced this issue Dec 6, 2024
yogeshmahajan-1903 added a commit to yogeshmahajan-1903/pgadmin4 that referenced this issue Dec 6, 2024
yogeshmahajan-1903 added a commit to yogeshmahajan-1903/pgadmin4 that referenced this issue Dec 6, 2024
@pravesh-sharma
Copy link
Contributor

Working fine.

@pravesh-sharma pravesh-sharma moved this from In Testing to ✅ Done in Current Sprint (182) Dec 9, 2024
@albundy83
Copy link
Author

Hello,

will you release an image soon ?

@yogeshmahajan-1903
Copy link
Contributor

@albundy83
Yes. We have release 8.14 planned for tomorrow.

@oldboys92
Copy link
Contributor

@yogeshmahajan-1903 good to know, I'm going to try this out in the next days and provide feedback.

@albundy83
Copy link
Author

Hello,
just try to export and use the new environment variable PGADMIN_CUSTOM_CONFIG_DISTRO_FILE.

I have set it to PGADMIN_CUSTOM_CONFIG_DISTRO_FILE=/var/lib/pgadmin/config_distro.py and started my container in Kubernetes but it does not work as the file need to be present due to wc -m "${CONFIG_DISTRO_FILE_PATH found in line here.

If you really need to not override the file each time we start pgadmin container (but maybe it's not a good idea anymore), we could convert the line to this:

if [ ! -e "${CONFIG_DISTRO_FILE_PATH}" ] || [ "$(wc -m "${CONFIG_DISTRO_FILE_PATH}" 2>/dev/null | awk '{ print $1 }')" = "0" ]; then

@khushboovashi
Copy link
Contributor

@albundy83, The fix looks good to me. you can raise the PR for the same.

@albundy83
Copy link
Author

Hello, @khushboovashi here the PR #8258

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

7 participants