Skip to content

daemon: fail2ban bans no longer die on EROFS; TUI y copies through tmux/native/OSC 52 - #287

Merged
ralyodio merged 1 commit into
masterfrom
fix/tui-ban-perms-and-yank
Oct 7, 2026
Merged

ralyodio merged 1 commit into
masterfrom
fix/tui-ban-perms-and-yank

Conversation

@ralyodio

@ralyodio ralyodio commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Anthony: "threatcrush ban broken again with permissions error. and y (yank) for copy error doesn't work — in tui".

Ban: root cause

Reproduced on vienna (where the TUI was running): threatcrush block → EROFS: read-only file system, open '/etc/fail2ban/filter.d/threatcrush.conf' (backend: fail2ban). The daemon runs as root with CAP_NET_ADMIN; the problem is ProtectSystem=full, which makes /etc read-only, and the fail2ban backend writes its jail + filter there before the first ban. So on any fail2ban box every ban failed, including auto-defence. dev2 (nftables) was unaffected; TUI ban there works.

  • unit: ReadWritePaths=… -/etc/fail2ban (- = skip if absent, no 226/NAMESPACE)
  • explainBlockFailure: EROFS → names the path + install-service && systemctl restart

y / copy

Was OSC 52 only. iTerm2 drops it unless "Applications in terminal may access clipboard" is on; tmux drops the DCS-wrapped form without allow-passthrough. New tui/clipboard.ts: native helper (pbcopy locally, wl-copy, xclip, xsel) → tmux load-buffer -w → raw + wrapped OSC 52 → always ~/.threatcrush/last-copy.txt; status bar says which routes took.

Tests

  • service.test: rendered unit contains -/etc/fail2ban, every path absolute
  • block-failure.test: EROFS message
  • clipboard.test: ssh / tmux / old tmux / display / pbcopy-over-ssh
  • full CLI suite 522/522, tsc clean, build ok; live: TUI y on dev2 inside tmux → tmux buffer + file had the error text

🤖 Generated with Claude Code

…ux/native/OSC 52

The "permissions error" on ban from the TUI (vienna, 2026-10-07) was the
systemd sandbox, not privilege: the root daemon's fail2ban backend writes
/etc/fail2ban/{jail,filter}.d/threatcrush.conf before its first ban, and
ProtectSystem=full mounts /etc read-only, so every ban (manual and automatic)
failed with EROFS. The unit now lists -/etc/fail2ban in ReadWritePaths (the
'-' keeps boxes without fail2ban starting), and explainBlockFailure names the
read-only path and the reinstall instead of passing raw EROFS through.

`y` wrote only an OSC 52 sequence, which iTerm2 drops unless clipboard access
is enabled and tmux drops (DCS-wrapped) without allow-passthrough. Copy now
tries a native helper when a display exists, tmux load-buffer -w, raw and
wrapped OSC 52, and always saves ~/.threatcrush/last-copy.txt; the status bar
says which routes took.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

ThreatCrush Security Scan

18 finding(s)

HIGH/CRITICAL: 1 | MEDIUM: 9 | LOW: 8

Severity Rule Location
HIGH secret-aws-access-key prd/0003-detect-hardcoded-secrets-before-they-are-committed-or-served.md:126
MEDIUM sql-string-concatenation .github/workflows/migrate-dev2.yml:128
MEDIUM js-uninitialized-buffer apps/cli/src/core/log-tail.ts:58
MEDIUM js-open-redirect apps/web/src/app/auth/login/page.tsx:67
MEDIUM js-unescaped-html-sink apps/web/src/app/hire/page.tsx:104
MEDIUM js-unescaped-html-sink apps/web/src/app/hire/page.tsx:108
MEDIUM js-open-redirect apps/web/src/app/invite/[token]/invite-client.tsx:55
MEDIUM js-open-redirect apps/web/src/components/funding/FundingClient.tsx:97
MEDIUM js-unescaped-html-sink apps/web/src/components/GuideReader.tsx:265
MEDIUM js-uninitialized-buffer packages/scan/src/node-rules.ts:456
LOW secret-generic-credential apps/web/src/app/api/auth/refresh/route.ts:17
LOW secret-generic-credential apps/web/src/app/api/auth/reset-password/route.ts:26
LOW secret-generic-credential apps/web/src/app/api/auth/reset-password/route.ts:27
LOW secret-generic-credential PRD.md:269
LOW tls-verification-disabled prd/0004-find-dangerous-code-patterns-without-pretending-to-be-a-compiler.md:121
LOW tls-verification-disabled prd/0004-find-dangerous-code-patterns-without-pretending-to-be-a-compiler.md:122
LOW sh-remote-script-execution scripts/smoke-test.sh:72
LOW secret-aws-access-key scripts/smoke-test.sh:150

Snippets are redacted; ThreatCrush never prints matched credential material.

@ralyodio
ralyodio merged commit dbd3ebe into master Oct 7, 2026
12 checks passed
ralyodio added a commit that referenced this pull request Oct 7, 2026
`fail2ban-client reload threatcrush` only reloads a jail the server already
runs; for the jail threatcrushd has just written it answers NOK, so with the
EROFS fixed (#287) the first ban on a fail2ban box still failed. Fall back to
a plain `reload`, which starts new jails and keeps existing bans.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant