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 security context to Gatekeeper container #273

Merged
merged 3 commits into from
Dec 6, 2019

Conversation

maxsmythe
Copy link
Contributor

Signed-off-by: Max Smythe smythe@google.com

@maxsmythe maxsmythe requested a review from ritazh October 24, 2019 01:55
allowPrivilegeEscalation: false
runAsGroup: 3000
runAsNonRoot: true
runAsUser: 2000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the main reason for changing the uid here vs the one in the dockerfile: https://github.com/open-policy-agent/gatekeeper/blob/master/Dockerfile#L18

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to show that we can. Would you prefer them to be identical? I have no strong opinions either way.

Copy link
Member

@ritazh ritazh Oct 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After deploying this change, I'm getting the following after I exec into the container:

groups: cannot find name for group ID 3000
$ id manager
uid=1000(manager) gid=999(manager) groups=999(manager)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the significance of that is or what response you're looking for.

Is your shell broken? Is there loss of functionality? Is it ugly?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a problem with my shell. but rather

  1. runAsGroup: 3000 failed because the group 3000 does not exist in /etc/group.
  2. I think we should be consistent and use the manager user with uid 1000 as we have currently in the Dockerfile. Otherwise as you can see from my shell output, there is a manager user with uid 1000, but it is not used to run the manager process. Let's be consistent here if we can.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM, so UID=1000 GID=999?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Signed-off-by: Max Smythe <smythe@google.com>
Signed-off-by: Max Smythe <smythe@google.com>
@maxsmythe maxsmythe merged commit 8a1b4cc into open-policy-agent:master Dec 6, 2019
@maxsmythe maxsmythe deleted the security-context branch December 12, 2019 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants