canonical / canonical/cloud-init
[enhancement]: validate Azure's CustomData is base64-decodable
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 1.1k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 18
Description
# Enhancement
## Summary
Validate that the `CustomData` field is base64-decodable while parsing `ovf-env.xml` on the Azure datasource, and raise a dedicated ReportableError when it cannot be decoded instead of letting provisioning fail in a less visible way.
## Motivation
Azure delivers user-provided `customData` to the guest as a base64-encoded value inside the provisioning OVF (`ovf-env.xml`). Today, cloud-init decodes this field with `base64.b64decode(...)` during OVF parsing. If the value is not valid base64, `b64decode` raises a bare `binascii.Error` that is not caught at the parsing boundary, so cloud-init proceeds and the failure surfaces later as an unhandled exception which is a bit less clear to diagnose and does not get reported to the platform through the normal KVP path.
Contributor guide
Research direction
Locate the Azure datasource code that parses CustomData from ovf-env.xml and the existing ReportableError handling boundary. Start by tracing the base64.b64decode call and inspect nearby tests or parsing entry points. Done means invalid CustomData raises a dedicated ReportableError while valid values continue through parsing and the error is reported through the normal KVP path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, python
- Domain
- cloud
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100