aenix-io / etcd-operator

New generation community-driven etcd-operator!
https://etcd.aenix.io
Apache License 2.0
82 stars 14 forks source link

Provide a flag to enable etcd auth #160

Closed kvaps closed 3 months ago

kvaps commented 5 months ago

Kamaji project uses muti-tenant etcd so it reuqires to make the setup more secured. I think we can provide the following flag:

security:
  enableAuth: true

which should do:

if etcdctl user get root &>/dev/null; then
  echo "User already exists, nothing to do"
else
  etcdctl user add --no-password=true root &&
  etcdctl role add root &&
  etcdctl user grant-role root root &&
  etcdctl auth enable
fi

And in case of false:

etcdctl auth disable