Week 2 Session 2 Task - [Linux Hardening] Information Security Lab: Implementing DAC, MAC, and RBAC
Hello everyone! In this post, I’d like to share my experience from a recent Information Security lab where I explored access control mechanisms in Linux. This lab focused on three critical methods that are central to Linux system security and hardening:
-
DAC (Discretionary Access Control)
-
MAC (Mandatory Access Control) using AppArmor
-
RBAC (Role-Based Access Control) via user groups and sudo policies
What is Linux Hardening?
Linux hardening is the process of securing a Linux system by minimizing its vulnerabilities and limiting exposure to potential attacks. One of the most fundamental components of hardening is access control — determining who can access what and how.
In this task, I practiced three access control models:
-
DAC – File ownership and permissions using
chmod
,chown
, etc. -
MAC – Policy-based enforcement using AppArmor
-
RBAC – Role-based permission management through Linux groups and sudo rules
1. Discretionary Access Control (DAC)
Experiment 1: File Permission Basics
I started by creating a test file and inspecting its default permissions:
Typically, the owner gets rw-
permissions, while others only get r--
.
Experiment 2: Changing Permissions with chmod
Restricting access to the file:
Trying to read the file as a different user returned "Permission denied"Experiment 3: Changing Ownership with chown
3. Role-Based Access Control (RBAC)
Creating User Roles and Groups
Configuring sudo Access
In /etc/sudoers.d/praktikum
:
%admin ALL=(ALL) ALL
%developer ALL=(ALL) /usr/bin/git, /usr/bin/python3, /usr/bin/gcc
%auditor ALL=(ALL) NOPASSWD: /bin/cat /var/log/syslog, /bin/cat /var/log/auth.log
Role Behavior:
-
Admin: Full sudo access
-
Developer: Limited to development tools
-
Auditor: Read-only access to system logs
Case Study: Developer vs QA Engineer
Access Table
Role | Directory | Read | Write | Execute | Notes |
---|---|---|---|---|---|
Developer | /var/www/html |
✅ | ✅ | ✅ | Full access to codebase |
QA Engineer | /var/www/html |
✅ | ❌ | ❌ | Can only read code for review |
Komentar
Posting Komentar