Hi. I need your help please.
My nginx-proxy-manager+crowdsec (Docker) ban only local connections (when i block manuel a ip like: 192.168.178.20). Crowdsec ban no ip when it comes from internet.
Here a login test with my smartphone and a lot of wrong passwords:
time="2024-02-04T08:45:47Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:45:47 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 54.363734ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:45:47Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:45:47 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 59.183465ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:45:47Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:45:47 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 60.202711ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:45:49Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:45:49 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 32.993893ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:45:58Z" level=info msg="127.0.0.1 - [Sun, 04 Feb 2024 08:45:58 UTC] \"GET /v1/heartbeat HTTP/1.1 200 2.098718ms \"crowdsec/v1.6.0-4b8e6cd7\" \""
time="2024-02-04T08:46:06Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:06 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 52.555757ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:06Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:06 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 39.544257ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:08Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:08 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 56.582049ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:16Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:16 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 27.155027ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:18Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:18 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 42.318818ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:21Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:21 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 49.456838ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:22Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:22 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 52.267765ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:24Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:24 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 47.276888ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:26Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:26 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 53.288275ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:28Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:28 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 55.292855ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:30Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:30 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 55.332625ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:31Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:31 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 54.059039ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:33Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:33 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 21.539795ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:36Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:36 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 51.704535ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:34Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:34 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 51.834066ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:37Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:37 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 55.739795ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:38Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:38 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 54.74405ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:40Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:40 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 22.253172ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:41Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:41 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 51.762581ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:43Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:43 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 51.709945ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:44Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:44 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 53.947656ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:46Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:46 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 47.627872ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:47Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:47 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 53.47808ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:48Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:48 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 52.407048ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:49Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:49 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 54.610498ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:51Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:51 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 52.962853ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:52Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:52 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 44.682386ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:53Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:53 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 54.819492ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:55Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:55 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 56.011935ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:54Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:54 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 54.243677ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:57Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:57 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 28.864571ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:58Z" level=info msg="127.0.0.1 - [Sun, 04 Feb 2024 08:46:58 UTC] \"GET /v1/heartbeat HTTP/1.1 200 2.631737ms \"crowdsec/v1.6.0-4b8e6cd7\" \""
time="2024-02-04T08:46:58Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:58 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 52.286686ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:46:59Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:46:59 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 53.742004ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:47:00Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:47:00 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 24.334815ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:47:16Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:47:16 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 51.114981ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:47:15Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:47:15 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 51.090949ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:47:12Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:47:12 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 53.7912ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:47:13Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:47:13 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 50.806746ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:47:10Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:47:10 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 53.14591ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:47:08Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:47:08 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 41.594396ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:47:09Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:47:09 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 47.459661ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:47:07Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:47:07 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 37.902577ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:47:04Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:47:04 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 35.343402ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:47:06Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:47:06 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 22.393502ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:47:03Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:47:03 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 22.540596ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
time="2024-02-04T08:47:02Z" level=info msg="172.10.0.4 - [Sun, 04 Feb 2024 08:47:02 UTC] \"GET /v1/decisions?ip=176.6.181.160 HTTP/1.1 200 22.586777ms \"crowdsec-openresty-bouncer/v1.0.1\" \""
Here my docker-compose.yml:
version: "3.8"
services:
nginx-proxy-manager:
image: 'lepresidente/nginx-proxy-manager:latest'
restart: always
ports:
- "8080:8080"
- "8181:8181"
- "4443:4443"
environment:
TZ: "Europe/Berlin"
DISABLE_IPV6: "1"
volumes:
- "/npm/data/nginx-proxy-manager:/config:rw"
- "/npm/data/nginx-proxy-manager/crowdsec/templates:/templates:ro"
networks:
crowdsec_proxy:
ipv4_address: 172.10.0.4
crowdsec:
image: "crowdsecurity/crowdsec:latest"
container_name: crowdsec
expose:
- 8080
environment:
PGID: "1000"
volumes:
- "/npm/crowdsec/data:/var/lib/crowdsec/data"
- "/npm/crowdsec/config:/etc/crowdsec"
- "/var/log/auth.log:/var/log/auth.log:ro"
- "/data/logs:/var/log/nginx:ro"
restart: unless-stopped
networks:
crowdsec_proxy:
ipv4_address: 172.10.0.6
networks:
crowdsec_proxy:
ipam:
driver: default
config:
- subnet: 172.10.0.0/24
Here my config.yaml:
common:
daemonize: false
log_media: stdout
log_level: info
log_dir: /var/log/
config_paths:
config_dir: /etc/crowdsec/
data_dir: /var/lib/crowdsec/data/
simulation_path: /etc/crowdsec/simulation.yaml
hub_dir: /etc/crowdsec/hub/
index_path: /etc/crowdsec/hub/.index.json
notification_dir: /etc/crowdsec/notifications/
plugin_dir: /usr/local/lib/crowdsec/plugins/
crowdsec_service:
acquisition_path: /etc/crowdsec/acquis.yaml
acquisition_dir: /etc/crowdsec/acquis.d
parser_routines: 1
plugin_config:
user: nobody
group: nobody
cscli:
output: human
db_config:
log_level: info
type: sqlite
db_path: /var/lib/crowdsec/data/crowdsec.db
flush:
max_items: 5000
max_age: 7d
use_wal: true
api:
client:
insecure_skip_verify: false
credentials_path: /etc/crowdsec/local_api_credentials.yaml
server:
log_level: info
listen_uri: 0.0.0.0:8080
profiles_path: /etc/crowdsec/profiles.yaml
trusted_ips: # IP ranges, or IPs which can have admin API access
- 127.0.0.1
- ::1
online_client: # Central API credentials (to push signals and receive bad IPs)
credentials_path: /etc/crowdsec//online_api_credentials.yaml
enable: true
prometheus:
enabled: true
level: full
listen_addr: 0.0.0.0
listen_port: 6060
Here my acquis.yml:
filenames:
- /var/log/nginx/*.log
- ./tests/nginx/nginx.log
#this is not a syslog log, indicate which kind of logs it is
labels:
type: nginx
---
filenames:
- /var/log/auth.log
- /var/log/syslog
labels:
type: syslog
---
filename: /var/log/apache2/*.log
labels:
type: apache2
Here my user.yml:
common:
daemonize: false
log_media: stdout
log_level: info
log_dir: /var/log/
config_paths:
config_dir: /etc/crowdsec/
data_dir: /var/lib/crowdsec/data
#simulation_path: /etc/crowdsec/config/simulation.yaml
#hub_dir: /etc/crowdsec/hub/
#index_path: ./config/hub/.index.json
crowdsec_service:
#acquisition_path: ./config/acquis.yaml
parser_routines: 1
cscli:
output: human
db_config:
type: sqlite
db_path: /var/lib/crowdsec/data/crowdsec.db
user: crowdsec
#log_level: info
password: crowdsec
db_name: crowdsec
host: "127.0.0.1"
port: 3306
api:
client:
insecure_skip_verify: false # default true
credentials_path: /etc/crowdsec/local_api_credentials.yaml
server:
#log_level: info
listen_uri: 127.0.0.1:8080
profiles_path: /etc/crowdsec/profiles.yaml
online_client: # Central API
credentials_path: /etc/crowdsec/online_api_credentials.yaml
prometheus:
enabled: true
level: full
Here is the cscli bouncers list:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Name IP Address Valid Last API pull Type Version Auth Type
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
nginx-proxy 172.10.0.4 โ๏ธ 2024-02-04T10:48:51Z crowdsec-openresty-bouncer v1.0.1 api-key
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