M Falah Aufa A
Yogyakarta, Indonesia
← Back to work

Linux Server Hardening & CIS Security Audit

Blue Team / Linux Hardening / Security Auditing2026
Linux Server Hardening & CIS Security Audit

Engineered an enterprise-style Linux defense-in-depth hardening home lab on Ubuntu Server 24.04 LTS in VirtualBox. Began with secure Filesystem Hierarchy Standard (FHS) custom disk partitioning across 6 dedicated partitions (/ 15G, swap 4G, /tmp 3G, /var 5G, /var/log 5G, and /home 5G) to enforce isolated mount policies against payload staging. Analyzed raw authentication logs (auth.log, last, lastb) across simulated failed SSH attempts to isolate PAM edge cases, including grep false negatives on invalid user queries and sudo noise. Implemented and validated restrictive mount flags (nodev, nosuid, noexec) on /tmp with execution denial proofs, recorded comprehensive pre-hardening baselines across 96 CIS checklist controls, and architected a planned 21-function modular Bash auditing script to evaluate compliance with clear PASS/FAIL reporting.

Key Impact & Outcome

Constructed a 6-partition isolated filesystem architecture, enforced nodev/nosuid/noexec execution boundaries on /tmp, mapped 96 CIS Benchmark controls across 6 categories, and designed a 21-function automated compliance verification engine.

Stack & Tools
Ubuntu Server 24.04 LTSCIS BenchmarkLinux AdministrationBash ScriptingFHS SecurityVirtualBoxOpenSSHauditdPAM SecuritySystem Auditing
Proof of Work

Key Metrics & Measurable Impact

Empirical audit telemetry across FHS filesystem partitioning, CIS Benchmark controls, and authentication forensics.

Partition Architecture
6 Partitions

Dedicated mounts for /, swap, /tmp, /var, /var/log, and /home to restrict binary execution

CIS Benchmark Scope
96 Controls

Comprehensive checklist across 6 categories: Filesystem, Services, Network, Logging, Auth, and Maintenance

Audit Script Functions
21 Functions

Automated checks evaluating system compliance, permissions, and service states

Documented Evidence
61 Screenshots

Structured evidence across Phase 1 (29), Phase 2 (30), and Phase 3 (2)

Log Telemetry Analyzed
5 Failed Logins

Authentication failure forensics mapped between lastb records and raw auth.log events

Overall Progress
14% (21 / 151)

21 completed milestones, 3 in progress, 127 planned across manual hardening and scripting

Artifacts & Visual Evidence

Work Artifacts & Key Evidence

Selected technical screenshots and logs. Use the side arrows to scroll or click any card to inspect.

Custom 6-Partition Storage Architecture
EVIDENCE #01↗
docs/screenshots/fase1/17-storage-configuration-final-summary.png

Custom 6-Partition Storage Architecture

Pre-installation custom storage architecture: 6 isolated partitions establishing dedicated security boundaries across mount points.

Inspect Evidence ↗Click to zoom
Authentication Telemetry in auth.log
EVIDENCE #02↗
docs/screenshots/fase2/06-auth-log-bukti-percobaan-gagal.png

Authentication Telemetry in auth.log

Failed SSH authentication telemetry captured in auth.log with full source IP attribution and timestamp correlation.

Inspect Evidence ↗Click to zoom
Historical Session Analysis (last and lastb)
EVIDENCE #03↗
docs/screenshots/fase2/09-last-dan-lastb.png

Historical Session Analysis (last and lastb)

Historical session auditing: correlated successful and failed authentication sessions via last and lastb binary log inspection.

Inspect Evidence ↗Click to zoom
Hardened /tmp Mount Options in fstab
EVIDENCE #04↗
docs/screenshots/fase3/00-fstab-tmp-sesudah-edit.png

Hardened /tmp Mount Options in fstab

Hardened /tmp filesystem mount options: enforced nosuid, nodev, and noexec flags in /etc/fstab and verified active in findmnt.

Inspect Evidence ↗Click to zoom
Execution Prevention Test on /tmp
EVIDENCE #05↗
docs/screenshots/fase3/01-tes-eksekusi-tmp-sesudah.png

Execution Prevention Test on /tmp

Runtime execution restriction validation: direct binary execution on /tmp successfully blocked with 'Permission denied'.

Inspect Evidence ↗Click to zoom

Investigation Timeline

01

Custom Partitioning & FHS Baseline Configuration

Provisioned Ubuntu Server 24.04 LTS with 6 isolated partitions (/ 15G, swap 4G, /tmp 3G, /var 5G, /var/log 5G, /home 5G). Generated fresh-install-before-hardening VM snapshot as baseline anchor.

❯ lsblk -o NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL
02

Authentication Forensics & Log Pattern Evaluation

Simulated failed SSH login attempts from host. Discovered that generic grep queries miss Invalid user entries and introduce noise from sudo session PAM events, informing robust parsing logic for future audit scripts.

❯ lastb -n 5 && grep "Failed password" /var/log/auth.log
03

Filesystem Hardening: Restricting /tmp Mount Options

Configured nodev, nosuid, and noexec options on /tmp in /etc/fstab. Executed systemctl daemon-reload and mount -o remount /tmp, confirming active enforcement via findmnt and verifying binary execution denial.

❯ findmnt /tmp # TARGET /tmp SOURCE /dev/sda3 FSTYPE ext4 OPTIONS rw,nosuid,nodev,noexec /tmp/test.sh # -bash: /tmp/test.sh: Permission denied
04

GRUB Initramfs Timing Triage & Recovery

Investigated persistent boot hangs at loading essential drivers on virtualized storage. Formulated and tested timing hypotheses, successfully establishing repeatable GRUB edit mode workarounds.

