Day 34: Access Control Lists (ACLs) and Granular Permissions

Linux Server Administration: Build a Secure Headless Home Lab ~7 min read

Welcome back, fellow architects of resilience and system whisperers!

In our journey to build a secure, high-performance headless home lab, we've laid down a solid baseline. We've locked down SSH, managed users, and understood the fundamental chmod and chown dance. But what happens when the dance floor gets crowded? What if you need to let just one more person into a restricted area without giving them the keys to the entire building? Or, in big tech terms, how do you manage granular access for distinct microservices sharing a common persistent volume without resorting to complex user juggling?

Today, we're diving deep into Access Control Lists (ACLs) – a powerful, yet often underutilized, mechanism that elevates Linux permissions beyond the traditional owner, group, and others model. This isn't just about another command; it's about understanding how to implement the principle of least privilege at a granular file system level, a concept that underpins security in every ultra-high-scale system I've ever architected.

The Bottleneck of Traditional Permissions

Recall the classic Unix permission triad: owner, group, and others. Each gets read (r), write (w), and execute (x) bits. This works beautifully for simple scenarios. But imagine a shared project directory in your home lab: /srv/projects/super_secret_project.

  • You (sysadmin) own it.

  • The devs group needs full access.

  • But now, a new qa user needs read-only access to specific log files within that project, without being part of the devs group.

  • And a build_service user (think CI/CD agent) needs write-only access to a /srv/projects/super_secret_project/artifacts directory.

With traditional permissions, you'd be stuck. You could add qa and build_service to the devs group, but that grants them far too much power (write access to everything). You could change the group ownership for subdirectories, but that quickly becomes an unmanageable mess, breaking the logical grouping. This is a classic security anti-pattern: privilege escalation by group membership.

This exact problem plagues large organizations. Think of a shared storage array accessed by dozens of microservices, each running with a dedicated service account. Granting access via primary groups quickly leads to services having more permissions than they need, creating massive attack surfaces.

Core Concepts: ACLs to the Rescue

ACLs extend the traditional permission model by allowing you to define permissions for additional specific users and additional specific groups on a per-file or per-directory basis.

How ACLs Fit in the Overall System: The Permission Evaluation Flow

When a process tries to access a file or directory, the Linux kernel doesn't just check chmod bits. It follows a precise evaluation order:

  1. Effective User ID (EUID): Is the EUID of the process the owner of the file? If yes, owner permissions apply.

  2. ACLs Present? If ACLs are defined for the file/directory, the kernel checks them before traditional group and others permissions.

Keep going with the full lesson

The rest of this lesson β€” plus its implementation guide, runnable scripts and source code β€” is included with the course or an All Access plan. Create a free account to start the free lessons in every course.

Already a member? Sign in