OLD
Secure a Server
Install Container
Configure Container
Firewall Bouncer
apt install crowdsec-firewall-bouncer-iptables -y cscli bouncer add firewall #copy the API keyrm /etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yaml nano /etc/crowdsec/bouncers/crowdsec-firewall-bouncer.yamlmode: nftables update_frequency: 300s log_mode: file log_dir: /var/log/ log_level: info log_compression: true log_max_size: 100 log_max_backups: 3 log_max_age: 30 api_url: http://127.0.0.1:8080/ api_key: $APIKeyFromStep1 insecure_skip_verify: false disable_ipv6: false deny_action: DROP deny_log: false supported_decisions_types: - ban #to change log prefix #deny_log_prefix: "crowdsec: " #to change the blacklists name blacklists_ipv4: crowdsec-blacklists blacklists_ipv6: crowdsec6-blacklists #type of ipset to use ipset_type: nethash #if present, insert rule in those chains iptables_chains: - INPUT # - FORWARD # - DOCKER-USER ## nftables nftables: ipv4: enabled: true set-only: false table: crowdsec chain: crowdsec-chain priority: -10 ipv6: enabled: true set-only: false table: crowdsec6 chain: crowdsec6-chain priority: -10 nftables_hooks: - input - forward # packet filter pf: # an empty string disables the anchor anchor_name: "" prometheus: enabled: false listen_addr: 127.0.0.1 listen_port: 60601systemctl restart crowdsec-firewall-bouncer.service systemctl restart crowdsec nft list tablestable ip nat table ip filter table ip6 filter table ip crowdsec table ip6 crowdsec6
Secure a Domain
Cloudflare Bouncer
Generate an API key for Cloudflare

You can limit the API key to certain domains here but you can also do it in the Crowdsec config file
Gather your Account and Zone IDs
Install the Crowdsec module and bouncer
Allow CURL or remote access to Crowdsec Engine
Last updated