❯ grub > set root=(hd0,gpt2) && linux /boot/vmlinuz ... && initrd /boot/initrd.img
Implementation Matrix

Implementation Phases & Checklist

13/47 Tasks (28%)
  • ✓
    Install Ubuntu Server 24.04.4 LTS on VirtualBox (standard non-minimized)
  • ✓
    Configure dual network adapters (NAT + Host-only) and verify remote SSH access
  • ✓
    Create clean VM baseline snapshot: fresh-install-before-hardening
  • ✓
    Execute custom 6-partition scheme (/ 15G, swap 4G, /tmp 3G, /var 5G, /var/log 5G, /home 5G)
  • ✓
    Initialize git repository directory structure and initial commit
  • ✓
    Audit FHS top-level directory roles (/etc, /var, /tmp, /proc, /sys, /boot, /home)
  • ✓
    Evaluate security boundaries of /etc/passwd (644) vs /etc/shadow (640)
  • ✓
    Analyze auth.log, last, and lastb telemetry during simulated SSH failures

    ↳ Identified grep blind spots on Invalid user and sudo noise

  • ✓
    Document blue team staging risks: why /tmp and /dev/shm attract adversary payloads
  • ○
    Review merged-usr symlinks (/bin, /sbin, /lib -> /usr) and man hier specifications
  • ✓
    Enforce separate partitions for /tmp, /var, /var/log, and /home
  • ✓
    Configure nodev, nosuid, noexec on /tmp in /etc/fstab and verify via findmnt

    ↳ Execution test confirmed: direct execution denied

  • ◐
    Mount /dev/shm with nodev, nosuid, noexec flags

    ↳ Remount procedure prepared, awaiting execution test confirmation

  • ○
    Enforce nodev and nosuid on /var and /home, and nodev/nosuid/noexec on /var/log
  • ○
    Install and initialize AIDE filesystem integrity checking database
  • ○
    Blacklist legacy unused filesystems (cramfs, freevxfs, jffs2, hfs, hfsplus, udf)
  • ○
    Blacklist usb-storage kernel module to prevent unauthorized removable media
  • ○
    Restrict /boot/grub/grub.cfg permissions to root-only read/write (0600)
  • ○
    Verify ASLR enforcement (kernel.randomize_va_space = 2)
  • ○
    Restrict core dumps (fs.suid_dumpable = 0) and limits.conf hard limits
  • ○
    Enforce AppArmor enabled in enforce mode across standard profiles
  • ○
    Disable unneeded legacy services (avahi-daemon, cups, rpcbind, samba)
  • ○
    Audit and baseline listening ports (ss -tulpn) to ensure minimal attack surface
  • ○
    Configure kernel network sysctl parameters: disable IP forwarding and ICMP redirects
  • ○
    Enable TCP SYN cookies (net.ipv4.tcp_syncookies = 1) and rp_filter anti-spoofing
  • ○
    Configure UFW firewall: default deny incoming, permit SSH from Host-only subnet exclusively
  • ○
    Disable unused network protocols (dccp, sctp, rds, tipc)
  • ✓
    Verify baseline permissions: /etc/passwd (644) and /etc/shadow (640)
  • ✓
    Audit sudo group membership (verified restricted to primary user linuxaufa)
  • ○
    Harden SSH daemon: PermitRootLogin no, PasswordAuthentication no, MaxAuthTries 4
  • ○
    Enforce PAM password complexity via pam_pwquality and pam_pwhistory
  • ○
    Configure account lockout policy after consecutive failed logins via pam_faillock
  • ○
    Install and configure auditd rules for sensitive file changes and identity files
  • ○
    Set default umask to 027 and enforce shell idle timeout (TMOUT=900)
  • ○
    Develop check_tmp_mount_options (nodev, nosuid, noexec on /tmp)
  • ○
    Develop check_dev_shm_mount_options (noexec on /dev/shm)
  • ○
    Develop check_passwd_permissions and check_shadow_permissions
  • ○
    Develop check_ssh_root_login and check_ssh_password_auth
  • ○
    Develop check_unnecessary_services and check_firewall_status
  • ○
    Develop check_sysctl_network parameters and check_ip_forwarding
  • ○
    Develop check_auditd_status and check_aide_installed
  • ○
    Develop check_ssh_bruteforce_log tracking failed attempts per IP from auth.log
  • ○
    Assemble 21 modular check functions into unified linux-hardening-audit.sh tool
  • ○
    Document before-and-after compliance metrics and audit execution reports
  • ○
    Compile full investigation writeup (writeup.md) and troubleshooting notes
  • ◐
    Document initramfs boot hang troubleshooting and GRUB timing workaround

    ↳ GRUB recovery verified, hardware timing hypothesis under evaluation

  • ○
    Publish complete linux-hardening-audit repository to GitHub
Artifacts & Research

Documentation & Technical Reports

Writeup In Progress
✦
Technical Writeup in ProgressDrafting

Comprehensive technical analysis, investigation methodology, and formal security documentation for this project are currently being compiled. The full report and lab artifacts will be published here soon.

GitHub Repository↗
Ethical Disclaimer

This project was developed strictly for cybersecurity education, system defense research, and professional portfolio demonstration. All hardening configurations and simulated authentication failures were performed within an isolated, self-hosted virtual machine (VirtualBox Host-only network) targeting owned lab assets exclusively.

Next project

Incident Response Playbooks: Multi-Scenario Lab

→
Turning log noise into signal  ·  Defending systems one alert at a time  · Turning log noise into signal  ·  Defending systems one alert at a time  · 
© 2026 Muhammad Falah Aufa Anggara. All rights reserved.