Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
dbbace4
feat: force HTTPS for all package repos before any download
neohiro Oct 4, 2026
52b146e
fix: close three HTTPS-guard gaps found in self-review
neohiro Oct 4, 2026
9c9d1e0
fix: make the guard's exit-code contract explicit under `set -e`
neohiro Oct 4, 2026
eb23ffa
chore: save in-progress local changes
neohiro Oct 4, 2026
173eb98
feat: extend the transport guard from apt to every app store
neohiro Oct 4, 2026
fa151de
fix: collision-proof backup names, single family probe, actionable re…
neohiro Oct 4, 2026
06aa025
fix: guarantee a dropped SSH session is always recoverable
neohiro Oct 4, 2026
70bea25
fix: forward CLI args through the tmux wrap, and clean up test diagno…
neohiro Oct 4, 2026
c794f68
feat: add 1MB log limits with journald hardening, storage breakdown, …
neohiro Oct 6, 2026
879c22d
feat: add cleanup_openstageisland.sh with rollback support (--setting…
neohiro Oct 6, 2026
765894f
fix: self-improvement pass 1/2 - fix Docker filter, race conditions, …
neohiro Oct 6, 2026
3f32652
fix: self-improvement pass 2/2 - improve rollback safety, container h…
neohiro Oct 6, 2026
ef3a1ca
fix: self-improvement pass 1/2 - fix heredoc quoting, Python string e…
neohiro Oct 6, 2026
1357acd
test: add coverage for tmpfiles.d vacuum command, storage breakdown, …
neohiro Oct 6, 2026
e241293
test: add shellcheck disable comments for SC2016 in grep patterns
neohiro Oct 6, 2026
44194fc
Merge origin/main into fix/linux20 - rebased onto latest main
neohiro Oct 6, 2026
ff36e7b
fix: fix JOURNALD_DROPIN extraction and RuntimeMax* assertions
neohiro Oct 7, 2026
73dedde
merge: origin/main into feat/apt-https-repo-guard
neohiro Oct 9, 2026
ef725b5
fix: harden_attack_surface correctness and triage
neohiro Oct 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
879 changes: 764 additions & 115 deletions DeepClean.sh

Large diffs are not rendered by default.

348 changes: 333 additions & 15 deletions README.md

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,59 @@ multiple distribution families (Debian, RHEL/Fedora, SUSE, Arch). Always
review what will be applied, keep backups/restoration points, and test
on non-critical systems first.

### Package and app-store transport

Every package download, update, and upgrade is preceded by
`apt_https_guard` (see `lib/apt-https.sh`). The audit spans every app
store on the host, not just the distro package manager:

`apt`, `dnf`, `yum`, `zypper`, `pacman`, `apk`, `flatpak`, `snap`,
`docker`, `brew`, `pip`, `npm`, `cargo`, `gem`, `nix`, `fwupd`.

Detection is format-agnostic: any non-comment line carrying an `http://`
URL in a store's configuration, or a plaintext transport URL exported in
the environment, is reported. Signature verification catches *forged*
packages; only TLS prevents a *downgrade* to an older, genuinely-signed,
vulnerable build.

On apt the guard:

* installs `/etc/apt/apt.conf.d/99neohiro-force-https`, whose
`Acquire::http::AllowRedirect "false"` prevents an `https://` mirror
from silently downgrading a fetch to plaintext HTTP;
* rewrites `http://` repo URLs to `https://` in `sources.list`,
`sources.list.d/*.list`, and DEB822 `*.sources`;
* backs every file up to `/var/backups/neohiro-apt-https/` first and logs
it to `/var/log/linux-install-rollback.log`;
* applies each change by staging in the target's own directory and
`rename(2)`, so an interrupted run cannot leave a truncated repo file;
* runs a verification `apt-get update` and rolls the rewrite back
automatically if a mirror does not serve the same paths over HTTPS.

Other stores are reported rather than rewritten, because whether
`https://<same host><same path>` exists is not knowable offline and
silently breaking a working mirror is worse than the threat. Opt in with
`NEOHIRO_APT_HTTPS_REWRITE=1`.

Escape hatches and audit tooling:

```bash
sudo bash linuxinstall.sh --apt-https-audit # read-only, exit 1 if plaintext remains
sudo bash linuxinstall.sh --apt-https-off # restore backups, remove the drop-in
NEOHIRO_APT_HTTPS=0 # disable the guard for one run
```

The optional `NEOHIRO_APT_BLOCK_PORT80=1` adds `ufw deny out 80/tcp`.
It is off by default because a blanket outbound block also affects
unrelated plaintext protocols, and the guard declines to add it while
any plaintext endpoint is still configured.

Under `curl | sudo bash` the guard is loaded from `lib/apt-https.sh`
(fetched from the same base the script already trusts) rather than
duplicated inline, so there is one implementation to audit. If it cannot
be loaded the script says so and runs with the guard inactive — it never
reports success for a precaution that is not running.

---

Maintained by **[neohiro](https://github.com/neohiro)**.
Loading
Loading