-1

I am trying to modify the umask value by adding it to my entrypoint script:

#!/bin/bash
umask 022
/sbin/rsyslogd

ENTRYPOINT ["/bin/sh", "-c" , "/var/run/scripts/entrypoint.sh"]

However, this doesn't seem to get modified. The pod is started up with a different user - is this affecting it? If so, what are the options to modify the umask this way?

HollowDev
  • 111
  • 1
  • 8
  • http://idownvotedbecau.se/itsnotworking/ http://idownvotedbecau.se/nodebugging/ http://idownvotedbecau.se/nomcve/ – Paul Hodges Dec 08 '22 at 17:51

1 Answers1

0

Could you clarify what is not working here?

I understand that your umask configuration is correct but the user used in the pod is not. I assume you are using Kubernetes if you refer to pods, in this case you should use the security context to specify the user id you want to execute your pod as. Example to launch your pod with UID set as 1000 :

apiVersion: v1
kind: Pod
metadata:
  name: security-context-demo
spec:
  securityContext:
    runAsUser: 1000

Documentation here : https://kubernetes.io/docs/tasks/configure-pod-container/security-context/

peppie
  • 35
  • 7