{"id":30680491,"url":"https://github.com/rhjddjdbc/arch-hardened","last_synced_at":"2026-04-18T19:31:37.245Z","repository":{"id":301113103,"uuid":"1008181091","full_name":"rhjddjdbc/arch-hardened","owner":"rhjddjdbc","description":"arch-hardening script","archived":false,"fork":false,"pushed_at":"2026-01-21T09:47:08.000Z","size":157,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-16T12:41:26.412Z","etag":null,"topics":["arch","hardened","hardening"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhjddjdbc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-25T06:43:29.000Z","updated_at":"2026-01-21T09:48:32.000Z","dependencies_parsed_at":"2025-06-25T08:26:32.908Z","dependency_job_id":"98fe6c98-a5b2-474d-9805-d95043a7f193","html_url":"https://github.com/rhjddjdbc/arch-hardened","commit_stats":null,"previous_names":["rhjddjdbc/arch-hardend","rhjddjdbc/arch-hardened"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rhjddjdbc/arch-hardened","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhjddjdbc%2Farch-hardened","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhjddjdbc%2Farch-hardened/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhjddjdbc%2Farch-hardened/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhjddjdbc%2Farch-hardened/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhjddjdbc","download_url":"https://codeload.github.com/rhjddjdbc/arch-hardened/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhjddjdbc%2Farch-hardened/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31982492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T17:30:12.329Z","status":"ssl_error","status_checked_at":"2026-04-18T17:29:59.069Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arch","hardened","hardening"],"created_at":"2025-09-01T16:04:42.668Z","updated_at":"2026-04-18T19:31:37.204Z","avatar_url":"https://github.com/rhjddjdbc.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Arch Linux Hardening Script\n\nAn **interactive, security-focused hardening script for Arch Linux**.\nIt applies modern, pragmatic system-hardening measures while allowing you to **selectively enable or disable features** during execution.\n\n\u003e **Do NOT run this script as root.**\n\u003e Run it as a normal user with `sudo` privileges.\n\n---\n\n## Key Principles\n\n* Secure-by-default, but **interactive**\n* Minimal magic, mostly transparent configuration\n* Focus on **kernel, bootloader, syscall, filesystem, and network hardening**\n* Uses **native Arch tooling** where possible\n* Designed to be **auditable and reversible**\n\n---\n\n## Supported Systems\n\n* Arch Linux / Arch-based distributions\n* GRUB bootloader\n* systemd\n* `sudo` (optionally replaceable with `doas`)\n\n---\n\n## What This Script Does\n\n### Always Enforced (No Prompt)\n\nThese are applied automatically once the script runs:\n\n* Refuses to run as `root`\n* Ensures `sudo` is installed\n* Installs `yay` (AUR helper) if missing\n* Applies **secure GRUB kernel parameters**:\n\n  * `slab_nomerge`\n  * `page_alloc.shuffle=1`\n  * `init_on_alloc=1`\n  * `init_on_free=1`\n  * `lockdown=confidentiality`\n  * `random.trust_cpu=off`\n  * `quiet loglevel=3`\n* Secure default `umask 0077`\n* Blacklists **rare / high-risk kernel modules**:\n\n  * Legacy filesystems (hfs, udf, minix, etc.)\n  * Rare networking protocols (dccp, sctp, rds, tipc, ax25, …)\n  * FireWire stack\n* Reloads `sshd` if active\n\n---\n\n## Interactive Features (Y/n Prompts)\n\nAll of the following can be enabled or skipped interactively:\n\n### Kernel \u0026 Boot Security\n\n* Install **`linux-hardened`**\n* Enable **AppArmor** and load profiles from `apparmor.d-git`\n* Add AppArmor kernel boot parameters automatically\n\n### Sysctl Hardening\n\nApplies strong baseline hardening via `/etc/sysctl.d/`:\n\n* Kernel info leak protection\n* ASLR enforcement\n* Core dump suppression\n* BPF hardening\n* Namespace restrictions\n* FIFO / symlink / hardlink protection\n* Network hardening (rp_filter, martian logging, no redirects)\n* Disable kexec\n* Disable SysRq\n* Disable module loading after boot (`kernel.modules_disabled=1`)\n* Optional **IPv6 privacy extensions** (temporary addresses)\n\n### USB \u0026 Device Security\n\n* Install and enable **USBGuard**\n\n  * Blocks unknown USB devices by default\n  * Requires explicit allow rules (recommended)\n\n### Firewall \u0026 Networking\n\n* Install and configure **nftables**\n\n  * Default DROP policy on INPUT and FORWARD\n  * Allows loopback, established connections, ICMP/ICMPv6\n* Optional switch to **iptables-nft** compatibility layer\n\n### Sandboxing \u0026 Isolation\n\n* Install and enable **Firejail**\n\n  * Automatically runs `firecfg` to wrap supported apps\n\n### Integrity \u0026 Malware Detection\n\n* **AIDE** (File Integrity Monitoring)\n\n  * Database initialization\n  * Daily cron-based integrity check\n* **ClamAV** (optional)\n\n  * Daily recursive scan via cron\n\n### Privacy \u0026 Ads\n\n* **hBlock**\n\n  * Hosts-file based ad / tracker / malware domain blocking\n\n### Privilege Management\n\n* Optional replacement of `sudo` with **`doas`**\n\n  * Includes safety checks before removing sudo\n  * Prevents lockout\n\n### Packaging \u0026 Apps\n\n* Optional **Flatpak** installation\n* Adds **Flathub** repository if missing\n\n### Anonymity (Optional)\n\n* Install **torctl**\n\n  * System-wide Tor routing (effective after reboot)\n\n---\n\n## Usage\n\n```bash\ngit clone https://github.com/yourusername/arch-hardening.git\ncd arch-hardening\nchmod +x arch-hardening.sh\n./arch-hardening.sh\n```\n\nFollow the interactive prompts.\nPress **Enter** to accept the recommended defaults.\n\n---\n\n## Reboot Required\n\nMany changes (kernel, GRUB, AppArmor, sysctl, USBGuard) require a **reboot**.\nThe script will ask before rebooting.\n\n---\n\n## Security Notes \u0026 Warnings\n\n* `kernel.modules_disabled=1` **prevents loading kernel modules after boot**\n\n  * Make sure all required drivers are loaded early\n* USBGuard will block **all unknown USB devices**\n\n  * You must explicitly allow keyboards, mice, webcams, etc.\n* Replacing `sudo` with `doas` is safe **only if tested**\n* Firewall rules are intentionally minimal — expand as needed\n\n---\n\n## License\n\nAGPL-3.0\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhjddjdbc%2Farch-hardened","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhjddjdbc%2Farch-hardened","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhjddjdbc%2Farch-hardened/lists"}