fix(etcd): align cert ownership/permissions on first etcd node - #13428
fix(etcd): align cert ownership/permissions on first etcd node#13428mehrdadbn9 wants to merge 1 commit into
Conversation
|
Hi @mehrdadbn9. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mehrdadbn9 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
The cert-generation script (make-ssl-etcd.sh.j2) moved generated *.pem files into SSLDIR with no chown/chmod, so on the first etcd node they kept root:root with umask-derived perms (-rw------- keys, -rw-r--r-- certs). On every other node the copy tasks set mode 0640, owner etcd, group root. After moving the certs, chown to etcd:root and chmod 0640 so the first node matches the other nodes. This fixes etcd backup jobs that read certs on cp1 and fail with permission errors. Refs kubernetes-sigs#13250 Signed-off-by: Mehrdad Biukian Naeini <mehrdadbiukian@gmail.com>
d922b2c to
e9333f9
Compare
|
/ok-to-test |
Summary
Fixes #13250 — etcd certificates have inconsistent ownership/permissions on the first control-plane/etcd node vs the remaining nodes.
Root cause
roles/etcd/templates/make-ssl-etcd.sh.j2didmv *.pem ${SSLDIR}/with nochown/chmod. On the first etcd node the certs therefore keptroot:rootwith umask-derived perms (-rw-------keys,-rw-r--r--certs). On every other node thecopy:tasks ingen_certs_script.ymlsetmode: "0640",owner: "{{ etcd_owner }}"(etcd),group: "{{ etcd_cert_group }}"(root).Fix
After moving the certs,
chown {{ etcd_owner }}:{{ etcd_cert_group }}andchmod 0640so the first node matches the others. Verified by rendering the template (vars resolve toetcd/root) and executing the install block: before-rw------- root root/-rw-r--r-- root root, after-rw-r----- etcd rootfor all*.pem.Test plan
{{ }}0640 etcd:root(matches other-node scheme)molecule/CI run on a real cluster (pending /ok-to-test)Checklist