<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=LXD_security</id>
	<title>LXD security - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=LXD_security"/>
	<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=LXD_security&amp;action=history"/>
	<updated>2026-05-16T01:01:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://tech.uvoo.io/index.php?title=LXD_security&amp;diff=5662&amp;oldid=prev</id>
		<title>Busk: Created page with &quot;To recreate a &quot;Cloud-Style&quot; secure environment using **LXD** on-premise, you have to move away from the idea of being a &quot;System Admin&quot; and start acting like a &quot;Service Provide...&quot;</title>
		<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=LXD_security&amp;diff=5662&amp;oldid=prev"/>
		<updated>2026-03-20T03:19:20Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;To recreate a &amp;quot;Cloud-Style&amp;quot; secure environment using **LXD** on-premise, you have to move away from the idea of being a &amp;quot;System Admin&amp;quot; and start acting like a &amp;quot;Service Provide...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;To recreate a &amp;quot;Cloud-Style&amp;quot; secure environment using **LXD** on-premise, you have to move away from the idea of being a &amp;quot;System Admin&amp;quot; and start acting like a &amp;quot;Service Provider.&amp;quot; &lt;br /&gt;
&lt;br /&gt;
In a standard setup, you sudo into everything. In a high-security LXD setup, you use **Project Isolation**, **Restricted Roles**, and **Hardware-Backed Encryption**.&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
### 1. Project Isolation (The Virtual Private Cloud)&lt;br /&gt;
Don't just run containers in the &amp;quot;default&amp;quot; project. Projects in LXD act like AWS Accounts or Azure Subscriptions. They have their own networks, storage volumes, and—crucially—their own security policies.&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
# Create a secure project&lt;br /&gt;
lxc project create secure-zone -c features.networks=true -c features.images=true&lt;br /&gt;
&lt;br /&gt;
# Switch to it&lt;br /&gt;
lxc project switch secure-zone&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
### 2. Restrict the &amp;quot;Admin&amp;quot; (RBAC)&lt;br /&gt;
To prevent a rogue local admin (or yourself by mistake) from having &amp;quot;God Mode&amp;quot; over every container, you should use **Canonical RBAC** (Role-Based Access Control) or integration with **OpenID Connect**.&lt;br /&gt;
&lt;br /&gt;
By integrating LXD with an identity provider (like Keycloak or Authelia), you can ensure that even if someone has a login to the physical host, they don't have the &amp;quot;LXD API&amp;quot; permissions to peek into a specific project's containers without an audited login.&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
### 3. Encryption at Rest (The Storage Layer)&lt;br /&gt;
In AWS, the EBS volumes are encrypted. In LXD, you should use **ZFS or LVM with LUKS**.&lt;br /&gt;
&lt;br /&gt;
* **The Goal:** If someone steals the physical hard drives from your server, they see nothing.&lt;br /&gt;
* **The Setup:** Encrypt the entire partition using LUKS before assigning it to the LXD Storage Pool.&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
# Example: Creating an encrypted ZFS pool for LXD&lt;br /&gt;
cryptsetup luksFormat /dev/sdb&lt;br /&gt;
cryptsetup open /dev/sdb crypt_storage&lt;br /&gt;
lxc storage create encrypted-pool zfs source=/dev/mapper/crypt_storage&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
### 4. Shielded Containers (The &amp;quot;Nitro&amp;quot; Equivalent)&lt;br /&gt;
LXD allows you to run **Virtual Machines (VMs)** instead of just containers. While containers share the host kernel (easier for a rogue root user to &amp;quot;escape&amp;quot;), LXD VMs use a separate kernel and hardware virtualization (QEMU/KVM).&lt;br /&gt;
&lt;br /&gt;
For your most sensitive data, use an LXD VM with **vTPM** (Virtual Trusted Platform Module) enabled:&lt;br /&gt;
```bash&lt;br /&gt;
lxc launch ubuntu:24.04 my-secure-vm --vm -c limits.cpu=2 -c security.agent=true&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
### 5. The &amp;quot;No-Sudo&amp;quot; Architecture (The API Approach)&lt;br /&gt;
The biggest risk in an on-premise setup is someone running `sudo lxc exec container bash`. &lt;br /&gt;
&lt;br /&gt;
To mitigate this:&lt;br /&gt;
1.  **Disable root SSH:** Never allow root login on the host.&lt;br /&gt;
2.  **Use the LXD Brink/Candid:** Force all container access through a remote API call that requires a multi-factor authentication (MFA) token, rather than direct local socket access.&lt;br /&gt;
3.  **Kernel Hardening:** Use **AppArmor** and **Seccomp** (enabled by default in LXD) to prevent containers from making sensitive system calls to the host kernel.&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
### Summary Checklist for a &amp;quot;Private Cloud&amp;quot;&lt;br /&gt;
| Feature | Local LXD Setup |&lt;br /&gt;
| :--- | :--- |&lt;br /&gt;
| **Identity** | Integrate with OIDC/Keycloak (No local passwords). |&lt;br /&gt;
| **Storage** | LUKS-encrypted ZFS or LVM pools. |&lt;br /&gt;
| **Isolation** | Use LXD Projects to silo different departments/apps. |&lt;br /&gt;
| **Runtime** | Use VMs (`--vm`) for high-security, Containers for dev. |&lt;br /&gt;
| **Auditing** | Forward LXD logs to a separate, write-only syslog server. |&lt;/div&gt;</summary>
		<author><name>Busk</name></author>
	</entry>
</feed>