Skip to content

silentguyracer/OPEN-SOURCE

Repository files navigation

oss-audit-[rollnumber]

Open Source Audit — Linux Kernel

Course: Open Source Software (OSS NGMC) | VIT
Student: [Your Name] | Roll Number: [Your Roll Number]
Software Audited: Linux Kernel | License: GPL v2


About This Project

This repository contains the shell scripts and supporting material for the Open Source Audit capstone project. The audit examines the Linux Kernel — the open-source project that powers everything from Android smartphones to the world's top supercomputers — through the lens of its origin, philosophy, licensing, Linux footprint, and ecosystem.


Repository Structure

oss-audit-[rollnumber]/
├── README.md
├── script1_system_identity.sh       # System Identity Report
├── script2_package_inspector.sh     # FOSS Package Inspector
├── script3_disk_permission_auditor.sh  # Disk & Permission Auditor
├── script4_log_analyzer.sh          # Log File Analyzer
└── script5_manifesto_generator.sh   # Open Source Manifesto Generator

Script Descriptions

Script 1 — System Identity Report

Displays a welcome screen summarising the Linux system: distribution name, kernel version, CPU architecture, logged-in user, home directory, uptime, current date/time, and the GPL v2 licence that covers the OS.

Shell concepts used: Variables, echo, command substitution $(), uname, uptime, date, grep, cut, output formatting.


Script 2 — FOSS Package Inspector

Checks whether a given package is installed (supports both dpkg on Debian/Ubuntu and rpm on RHEL/CentOS), displays its version and summary, and prints a philosophy note about the package using a case statement.

Shell concepts used: if-then-else, case statement, dpkg -l / rpm -q, grep -E, command -v, pipe (|).


Script 3 — Disk and Permission Auditor

Loops through a list of important system directories and kernel-related paths, reporting permissions, ownership, and disk usage for each. Also reports the count of loaded kernel modules.

Shell concepts used: for loop, arrays, ls -ld, awk, du -sh, cut, find, wc -l, -d and -e file tests.


Script 4 — Log File Analyzer

Reads a specified log file line by line, counts lines matching a keyword (case-insensitive), prints the last 5 matching lines, and includes a do-while style retry loop if the file is empty. Accepts command-line arguments.

Shell concepts used: while read loop, if-then, counter variables ($((COUNT + 1))), grep -iq, command-line arguments ($1, $2), tail, exit.


Script 5 — Open Source Manifesto Generator

Asks the user three interactive questions and generates a personalised open-source philosophy statement, saving it to a .txt file named after the current user.

Shell concepts used: read -p, string concatenation, echo with file redirect (> and >>), date, cat, shopt -s expand_aliases, alias demonstration.


How to Run the Scripts

Prerequisites

  • A Linux system (Ubuntu 20.04+, Debian 11+, or RHEL/CentOS/Fedora)
  • Bash shell (pre-installed on all Linux distributions)
  • No additional packages required

Setup — WSL2 (Windows Users)

If you are on Windows, install WSL2:

wsl --install

Then open the Ubuntu terminal that appears and follow the Linux instructions below.

Setup — VirtualBox (Any OS)

  1. Download VirtualBox from virtualbox.org
  2. Download Ubuntu 22.04 LTS ISO from ubuntu.com
  3. Create a new VM (2GB RAM, 20GB disk), attach the ISO, install Ubuntu
  4. Clone this repository inside the VM

Running the Scripts

# Clone the repository
git clone https://github.com/[your-username]/oss-audit-[rollnumber].git
cd oss-audit-[rollnumber]

# Make all scripts executable
chmod +x *.sh

# Script 1 — System Identity Report
./script1_system_identity.sh

# Script 2 — FOSS Package Inspector (default: linux-image kernel package)
./script2_package_inspector.sh
# Or specify a package:
./script2_package_inspector.sh git

# Script 3 — Disk and Permission Auditor
./script3_disk_permission_auditor.sh

# Script 4 — Log File Analyzer
# On Ubuntu/Debian:
./script4_log_analyzer.sh /var/log/syslog error
# On RHEL/CentOS:
./script4_log_analyzer.sh /var/log/messages error
# For kernel-specific logs:
./script4_log_analyzer.sh /var/log/kern.log kernel

# Script 5 — Open Source Manifesto Generator (interactive)
./script5_manifesto_generator.sh

Dependencies

All scripts use only standard Bash built-ins and common Linux utilities pre-installed on every distribution:

Utility Purpose Pre-installed?
bash Shell interpreter Yes (all distros)
uname Kernel/system info Yes
dpkg / rpm Package info Yes (distro-specific)
ls, du, df Filesystem info Yes
grep, awk, cut Text processing Yes
date, uptime Time/system info Yes

No apt install or pip install required.


Software Audited: Linux Kernel

Property Detail
Full Name Linux Kernel
Current Version 6.x (check kernel.org for latest)
License GNU General Public License v2 (GPL v2)
Created By Linus Torvalds, 1991
Official Site kernel.org
Source Repository git.kernel.org / github.com/torvalds/linux
Govering Body The Linux Foundation

Academic Integrity

All shell scripts in this repository are original work written for the OSS NGMC course. The accompanying report is written in the student's own words. Any use of external references is cited within the report document.


VIT | Open Source Software Course | Capstone Project

About

THE PROJECT GIVES THE BASIC IDEA ABOUT THE LINUX PROJECT

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages