Setup SSH tarpit with prometheus integration.

This commit is contained in:
♥ Minnie ♥ 2024-06-06 20:45:08 +08:00
parent 6c290fa729
commit 45d22ff08c
Signed by: jasmine
GPG key ID: 8563E358D4E8040E

View file

@ -0,0 +1,30 @@
{ config, ... }:
{
services.endlessh-go = {
enable = true;
port = 22; # SSH port
prometheus = {
enable = true;
listenAddress = "127.0.0.1";
port = 2112; # Prometheus metrics port
};
extraOptions = [
"-interval_ms=1000"
"-logtostderr"
"-v=1"
"-geoip_supplier=ip-api"
];
openFirewall = true;
};
services.prometheus.scrapeConfigs = [
{
job_name = "endlessh";
static_configs = [{
targets = [ "127.0.0.1:${toString config.services.endlessh-go.prometheus.port}" ];
}];
}
];
}