Mandatory access controls and service isolation
Why a readable file may still be denied
Discretionary access control (DAC) includes conventional file permissions and ACLs. Mandatory access control (MAC) applies a centrally defined security policy in addition to those checks. SELinux commonly reasons about process domains and object labels; AppArmor uses application profiles with rules such as path access. They are distinct implementations, not interchangeable configuration languages. Whether a policy is active depends on distribution, kernel and configuration.
Read a denial as evidence
Synthetic SELinux report: subject=catalog_t, object=stock_archive_t, operation=read, policy=enforcing, result=denied. These invented labels illustrate a process type, object type and operation; they are not actual distro defaults or raw audit syntax. Even if ordinary file permissions allow the read, the mandatory policy can refuse it. A denial may be an intended boundary, a configuration error or unexpected application behavior. Compare the operation with the service’s documented purpose before changing anything.
Investigate without weakening controls
Check the requested path, ordinary permissions, service identity, expected labels or profile, and recent changes. SELinux AVC audit records can provide details; AppArmor enforcement violations may be reported through audit or system logs. Log availability and format vary. If an approved data file was placed under the wrong label, plan a supported labeling correction rather than permitting every access. Do not turn off enforcement or automatically grant permissions from denial logs.
Limit what a service can do
In systemd environments, User= selects a service identity and NoNewPrivileges=yes restricts privilege gain through program execution. ProtectSystem=strict makes much of the filesystem read-only in the service context, subject to documented exceptions and environment support. Grant only the required writable paths. These settings are illustrative, not a complete service unit or a guarantee of isolation; check capabilities, sockets, mounts, policy and the actual installed systemd version.
Practice: decide whether denial is correct
Catalog reads an approved product export but is denied after a file move; it also requests access to an unrelated payroll file. Investigate the export path and label against the approved baseline; the payroll denial should remain. A change plan must verify that the export works and unrelated files remain inaccessible. Work from fictional records only; no policy edits or commands are required.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Mandatory access controls and service isolation — knowledge check
Reason about synthetic Linux security evidence.
DAC permits a read, but SELinux enforcing denies it. What is the outcome?
A catalog process requests unrelated payroll data. What should a defender do?
An approved export moved to a mislabeled path. Which response is proportionate?
What does NoNewPrivileges restrict?
What is a key difference between SELinux and AppArmor?