<#5462 More flexible configuration of SecurityCont...
# flyte-github
c
#5462 More flexible configuration of SecurityContext for Pods/Containers started by flyte Issue created by vlibov ### Motivation: Why do you think this is important? To run workloads in a security-hardenend kubernetes cluster, the pods and containers must fullfill certain requirements, in particular regarding the SecurityContext fields (pod level, container level). It is possible to set those in flyte e.g. by utilizing the PodTemplate native k8s resource. However it seems that these settings won't be applied to the initContainers (flyte-copilot-downloader). Furthermore, there are some settings which are applied to the main container (addéd capability SYS_PTRACE) without a possibility to disable it. This prevents running flyte workflows in a hardened namespace, which is somewhat unfortunate. It would be nice to be able to configure those, i.e. apply the PodTemplate also for the initContainers and make the SYS_PTRACE capability optional. ### Goal: What should the final outcome look like, ideally? Ultimately we need to 1. Be able to disable the SYS_PTRACE capability, i.e. make it optional in the config 2. Apply PodTemplates also to the initContainers. ### Describe alternatives you've considered One alternative is to run flyte-workloads in a separate namespace which has more elevated rights (i.e. less secure) and restrict the users from creating workloads in the namespace direclty. However this still poses a security risk, because the user still can create workloads indirectly (e.g. create a malicious python code or image and start it as a flyte worklfow). ### Propose: Link/Inline OR Additional context No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte