# schm1d/awesomearchlinux architecture

> Architecture diagram of the GitHub repository schm1d/awesomearchlinux, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/schm1d/awesomearchlinux
- Repository: https://github.com/schm1d/awesomearchlinux

## Overview

##### Base Installation (in the “base” directory)
2. Hardening Modules (in the “hardening” directory, with submodules for firewall, SSH hardening, and sysctl settings)

##### Main Components
- Base Installer Module:
- Contains scripts like archinstall.sh, chroot.sh, and secureBoot.sh.
- This module is responsible for automating disk partitioning, formatting, setting up full disk encryption with LVM on LUKS (and a special encrypted boot partition), and configuring secure boot through GRUB.
- Hardening Module:
- Subdivided into dedicated areas:
▪ Firehol: Scripts that manage iptables and firewall configuration (firehol.sh).
▪ SSH: Scripts to harden SSH configurations (ssh.sh, ssh_client.sh) plus accompanying documentation.
▪ Sysctl: Scripts that apply kernel parameter hardening (sysctl.sh).
- Utility Module:
- A collection of miscellaneous scripts used for additional security or customization tasks (e.g., configurations for auditd, vim/neovim, themes, zsh, etc.).
- External System and User Interaction:

##### Relationships and Interactions
- Base Module → Hardening Module:
- Hardening Module → Utility Module:
- Utility scripts can be seen as either supplementary or optional, providing additional adjustments after the base hardening.
- Internal Dependencies:
- Within the base scripts, illustrate that archinstall.sh initiates the overall installation; chroot.sh is used to run post-installation configurations in the installed environment; and secureBoot.sh configures GRUB along with boot encryption.
- The hardening section is modular – each folder (firehol, ssh, sysctl) represents an independent submodule that collectively contributes to comprehensive system security.
- Iterative Customization:
- That there is an element of configuration where the user is expected to modify variable settings depending on their system setup. This customization step is central and should be highlighted.

##### Architectural Patterns and Design Principles
- Modularity:
- Separation of concerns: base installation, system hardening, and utility customizations are kept in separate directories to allow independent modification.
- Sequential Flow:
- Customizability:
- Variables like DISK, USERNAME, TIMEZONE, etc., are defined by the user. Represent these as inputs to the overall process.
- Security Enhancements:
- Clearly label components that deal with encryption, bootloader hardening, authentication, firewalling, and system auditing.

##### Specific Technologies, Frameworks, and Tools
- Arch Linux – the target OS.
- Shell Scripting – used throughout the project.
- LUKS and LVM – for full disk encryption.
- GRUB – for bootloader configuration and secure boot.
- iptables/firehol, PAM, sysctl – for security hardening.
- NVIDIA drivers installation tailored for systems with NVIDIA GPUs.

##### Instructing the Principal Software Engineer
- Incorporate elements like input parameters (user-customizable variables) feeding into the Base Installation module.
- Process scripts (e.g., installation and hardening jobs)
- Configuration scripts/utilities
- Documentation or informational resources (like README files).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Input
    UI("User Input\n(Variables: DISK, USERNAME, TIMEZONE, etc.)"):::input

    %% Base Installation Module
    subgraph "Base Installation"
        A1("archinstall.sh"):::base
        A2("chroot.sh"):::base
        A3("secureBoot.sh"):::base
        A1 --> A2
        A2 --> A3
    end

    %% Hardening Configuration Module
    subgraph "Hardening Configuration"
        %% Firehol Submodule
        subgraph "Firewall (Firehol)"
            F1("firehol.sh"):::hardening
            F2("README"):::hardening
            F1 --> F2
        end
        %% SSH Hardening Submodule
        subgraph "SSH Hardening"
            S1("ssh.sh"):::hardening
            S2("ssh_client.sh"):::hardening
            S3("README"):::hardening
            S1 --> S2
            S2 --> S3
        end
        %% Sysctl Configuration Submodule
        subgraph "Sysctl Configuration"
            SC1("sysctl.sh"):::hardening
            SC2("README"):::hardening
            SC1 --> SC2
        end
    end

    %% Utility Enhancements Module
    subgraph "Utility Enhancements"
        U1("auditd-attack.rules"):::utility
        U2("gnome.sh"):::utility
        U3("nano.sh"):::utility
        U4("neovim.sh"):::utility
        U5("theme.sh"):::utility
        U6("vim.sh"):::utility
        U7("yay.sh"):::utility
        U8("zsh.sh"):::utility
    end

    %% Sequential Flow Arrows
    UI --> A1
    A3 --> F1
    SC2 --> U1

    %% Click Events for Base Installation Module
    click A1 "https://github.com/schm1d/awesomearchlinux/blob/main/base/archinstall.sh"
    click A2 "https://github.com/schm1d/awesomearchlinux/blob/main/base/chroot.sh"
    click A3 "https://github.com/schm1d/awesomearchlinux/blob/main/base/secureBoot.sh"

    %% Click Events for Hardening Module – Firehol
    click F1 "https://github.com/schm1d/awesomearchlinux/blob/main/hardening/firehol/firehol.sh"
    click F2 "https://github.com/schm1d/awesomearchlinux/blob/main/hardening/firehol/README.md"

    %% Click Events for Hardening Module – SSH Hardening
    click S1 "https://github.com/schm1d/awesomearchlinux/blob/main/hardening/ssh/ssh.sh"
    click S2 "https://github.com/schm1d/awesomearchlinux/blob/main/hardening/ssh/ssh_client.sh"
    click S3 "https://github.com/schm1d/awesomearchlinux/blob/main/hardening/ssh/README.md"

    %% Click Events for Hardening Module – Sysctl Configuration
    click SC1 "https://github.com/schm1d/awesomearchlinux/blob/main/hardening/sysctl/sysctl.sh"
    click SC2 "https://github.com/schm1d/awesomearchlinux/blob/main/hardening/sysctl/README.md"

    %% Click Events for Utility Enhancements Module
    click U1 "https://github.com/schm1d/awesomearchlinux/blob/main/utils/auditd-attack.rules"
    click U2 "https://github.com/schm1d/awesomearchlinux/blob/main/utils/gnome.sh"
    click U3 "https://github.com/schm1d/awesomearchlinux/blob/main/utils/nano.sh"
    click U4 "https://github.com/schm1d/awesomearchlinux/blob/main/utils/neovim.sh"
    click U5 "https://github.com/schm1d/awesomearchlinux/blob/main/utils/theme.sh"
    click U6 "https://github.com/schm1d/awesomearchlinux/blob/main/utils/vim.sh"
    click U7 "https://github.com/schm1d/awesomearchlinux/blob/main/utils/yay.sh"
    click U8 "https://github.com/schm1d/awesomearchlinux/blob/main/utils/zsh.sh"

    %% Styles
    classDef input fill:#fff0b3,stroke:#333,stroke-width:2px;
    classDef base fill:#ffe6e6,stroke:#333,stroke-width:2px;
    classDef hardening fill:#e6ffe6,stroke:#333,stroke-width:2px;
    classDef utility fill:#e6e6ff,stroke:#333,stroke-width:2px;
```
