Skip to content

crowdsec: own notification-slack plugin via C+ args, not a follow-up z - #38

Merged
phonkd merged 1 commit into
mainfrom
worktree-crowdsec-plugin-chown-fix
Jul 19, 2026
Merged

crowdsec: own notification-slack plugin via C+ args, not a follow-up z#38
phonkd merged 1 commit into
mainfrom
worktree-crowdsec-plugin-chown-fix

Conversation

@phonkd

@phonkd phonkd commented Jul 19, 2026

Copy link
Copy Markdown
Owner

The plugin-ownership tmpfiles rule copied the notification-slack binary root-owned (C+ with mode/uid/gid "-") and relied on a separate z line to chown it to crowdsec. But the module owns the parent /etc/crowdsec/plugins as crowdsec, so a root-owned leaf is a crowdsec-dir -> root-file "unsafe path transition". Modern systemd-tmpfiles aborts the entire run (exit 73) on that transition, so z never ran: the plugin stayed root-owned, the crowdsec LAPI crash-looped refusing to load a plugin it doesn't own, :8081 never bound, and crowdsec-firewall-bouncer failed with connection-refused / "bouncer stream halted".

Copy straight to crowdsec:crowdsec by putting owner/mode on the C+ line, so parent and leaf owners match — no transition, one atomic op.

The plugin-ownership tmpfiles rule copied the notification-slack binary
root-owned (C+ with mode/uid/gid "-") and relied on a separate z line to
chown it to crowdsec. But the module owns the parent /etc/crowdsec/plugins
as crowdsec, so a root-owned leaf is a crowdsec-dir -> root-file "unsafe
path transition". Modern systemd-tmpfiles aborts the entire run (exit 73)
on that transition, so z never ran: the plugin stayed root-owned, the
crowdsec LAPI crash-looped refusing to load a plugin it doesn't own, :8081
never bound, and crowdsec-firewall-bouncer failed with connection-refused /
"bouncer stream halted".

Copy straight to crowdsec:crowdsec by putting owner/mode on the C+ line, so
parent and leaf owners match — no transition, one atomic op.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 19, 2026 17:19
@phonkd
phonkd merged commit ce09d76 into main Jul 19, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts the CrowdSec NixOS module’s tmpfiles configuration so the notification-slack plugin binary is copied directly as crowdsec:crowdsec, avoiding a root-owned leaf under a crowdsec-owned directory that can cause modern systemd-tmpfiles to abort (and prevent the follow-up ownership fix from running). This aligns the module’s on-disk ownership expectations with CrowdSec’s plugin broker checks and prevents the LAPI crash-loop described in the PR.

Changes:

  • Replace the two-step C+ (copy) + z (chown/mode fix) tmpfiles approach with a single C+ entry that sets user, group, and mode during the copy.
  • Expand inline commentary documenting the systemd-tmpfiles “unsafe path transition” failure mode and its operational impact.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants