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

Delete userdata from VirtualBox/VMware after Ignition completes #1350

Merged
merged 13 commits into from
May 3, 2022
Merged

Delete userdata from VirtualBox/VMware after Ignition completes #1350

merged 13 commits into from
May 3, 2022

Conversation

bgilbert
Copy link
Contributor

Add an ignition-rmcfg multicall binary and corresponding service in the real root. On first boot in VirtualBox and VMware, run it to delete the Ignition config from the hypervisor. The service can be masked by the Ignition config if desired.

Fixes #1315.

Import vmware-archive/vmw-ovflib@53a0e9f7a4 verbatim; it's no longer
maintained upstream.  This is identical to the vendored vmw-ovflib code.
The license file is identical to the one in the root of the repo.
internal/providers/vmware/vmw-ovflib/ovf.go Outdated Show resolved Hide resolved
internal/providers/vmware/vmware_amd64.go Outdated Show resolved Hide resolved
internal/providers/vmware/vmware_amd64.go Outdated Show resolved Hide resolved
internal/providers/virtualbox/virtualbox.c Outdated Show resolved Hide resolved
internal/providers/virtualbox/virtualbox.c Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
bgilbert added a commit to coreos/fedora-coreos-config that referenced this pull request Apr 27, 2022
@jlebon jlebon mentioned this pull request Apr 27, 2022
We need to round-trip OVF environment XML, which uses XML namespace
prefixes. encoding/xml can't handle those [1] and bad things happen if
you try [2].  Use an external package instead.

[1]: golang/go#9519
[2]: https://github.com/mattermost/xml-roundtrip-validator/blob/master/advisories/unstable-elements.md
For now, deleting Ignition configs from the provider will be handled by
a separate program running in the real root.  That allows a config with
any spec version to disable the deletion by masking the unit.
Configs might be in guestinfo properties or OVF metadata.  Remove any
config in the OVF metadata, and replace any config in guestinfo (since
we can't delete properties entirely).
Delete config and config-encoding guest properties.
Add a systemd service that runs ignition-rmcfg to delete userdata early
in first boot on VirtualBox and VMware.  This will fail the boot if it
runs unsuccessfully, and can be masked in the config if desired.  Add
/usr/libexec/ignition-rmcfg as a symlink to the Ignition binary in the
Dracut module, to save space.

Distros will probably want to enable this service by default.

Fixes #1315.
@bgilbert
Copy link
Contributor Author

bgilbert commented May 3, 2022

Addressed comments!

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

Successfully merging this pull request may close these issues.

Consider deleting userdata from provider after Ignition completes
2 participants