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

[trino] Supporting more variables for securityContext for pod and container level. #189

Closed
hafizmujadidKhalid opened this issue Sep 23, 2023 · 5 comments · Fixed by #190
Closed
Assignees
Labels
enhancement New feature or request

Comments

@hafizmujadidKhalid
Copy link
Contributor

hafizmujadidKhalid commented Sep 23, 2023

Is your feature request related to a problem ?

Hey folks!

I am trying to deploy Trino using your provided helm chart but since our EKS cluster has some validations set it fails to deploy. The failing validations are like running with non_root_user and dropping all capabilities etc.

Describe the solution you'd like.

To fix it, I have to add following security context for container:

securityContext:
     allowPrivilegeEscalation: false
     capabilities:
         drop:
            - ALL
     runAsUser: 1000

and following for the pod:

     securityContext:
          runAsNonRoot: true
          seccompProfile:
              type: RuntimeDefault

I want to support general securityContext settings inside values.yaml file and they should be reflected in relevant deployments. I would have created a PR but due to my limited knowledge of helm templating, I could not produce well-indented yaml.

Describe alternatives you've considered.

None, Our security team have these security & validation check in place and they are not willing to relax. I have to deploy rending template and modifying actual yaml files.

Additional context.

No response

@valeriano-manassero
Copy link
Owner

Can you pls test related chart in PR?

I'd like to understand if these defaults are ok for your use case.

@hafizmujadidKhalid
Copy link
Contributor Author

hafizmujadidKhalid commented Sep 25, 2023

Hey @valeriano-manassero !

Thanks for the quick solution, I think the number of errors is reduced now and the validations are failing only on init containers:

disallow-capabilities-strict:
  autogen-require-drop-all: 'validation failure: Containers must drop `ALL` capabilities.'
disallow-privilege-escalation:
  autogen-privilege-escalation: 'validation error: Privilege escalation is disallowed.
    The fields spec.containers[*].securityContext.allowPrivilegeEscalation, spec.initContainers[*].securityContext.allowPrivilegeEscalation,
    and spec.ephemeralContainers[*].securityContext.allowPrivilegeEscalation must
    be set to `false`. rule autogen-privilege-escalation failed at path /spec/template/spec/containers/0/securityContext/'
validate-seccomp-location:

@github-actions
Copy link
Contributor

This issue is stale because it has been open for 14 days with no activity.

@github-actions github-actions bot added the stale label Oct 10, 2023
@valeriano-manassero
Copy link
Owner

valeriano-manassero commented Oct 10, 2023

@hafizmujadidKhalid securitiContext should be set for all init containers afaik; can you pls list what are init containers with this problem and their generated yaml manifest?

@hafizmujadidKhalid
Copy link
Contributor Author

@valeriano-manassero!
I think containerSecurityContext is missing in Coordinator container:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants