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

Cannot Generate CA as .ocm dir is too restrictive. #99

Open
reedjosh opened this issue Jul 7, 2023 · 6 comments
Open

Cannot Generate CA as .ocm dir is too restrictive. #99

reedjosh opened this issue Jul 7, 2023 · 6 comments
Assignees

Comments

@reedjosh
Copy link

reedjosh commented Jul 7, 2023

I finally created my own load balancer service outside of the helm chart to get around the extra 'n' issue, but now, I'm seeing that the .ocm dir is locked down enough that the pod cannot generate its own cert.

failed to generate root-ca CA certificate: mkdir /.ocm/cert: permission denied

I'll probably find a workaround for now, but please look into the permissions for this directory.

Thanks!

@reedjosh
Copy link
Author

reedjosh commented Jul 8, 2023

image

@reedjosh
Copy link
Author

reedjosh commented Jul 8, 2023

Okay, forked your repo, and changed a few chart things. Primarily the security context, but I've gotten a bit further 🙌 .

I think I'm starting to understand the /.ocm dir issue. Basically if you runAsNonRoot, but don't set the security context, then you'll have 0 access to the diretory.

Using the security context field the dir can be made so that it's owned by your user and your user's group.

Of course then you'll get the too permissive warning.

I think from there modifying the perms to be only accessed by your user is practically the only solution.

Init container, or just as part of the bin startup process.

@clyang82
Copy link
Collaborator

/assign @ycyaoxdu

@clyang82
Copy link
Collaborator

clyang82 commented Jul 10, 2023

Hi @reedjosh , what platform are you using? we know the folder permission can be a potential issue #81. Definitely, we need to look into the permissions for this directory.

@reedjosh
Copy link
Author

I'm using EKS.

But really this may be an issue whenever a PVC is used, the pod user is nonRoot, and security context is not set on the deployment.

If not set, the PVC comes in owned by root.

If set, then it can be made owned by the running user.

Either way I'm not sure if the perms can be set to 700 to begin with or not.

When I changed the security context it came in as full perms to all 777.

@clyang82
Copy link
Collaborator

Yes. it seems we cannot change the permission by using securityContext. We can have an initContainer to change the permission, but it requires runasroot. it may have problem in some environments.

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

No branches or pull requests

3 participants