← LFCS: Linux administration in production
02 / 7 · 25 MIN

Packages, VMs, containers, and SELinux

Maintain trust, persistence, and access control during platform changes.

Concept and mechanism

Installing a package involves trusting an origin and key, not merely recognizing a name. For an unfamiliar repository key, confirm fingerprint and origin through a trusted channel before accepting it. Disabling verification to meet a date removes the authenticity evidence that is missing. DNF and SELinux examples in this lesson use RHEL 10 documentation; LFCS is distribution-independent and does not require assuming every host uses these tools. Consult installed versions and local manuals. On a persistent libvirt VM, a live-scoped change can work now without being saved in the definition used at the next start. Confirm both states when the requirement demands survival across startup.

Guided application

In Docker, the writable layer follows the instance lifecycle. If deployment removes and recreates a container, storing reports only in that layer leaves persistence unresolved. A volume can outlive the instance but still needs permissions, backups, and tested recovery. With SELinux, DAC and MAC are distinct controls. If evidence shows an incorrect type after moving a directory, review persistent context mapping and apply the expected label. An isolated chcon change may be undone by later relabeling. Generating permissions from every denial without understanding the cause may unnecessarily broaden access. Document the change and service test, not merely disappearance of an error.

IN PRACTICE

A disk attached with --live disappears from VM configuration after shutdown and start: persistent definition was not handled.

Common pitfalls

A signature with an unknown key as trust; live as persistent; volume as backup; chmod as a fix for every SELinux denial.

Related topics: Local networking, resolution, and SSH access · Time, filtering, bonds, and proxies

Take this idea with you

Connect each change to its scope, trust origin, and the state that must survive.

Create account

Reference: virsh manual · LFCS current five-domain outline; exact edition date unconfirmed