Hey there
i got a problem / beeing confused with using crowdsec on docker-container, specificly on mcvlans.
Before i start:
I have a NAS and a Rasp-Pi with docker-compose and portainer. I’m using nginx and like 20 services each in different stacks with addressed IPs. This is perfect to me, because im running uptime kuma with gotify by just ping an IP to see if its running.
The issue im facing now is, that i dont use “lamb-stacks” like one machine with 3 services. My docker-compose file just adds 3 Services together but every single service got an own container and addressed ip. The problem now is that im running out of IPs soon but i can create another subnet for that.
Now my question:
How can i secure my containers and host systems “smart” ?
For example Nextcloud looks like that (i shrinked everything for sure)
services:
db:
image: postgres
networks:
nextcloud:
ipv4_address: 192.168.178.34
redis:
image: redis
networks:
nextcloud:
ipv4_address: 192.168.178.36
nextcloud:
image: nextcloud
networks:
nextcloud:
ipv4_address: 192.168.178.33
networks:
nextcloud:
name: nasmcvlan
external: true
As i saw to secure nextcloud properly, you need the crowdsec agent and the nextcloud collection but also ssh and apache. Because of that its hard to run just 1 agent and just install the bouncers on all containers.
I understand crowdsec and how its working and managed to create a bouncer, api key the bouncer is running with shared by the agent and also connected the agent to the console.
Long story short. I have no clue how to setup crowdsec properly and what would be “overkill”.
Normaly i want to secure my host (raspy and nas), and every container-host with different services on it.
- Crowdsec needs to be on each container
1.1. Because it needs permission to see system logs like ssh or apache exept im mounting every damn logfile of every service somewhere central
1.3 How to make it persistent if i restart the container? - Bouncer needs to be on each container
2.1 Because i want to block on that
2.2 It it possible with a new ip / container or networkmode: host? can the bouncer block properly then?
I hope someone got an idea for me to get for example the agents running on each container beeing persistent.
Best wishes and sorry for my bad english:)