mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 01:44:40 +02:00
service/sshd: add loki alert rule
This commit is contained in:
parent
bc8db6f2e9
commit
25a5af1d24
2 changed files with 8 additions and 1 deletions
|
@ -141,7 +141,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
my.services.loki.rules = {
|
my.services.loki.rules = {
|
||||||
HighLogRate = {
|
loki_highLogRate = {
|
||||||
condition = ''sum by (host) (rate({unit="loki.service"}[1m])) > 60'';
|
condition = ''sum by (host) (rate({unit="loki.service"}[1m])) > 60'';
|
||||||
description = "Loki has a high logging rate";
|
description = "Loki has a high logging rate";
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,5 +25,12 @@ in
|
||||||
# by setting an hashed password in the `users.users.felix` block as `initialHashedPassword`.
|
# by setting an hashed password in the `users.users.felix` block as `initialHashedPassword`.
|
||||||
# additionally needed by deploy-rs
|
# additionally needed by deploy-rs
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
||||||
|
my.services.loki.rules = {
|
||||||
|
sshd_closed = {
|
||||||
|
condition = ''count_over_time({unit="sshd.service"} |~ "Connection closed by authenticating user" [15m]) > 15'';
|
||||||
|
description = "More then 15 users have tried loggin in without success";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue