bhouse-nexthop commented on PR #14918:
URL: https://github.com/apache/cloudstack/pull/14918#issuecomment-7272133659

   Tested on a KVM lab with a main (24.0) build, first without and then with 
this change. Primary storage is Ceph RBD. The build also carries #14408 (so the 
control node gets the registry config too) and #14898 (the `hosts.toml` version 
of `setup-containerd`), and the change is applied on top of both. The private 
registry is `registry:2` with htpasswd basic auth over HTTP, and it refuses 
anonymous pulls (401). Its test user has a fake password containing `{{ }}`, 
`{% %}`, a double quote and a single quote. Each cluster runs Kubernetes 1.33.1 
from an ISO, with 1 control node and 1 worker node. A DaemonSet pulls an image 
that exists only in that registry, so a Running pod proves the node sent the 
credentials.
   
   Once setup finished, every node was searched for the password, the base64 
`user:password` and the base64 password: in `/var/log`, and in any 
world-readable file under `/etc`, `/opt`, `/var/lib/cloud`, `/run/cloud-init`, 
`/home`, `/root` and `/tmp`. As a positive control, the same search had to find 
the auth string in `config.toml` and `setup-containerd`, with the modes this 
change sets.
   
   | Check | Without the change | With the change |
   |---|---|---|
   | Cluster state | Running | Running, both with stacked etcd and with 1 
external etcd node |
   | Credentials in `/var/log/cloud-init-output.log` on the control and worker 
nodes | yes (from the `bash -x` trace) | no |
   | Credentials anywhere else under `/var/log`, or in a world-readable file | 
not checked | none |
   | `/etc/containerd/config.toml` holds the auth | 0644 (as the template sets 
it) | 0600 root:root |
   | `/opt/bin/setup-containerd` holds the auth | 0755 (as the template sets 
it) | 0700 root:root |
   | Pull from the registry on the control and worker nodes | | Ready 2/2 |
   | Registry URL with a single quote | accepted. The script dies on a syntax 
error, so there is no auth table and the pull fails (0/2) | not run in the lab. 
A single quote is valid in a URI, so it is accepted, and the URL now reaches 
the script base64-encoded; the unit tests cover a URL with `'` |
   | Registry URL with a double quote, or with braces | | refused: "Invalid 
docker registry url", and no cluster is created |
   
   Runs without the change: the leak check passed 9 of 9 and the broken-URL 
check 10 of 10. Runs with the change: invalid URLs were refused in 2 of 2 runs 
(5 of 5 checks each), and the stacked etcd and external etcd clusters each 
passed 17 of 17.
   
   All clusters were deleted afterwards, and the test user was removed from the 
registry.
   
   Not tested: 4.22, where the base has no #14408 so the control node gets no 
registry config. Also not tested: a registry over HTTPS, and the external etcd 
node itself, which gets no registry config.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to