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

Missing security aspects in Docker image #228

Closed
agido-malter opened this issue Apr 27, 2023 · 5 comments
Closed

Missing security aspects in Docker image #228

agido-malter opened this issue Apr 27, 2023 · 5 comments

Comments

@agido-malter
Copy link

agido-malter commented Apr 27, 2023

Using geoippupdate via docker

docker run --user 4711:4711 --name geoipupdate --rm --env-file $HOME/geo/geoip.env -v $HOME/geo/temp:/usr/share/GeoIP maxmindinc/geoipupdate

results in error:

STATE: Creating configuration file at /etc/GeoIP.conf
/usr/bin/entry.sh: line 45: can't create /etc/GeoIP.conf: Permission denied

If i don't use --user xxxx:xxxxx the result file is owned by root. Company policy denies root for any other than admins

Also tried with -e "GEOIPUPDATE_CONF_FILE=/tmp/GeoIP.conf" but next issue is:

error retrieving updates: error acquiring file lock: error acquiring file lock at /usr/share/GeoIP/.geoipupdate.lock: open /usr/share/GeoIP/.geoipupdate.lock: permission denied

That means, the whole image is designed to run under root only, whitch misses every aspect of security

@oschwald
Copy link
Member

You may also set GEOIPUPDATE_DB_DIR.

@oschwald
Copy link
Member

oschwald commented May 5, 2023

5.1.0 now drops the root privileges.

@oschwald oschwald closed this as completed May 5, 2023
@oschwald
Copy link
Member

oschwald commented May 8, 2023

5.1.1 switches back to using root privileges within the container. Please see #233.

Could you expand a bit more on your particular use case? That might impact how we go forward.

@oschwald oschwald reopened this May 8, 2023
@rakeshv1
Copy link

rakeshv1 commented Jun 9, 2023

Hi it looks like since 5.1 the entry.sh script writes to a log file by first creating a log_dir folder at "/var/lib/geoipupdate" this means that if we run the docker image under a different non-root user we will get permission denied
can't create /var/lib/geoipupdate/.healthcheck: Permission denied There is no way to override this directory similar to the options like GEOIPUPDATE_CONF_FILE etc

Do you have any plans to add an option to override the log directory path ? I can find some time to PR that in if you are happy with this approach?

@oschwald
Copy link
Member

@rakeshv1 as of 6.0.0, this should no longer be an issue. You should be able to run the image with an arbitrary user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants