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

Add runAsUser, runAsGroup, and allowPrivilegeEscalation to helm chart for Agones containers #3848

Closed
zmerlynn opened this issue May 31, 2024 · 8 comments · Fixed by #3869
Closed
Assignees
Labels
kind/feature New features for Agones

Comments

@zmerlynn
Copy link
Collaborator

zmerlynn commented May 31, 2024

Is your feature request related to a problem? Please describe.

Allow securityContext fields such as runAsUser, runAsGroup, and allowPrivilegeEscalation to be set on agones-{allocator,extensions,controller,ping,sidecar}

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

Describe the solution you'd like
Helm chart change

Describe alternatives you've considered
You can do this with kustomize.

@zmerlynn zmerlynn added the kind/feature New features for Agones label May 31, 2024
@markmandel
Copy link
Member

Not very familiar with these fields - but does it need to be configurable, or is this something we could set ourselves and leave on always?

On Agones we set the user and group, so that probably shouldn't be configurable? And I can't think of a situation where we'd want an Agones Pod to enable allowPrivilegeEscalation?

@ThatDevopsGuy
Copy link

ThatDevopsGuy commented May 31, 2024

@markmandel - I can't think of a reason why a game server would require a specific UID/GID. I could imagine that some binaries might want to bind to a privileged port to offer a some sort of file serving in-client (e.g. downloading a missing asset), however.

Perhaps it's best to let it be easily configurable with overrides, should they be needed, but the defaults comply with existing K8S security audits.

@jharris-
Copy link

Should be good to add runAsNonRoot to avoid needing to set the UID/GID.
In addition to the initial request, could you add the agones-gameserver-sidecar to the scope of work?

@zmerlynn
Copy link
Collaborator Author

zmerlynn commented Jun 3, 2024

@jharris- Sure, sounds good!

@zmerlynn zmerlynn self-assigned this Jun 3, 2024
@zmerlynn zmerlynn changed the title Add runAsUser, runAsGroup, and allowPrivilegeEscalation to helm chart for Agones control plane pieces Add runAsUser, runAsGroup, and allowPrivilegeEscalation to helm chart for Agones containers Jun 3, 2024
@markmandel
Copy link
Member

@markmandel - I can't think of a reason why a game server would require a specific UID/GID.

This ticket isn't for GameServer pods though - you can set whatever you like on there via the GameServer.Spec.Template -- this is for the Agones components themselves.

I'm trying to work out why they should be configurable. It seems like they should be set to optimal values, whatever that may be.

@ThatDevopsGuy
Copy link

I'm trying to work out why they should be configurable. It seems like they should be set to optimal values, whatever that may be.

Another way to put it might be, is there any reason why runAsNonRoot wouldn't work? I think that might be all we need across the board, so the specific request might be better expressed as such.

@markmandel
Copy link
Member

Another way to put it might be, is there any reason why runAsNonRoot wouldn't work? I think that might be all we need across the board, so the specific request might be better expressed as such.

I believe we are in furious agreement 😃

@zmerlynn
Copy link
Collaborator Author

zmerlynn commented Jun 4, 2024

That's good, because we were going to start with just defaulting this to runAsNonRoot, which will assert that the container images is doing the right thing.

But it's easy enough to make the securityContext blob configurable with that as the default. Are you saying it should not be?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New features for Agones
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants