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

ETCD ownership related checks will always failed when running in container #842

Closed
mozillazg opened this issue Mar 7, 2021 · 1 comment · Fixed by #868
Closed

ETCD ownership related checks will always failed when running in container #842

mozillazg opened this issue Mar 7, 2021 · 1 comment · Fixed by #868

Comments

@mozillazg
Copy link
Collaborator

Overview

ETCD ownership related checks will always failed when running in container. Because of there is no user named etcd in container.

Maybe we should mount the /etc/passwd and /etc/group from host when running in container (need update README.md and job-master.yaml)?

How did you run kube-bench?

kubectl apply -f job-master.yaml 

What happened?

ETCD ownership related checks always failed.

- id: 1.1.12
text: "Ensure that the etcd data directory ownership is set to etcd:etcd (Automated)"
audit: ps -ef | grep $etcdbin | grep -- --data-dir | sed 's%.*data-dir[= ]\([^ ]*\).*%\1%' | xargs stat -c %U:%G
tests:
test_items:
- flag: "etcd:etcd"
remediation: |

What did you expect to happen:

Not failed when the ownership of ETCD data-dir is etcd:etcd.

Environment

[What is your version of kube-bench? (run kube-bench version)]

v0.5.0

@yoavrotems
Copy link
Contributor

Hey @mozillazg thanks for informing us about this issue, currently I'm working on different issues but I will mark it as good first issue and help wanted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants