charts icon indicating copy to clipboard operation
charts copied to clipboard

[stable/anchore-engine] runAsNonRoot Error

Open webbdog28 opened this issue 7 years ago • 5 comments

We're using pod security policies and I'm getting this error when trying to deploy anchore-engine:

Error: container has runAsNonRoot and image has non-numeric user (anchore), cannot verify user is non-root

I noticed that the engine runs as the "anchore" user but it's not being specified by it's UID. Can this be fixed or does this need to be run as a privileged pod?

webbdog28 avatar Oct 09 '19 21:10 webbdog28

Thanks @webbdog28 Anchore indeed does not run as root.

Looks like the solution is: at pod level "runAsUser or have the USER directive defined (using a numeric UID) in the image"

So this seems achievable in the chart without changing the image itself. Anchore uses uid:gid 1000:1000.

As a workaround, using something like kustomize or github.com/replicatedhq/ship should let you set the runAsUser field until it is updated in the chart itself.

@Btodhunter, let's look at this for an update to the chart

zhill avatar Oct 11 '19 16:10 zhill

@webbdog28 - I put in an update to add security contexts with runAsUser: 1000 & runAsGroup: 1000 to all pods in our deployments. I think this will solve your issue. Give chart v1.3.3 a try and let me know if it helped. Thanks!

Btodhunter avatar Oct 11 '19 18:10 Btodhunter

Will do. Thank you gentlemen! Appreciate the fast response!

webbdog28 avatar Oct 11 '19 19:10 webbdog28

@webbdog28 can you confirm if the issue is resolved and close this if it is? thanks!

zhill avatar Oct 16 '19 23:10 zhill

Confirmed!

webbdog28 avatar Oct 17 '19 02:10 webbdog28