Deployment guide

CrowdSec

Overview

CrowdSec is an open-source (MIT) collaborative intrusion detection and prevention system. Its Security Engine parses your local logs (the systemd journal and SSH/auth activity), runs behavioural scenarios to spot aggressive behaviour such as SSH brute-force, and ships decisions to bouncers that enforce bans.

This SecureAnyCloud image installs CrowdSec from the official CrowdSec package repository and enables the crowdsec.service agent with its Local API (LAPI). It parses the journal and detects SSH attacks out of the box, and an iptables firewall bouncer actively bans aggressive IPs.

What you get:

  • CrowdSec Security Engine (crowdsec.service) and the cscli management CLI
  • The Local API (LAPI) bound to 127.0.0.1:8080 with a /health liveness endpoint
  • The crowdsecurity/linux and crowdsecurity/sshd collections, which provide journal parsing and SSH brute-force scenarios
  • The crowdsec-firewall-bouncer-iptables bouncer that enforces bans
  • A per-VM Local API machine credential rotated on first boot, so there is no shared default identity
  • 24/7 SecureAnyCloud support

This is a security daemon, not a web application. The Local API listens on 127.0.0.1:8080 only and is not opened to the internet. The engine works entirely from this VM's local logs, and you run cscli on the VM.

Prerequisites

You need an active Azure subscription, an SSH key pair, and a VNet with a subnet in the target region.

Standard_B2s (2 vCPU / 4 GiB RAM) is a good starting point.

In the network security group (NSG), allow inbound 22/tcp from your management network. No inbound application ports are needed, because the Local API is loopback-only.

Step 1 - Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for CrowdSec by SecureAnyCloud, and select Create.

On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22) only. Then select Review + create and Create.

Step 2 - Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:crowdsec-ubuntu-24-04:default:latest
az vm create \
  --resource-group <your-rg> \
  --name crowdsec \
  --image sac1647283583153:crowdsec-ubuntu-24-04:default:latest \
  --size Standard_B2s \
  --admin-username azureuser \
  --ssh-key-values ~/.ssh/id_ed25519.pub \
  --vnet-name <your-vnet> --subnet <your-subnet> \
  --public-ip-sku Standard

Step 3 - Connect to your VM

ssh azureuser@<vm-public-ip>

Step 4 - Confirm CrowdSec is installed and running

crowdsec -version | head -1 systemctl is-active crowdsec

The output shows a CrowdSec version line and active.

Step 5 - Check the Security Engine and Local API

Run cscli lapi status to confirm that the agent can authenticate to the Local API. The LAPI also exposes a plain HTTP /health endpoint on loopback.

sudo cscli lapi status curl -s http://127.0.0.1:8080/health

cscli lapi status reports that you can successfully interact with the Local API. /health returns a small JSON status document.

Step 6 - Review the loaded collections and scenarios

List the loaded collections. The image ships with the crowdsecurity/linux and crowdsecurity/sshd collections, which bring in the SSH brute-force and log-parsing scenarios.

sudo cscli collections list
sudo cscli scenarios list

The output shows crowdsecurity/linux and crowdsecurity/sshd enabled, along with the crowdsecurity/ssh-bf family of scenarios.

Step 7 - Confirm the engine is parsing and watch for detections

cscli metrics shows the acquisition, parser and Local API activity, which proves that the engine is reading your logs. cscli decisions list and cscli alerts list show any bans and alerts the engine has raised. A freshly deployed VM starts with a clean history.

sudo cscli metrics
sudo cscli decisions list
sudo cscli alerts list

Real traffic, such as repeated failed SSH logins from an attacker, triggers the SSH scenarios. The engine raises an alert and the firewall bouncer adds a ban decision, which appears in cscli decisions list.

Step 8 - Confirm the firewall bouncer is registered

The iptables firewall bouncer enforces the engine's ban decisions at the network layer. List the registered bouncers:

sudo cscli bouncers list

The firewall bouncer appears as registered and validated.

Security model

The Local API binds 127.0.0.1:8080 only and is never exposed publicly. Keep your NSG limited to 22/tcp from trusted networks.

CrowdSec manages its machine and bouncer credentials automatically. The SecureAnyCloud image rotates the per-VM Local API machine credential on first boot, so every VM has its own identity.

To extend protection, install additional collections from the CrowdSec Hub with sudo cscli collections install <name>, and add bouncers for your web server, firewall or cloud edge.

Whitelist your admin network to avoid lockouts

The firewall bouncer enforces SSH brute-force bans, so repeated connections from a single source can trigger a ban. The image ships with loopback and the RFC1918 private ranges already whitelisted, and with an editable whitelist at /etc/crowdsec/parsers/s02-enrich/sac-admin-whitelist.yaml.

Add your admin public IP or CIDR under ip: / cidr: in that file, then reload the engine with sudo systemctl reload crowdsec.

If you lock yourself out, use the Azure Portal serial console (or run-command) to clear active bans with sudo cscli decisions delete --all.

Support

SecureAnyCloud maintains this image and provides 24/7 support for it. CrowdSec is a trademark of CrowdSec SAS. This image is not affiliated with or endorsed by CrowdSec SAS. See the SecureAnyCloud guides for more.

Deploy on Azure

Launch CrowdSec on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.

View this image

Need Help?

Our support team is available 24/7.

sales@secureanycloud.com

Deploy on Azure