Skip to content

Make user/vendor data sensitive and remove log permissions (#2144)

Ani Sinha requested to merge anisinha/cloud-init:fix-2190083 into c9s

BZ: 2190083

Cherry-pick the following commit from upstream with a minor conflict arising due to the upstream commit 5942f402 ("[1/2] DHCP: Refactor dhcp client code (#2122)" removing vi editor formatting directive in cloudinit/sources/DataSourceVultr.py .

Because user data and vendor data may contain sensitive information,
this commit ensures that any user data or vendor data written to
instance-data.json gets redacted and is only available to root user.

Also, modify the permissions of cloud-init.log to be 640, so that
sensitive data leaked to the log isn't world readable.
Additionally, remove the logging of user data and vendor data to
cloud-init.log from the Vultr datasource.

LP: #2013967
CVE: CVE-2023-1786
(cherry picked from commit a378b7e4f47375458651c0972e7cd813f6fe0a6b)
Signed-off-by: Ani Sinha <anisinha@redhat.com>

Merge request reports