Least Privilege
100%

Linux Hardening · Lesson 3

Least Privilege

Learn to choose file and administrative permissions for a specific service task.

Least privilege means giving an account the access required for its job. Start with verbs. The account may need to read one file, write another, and perform no administrative work.

Matching Rights to Work

A web worker needs to read index.html. The deployment account updates it. These two jobs can use different permissions. The worker can read the page and the deployer can write it.

Which page permission does the worker need for this example?

Checking the Whole Path

File permissions are only one part of the check. Linux also needs permission to enter the directories leading to the file. On a directory, the execute permission allows the program to traverse it when it knows the name it needs. A readable file behind a directory the worker cannot traverse is still inaccessible to that worker.

The worker can read index.html according to the file mode, but it cannot enter the parent directory. What should you review?

Limiting Special Actions

Administrative tools such as sudo can allow an approved user to perform specific maintenance. Define the action, who is approved to perform it, and how you can verify the new access. Check that the approved maintenance still works and that an unrelated administrative action remains unavailable under the same policy.

A maintenance role should review service status. Which test plan best checks the intended permissions?

Lesson complete

You finished Least Privilege

You can now reason about the minimum access a task needs.

  • Separate read, write, and administrative actions.

  • Check access through the directories in a path.

  • Verify both allowed and restricted actions for a role.

Keep your learning progress

Create a free account to save this lesson and continue learning on any device.

Create a free account
Next Lesson
Back to Linux Hardening