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

fix: use numerical User ID instead of name to avoid security issues. #1151

Merged
merged 2 commits into from
Mar 16, 2021

Conversation

harnash
Copy link
Contributor

@harnash harnash commented Mar 15, 2021

Related PR

Proposed changes

Our docker image scanner does not allow running processes inside
container using non-numeric User spec (to determine if we are trying
to run docker image as root).## Checklist

  • I have read the contributing guidelines.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security. vulnerability, I
    confirm that I got green light (please contact
    [email protected]) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added or changed the documentation.

Our docker image scanner does not allow running processes inside
container using non-numeric User spec (to determine if we are trying
to run docker image as root).
@aeneasr
Copy link
Member

aeneasr commented Mar 15, 2021

Is there a particular reason why numerical users are more secure than user aliases?

@harnash harnash changed the title User numerical User ID instead of name to avoid security issues. fix: use numerical User ID instead of name to avoid security issues. Mar 15, 2021
@harnash
Copy link
Contributor Author

harnash commented Mar 15, 2021

Is there a particular reason why numerical users are more secure than user aliases?

Probably I've phrased it wrong. It is more Quality of Life improvement than a security concern. When running oryd/kratos:v0.5.5-alpha.1-sqlite in our kubernetes cluster I get the following error:

 Error: container has runAsNonRoot and image has non-numeric user (ory), cannot verify user is non-root (pod: "kratos-dev-6cd4454c95-7s5wj │
│ _dev(61b6b10c-6b17-4984-a807-2f566669b938)", container: kratos)

source: https:/kubernetes/kubernetes/blob/5648200571889140ad246feb82c8f80a5946f167/pkg/kubelet/kuberuntime/security_context.go#L88

@aeneasr
Copy link
Member

aeneasr commented Mar 15, 2021

I see, that makes sense then! Thank you :)

@aeneasr aeneasr merged commit 468a12e into ory:master Mar 16, 2021
@harnash harnash deleted the numeric_user_dockerfile branch March 23, 2021 14:46
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