Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crowdsec - Variable "mode" not replaced during installation #3622

Closed
3 tasks done
Scorpoon opened this issue Oct 13, 2023 · 9 comments
Closed
3 tasks done

Crowdsec - Variable "mode" not replaced during installation #3622

Scorpoon opened this issue Oct 13, 2023 · 9 comments
Labels
upstream Third party issue

Comments

@Scorpoon
Copy link

Scorpoon commented Oct 13, 2023

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug
During the installation of os-crowdsec (v1.0.7) the variable ${BACKEND} for mode should be replaced in "/usr/loca/etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml" but it isn't.
The bouncer fails to start because of fatal error "firewall '${BACKEND}' is not supported" and another warning "unexpected ${BACKEND} mode".
My OpnSense instance is pretty fresh so i can't revert to check if it worked earlier.

To Reproduce
Steps to reproduce the behavior:

  1. Install the crowdsec plugin
  2. Check if variable was replaced

Expected behavior
The variable should be replaced with "pf".
I guess, i'm relative new to Linux :D

Relevant log files
level=warning msg="unexpected ${BACKEND} mode"
time="13-10-2023 16:07:13" level=info msg="Starting crowdsec-firewall-bouncer v0.0.28-freebsd-af6e7e2"
time="13-10-2023 16:07:13" level=info msg="backend type : ${BACKEND}"
time="13-10-2023 16:07:13" level=fatal msg="firewall '${BACKEND}' is not supported"

After changing mode to pf:
level=info msg="Starting crowdsec-firewall-bouncer v0.0.28-freebsd-af6e7e2"
time="13-10-2023 16:23:41" level=info msg="backend type : pf"
time="13-10-2023 16:23:41" level=info msg="pf table clean-up: /sbin/pfctl -t crowdsec_blacklists -T flush"
time="13-10-2023 16:23:41" level=info msg="Checking pf table: crowdsec_blacklists"
time="13-10-2023 16:23:41" level=info msg="pf initiated for ipv4"
time="13-10-2023 16:23:41" level=info msg="pf table clean-up: /sbin/pfctl -t crowdsec6_blacklists -T flush"
time="13-10-2023 16:23:41" level=info msg="Checking pf table: crowdsec6_blacklists"
time="13-10-2023 16:23:41" level=info msg="pf initiated for ipv6"

Environment

OPNsense 23.7.6-amd64
FreeBSD 13.2-RELEASE-p3
OpenSSL 1.1.1w 11 Sep 23
os-crowdsec 1.0.7

Installed by plugin:
crowdsec 1.5.4
crowdsec-firewall-bouncer 0.0.28

@rmaffeo
Copy link

rmaffeo commented Oct 15, 2023

This also appears to affect ${API_KEY}.

@LaurenceJJones
Copy link

@mmetc

@eeeeb
Copy link

eeeeb commented Oct 16, 2023

I can confirm, having the same issue on a fresh install of OPNSense 23.7.6

/var/log/crowdsec/crowdsec-firewall-bouncer.log:
time="16-10-2023 16:22:11" level=warning msg="unexpected ${BACKEND} mode"
time="16-10-2023 16:22:11" level=info msg="Starting crowdsec-firewall-bouncer v0.0.28-freebsd-af6e7e2"
time="16-10-2023 16:22:11" level=info msg="backend type : ${BACKEND}"
time="16-10-2023 16:22:11" level=fatal msg="firewall '${BACKEND}' is not supported"
time="16-10-2023 16:24:43" level=warning msg="unexpected ${BACKEND} mode"
time="16-10-2023 16:24:43" level=info msg="Starting crowdsec-firewall-bouncer v0.0.28-freebsd-af6e7e2"
time="16-10-2023 16:24:43" level=info msg="backend type : ${BACKEND}"
time="16-10-2023 16:24:43" level=fatal msg="firewall '${BACKEND}' is not supported"

@nzkiwi68
Copy link

Same issued here - fresh install on 23.7.6

/var/log/crowdsec/crowdsec-firewall-bouncer.log:

time="17-10-2023 16:07:54" level=warning msg="unexpected ${BACKEND} mode"
time="17-10-2023 16:07:54" level=info msg="Starting crowdsec-firewall-bouncer v0.0.28-freebsd-af6e7e2"

@LaurenceJJones
Copy link

Hey 👋🏻

We have found the issue, the PR was missing a patch file.

To simply fix it you can edit the bouncer configuration and change the ${BACKEND} to pf

Normally you find this file under /usr/local/etc/crowdsec/bouncers/

@mmetc
Copy link
Contributor

mmetc commented Oct 17, 2023

Hi, I am the package maintainer.

The fix is correct:

  • replace "${BACKEND}" with "pf"
  • run "service crowdsec_firewall start"

A patch file was missing from the packaging, a new version has been submitted to freebsd. Existing installations are not concerned.
Again, sorry for the mistake.

@fichtner
Copy link
Member

@mmetc can you point me to the upstream patch, perhaps I can hotfix ours tomorrow to avoid 1-2 weeks roundtrip time

@fichtner fichtner added the upstream Third party issue label Oct 17, 2023
@mmetc
Copy link
Contributor

mmetc commented Oct 17, 2023

@fichtner
Copy link
Member

opnsense/ports@2718996e5d

thanks, I will try to hotfix it tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Third party issue
Development

No branches or pull requests

7 participants