Skip to content

Usage of arbitrary UID makes secure Kubernetes deployment impossible #87

@MatonAnthony

Description

@MatonAnthony

Hello,

I would like to run the snomed browser on a Kubernetes cluster, that use SCC restriction and attribute a random user id.
Unfortunately this is currently not possible because of https://github.com/IHTSDO/sct-browser-frontend/blob/master/docker/docker-entrypoint.sh

In this file

#!/usr/bin/env sh
set -eu

if test -f /etc/nginx/conf.d/default.conf.template  ; then
    envsubst '${API_HOST}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/nginx.conf 
    rm /etc/nginx/conf.d/default.conf.template 
fi

exec "$@" 

We can see the line here below, that substitute the content of the file before overwriting the /etc/nginx/nginx.conf

    envsubst '${API_HOST}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/nginx.conf 

In a Kubernetes setup with SCC restriction enabled, this file does not belong to the user that wants to overwrite it.
Therefore it gets an access denied, and the container crash.

I believe that in the Dockerfile, a simple chgrp 0 /etc/nginx/nginx.conf && chmod g+rwX /etc/nginx/nginx.conf would fix the issue.

Do you believe that such a merge request would be sufficient ?
Would you be open to accept it as a contribution to the project ?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions