{"id":19450821,"url":"https://github.com/clearlinux/micro-config-drive","last_synced_at":"2025-04-25T03:32:07.800Z","repository":{"id":55390745,"uuid":"45555585","full_name":"clearlinux/micro-config-drive","owner":"clearlinux","description":"An alternative and small cloud-init implementation in C","archived":false,"fork":false,"pushed_at":"2023-01-27T00:15:50.000Z","size":394,"stargazers_count":46,"open_issues_count":14,"forks_count":18,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-03T15:43:39.964Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/clearlinux.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-04T17:30:52.000Z","updated_at":"2024-09-29T09:55:45.000Z","dependencies_parsed_at":"2023-02-15T03:16:38.602Z","dependency_job_id":null,"html_url":"https://github.com/clearlinux/micro-config-drive","commit_stats":null,"previous_names":[],"tags_count":49,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearlinux%2Fmicro-config-drive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearlinux%2Fmicro-config-drive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearlinux%2Fmicro-config-drive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clearlinux%2Fmicro-config-drive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clearlinux","download_url":"https://codeload.github.com/clearlinux/micro-config-drive/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250748094,"owners_count":21480778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T16:39:11.348Z","updated_at":"2025-04-25T03:32:07.349Z","avatar_url":"https://github.com/clearlinux.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"\n## A config-drive handler.\n\n\n### Contents:\n\n  - Description of this project\n  - Compiling, prerequisites\n  - Security considerations\n  - Bugs and feedback?\n\n\n## Description\n\nMicro-config-drive (\"ucd\" for short) provides a subset of functionality\nthat is provided by cloud-init implementations. Specifically,\nucd provides the basic options and functions to handle config-2\nconfig-drive data for systems that have this config-drive data provided\nas a block device to the container or VM.\n\ncloud-init is the standard way for cloud customers to initialize\ncontainers and virtual hosts. These virtual machines are usually\nprovisioned in bulk and provided without any customization to cloud\ncustomers, which then require that they are customized for their\nparticular purpose.\n\nSeveral implementations exist that implement this functionality,\nand this implementation is fairly similar to the other ones. For\nreference, we're listing the other implementations here:\n\n- https://launchpad.net/cloud-init\n    A Python-based implementation and the \"standard\". Many of the\n    features of this implementation are derived and benchmarked against\n    this version.  This implementation supports many different OS's,\n    not just Ubuntu.\n- https://github.com/coreos/coreos-cloudinit\n    A Go-based implementation for CoreOS.\n\nWhile generally it's preferred to use existing implementations,\nsince it reduces duplicate code and makes stronger communities, in\nthis project's case it was decided to forego extending and working\non the existing implementations. Several factors were considered, and\na short summary of the key points of that decision are listed below.\n\nSpeed is a significant factor. Interpreted languages have come a long\nway and are highly performant, especially if properly used. However,\nthere is a significant cost of provisioning cloud nodes that have\nincreased base storage costs due to the inclusion of libraries of\ninterpreted languages. Since we expect people to prefer cloud nodes are\nminimal in size, having interpreted language libraries just for the\nsake of a cloud initialization script makes little sense, and we can\nreduce the storage need and copy times of cloud images significantly.\n\nLanguage choice is a minor factor. Generally languages that have\ngood exception handling are preferred. Since execution speed and low\ncomplexity are preferred for installation and boot-time critical tasks,\nlots of libraries should be avoided, as robustness is critical. Missed\npython exceptions could cause cloud-init execution to halt, resulting\nin an unusable cloud host, which is to be avoided at all cost. The\ndrawbacks of C being fairly sparse are known, and debugging tools\ncompensate for that.\n\nWe can shed additional overhead by eliminating unwanted functionality\nthat a clearlinux cloud node does not need, but we can likely\nnever recoup the initial cost of a base Python installation, as it\nis generally in the order of 100MB or more. Hence, we've opted to\nimplement a version in C that has reduced library requrements. This\nhas brought the size of this implementation down to under 1mb. Even\nconsidering used libraries, the resulting binary is small.\n\n\n## Compiling\n\nCurrently, ucd requires the following prerequisites:\n- `glib-2.0 \u003e= 2.24.1`\n- `yaml-0.1 \u003e= 0.1.4`\n- `libparted \u003e= 3.1`\n- `blkid \u003e= 2.25.0`\n- `json-glib-1.0`\n\nAs ucd is tooled with autotools, one shouldn't have to do\nmore than:\n\n```\n$ sh autogen.sh\n$ make\n$ sudo make install\n```\n\n\n## Security considerations\n\n`micro-config-drive` and `user-data-fetch` should never be deployed\non existing, or provisioned, installations. Doing so may expose your\nsystem to an attacker on a local network.\n\nIf deploying on a public could infrastructure, you should assure that\nrouting to your instance is limited to trusted infrastructure nodes.\n\nMost cloud service providers use LL addresses to serve cloud configs.\nIf your CSP does not, you should verify that your use of non-LL\naddresses for cloud config service data is secure and does not expose\nyour systems to unnecesary risk.\n\nWhen running this project in a CSP environment, you should assure\nyou are enabling the correct cloud service type. Do not under any\ncircumstance enable several service types, this may further expose\nyour instances to risk.\n\n`micro-config-drive` is not immune to `man-in-the-middle` (MITM)\nattacks, since it relies on unencryted HTTP services. This means a\nlocal attacker may manipulate the received cloud service data. This\nis a fundamental issue with `cloud-config` as it currently is offered\nby CSP's, and not an implementation bug.\n\n\n## Bugs, feedback, contact\n\nucd is hosted on github. You can find releases, an issue tracker\nand git sources on github.com/clearlinux/micro-config-drive. For\nmailing lists, subscribe to dev@lists.clearlinux.org (via\nlists.clearlinux.org).\n\nWhen submitting bug reports, it may be relevant to include the\nlog output of clouds- init. This can be done with the following\ncommand: `journalctl -b -u ucd`. Omit the `-b` option if\nyou want output from prior to the last boot event.\n\nThis project has many contributors. Not all may be mentioned in the\nAUTHORS file.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearlinux%2Fmicro-config-drive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclearlinux%2Fmicro-config-drive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclearlinux%2Fmicro-config-drive/lists"}