Compare commits
6 commits
16c36c410a
...
f927dc50ae
Author | SHA1 | Date | |
---|---|---|---|
|
f927dc50ae | ||
|
c0e71abd53 | ||
|
08ff591117 | ||
|
9f5b6014ef | ||
|
e11b6f810b | ||
|
e1989a6009 |
configuration/services
|
@ -16,7 +16,7 @@ let
|
||||||
|
|
||||||
registration = matrixLib.writeRegistrationScript {
|
registration = matrixLib.writeRegistrationScript {
|
||||||
id = "matrix-hookshot";
|
id = "matrix-hookshot";
|
||||||
url = "${address}:${toString port}";
|
url = "http://${address}:${toString port}";
|
||||||
sender_localpart = "hookshot";
|
sender_localpart = "hookshot";
|
||||||
|
|
||||||
namespaces = {
|
namespaces = {
|
||||||
|
@ -91,6 +91,8 @@ in
|
||||||
bindAddress = "127.0.0.1";
|
bindAddress = "127.0.0.1";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bot.displayname = "Hookshot";
|
||||||
|
|
||||||
generic = {
|
generic = {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
outbound = false;
|
outbound = false;
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
{ config, lib, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
security.crowdsec = {
|
security.crowdsec = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -50,4 +55,36 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Add whitelists for matrix
|
||||||
|
systemd.tmpfiles.settings."10-matrix" =
|
||||||
|
let
|
||||||
|
stateDir = config.security.crowdsec.stateDirectory;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
"${stateDir}/config/postoverflows".d = {
|
||||||
|
user = "crowdsec";
|
||||||
|
group = "crowdsec";
|
||||||
|
mode = "0700";
|
||||||
|
};
|
||||||
|
|
||||||
|
"${stateDir}/config/postoverflows/s01-whitelist".d = {
|
||||||
|
user = "crowdsec";
|
||||||
|
group = "crowdsec";
|
||||||
|
mode = "0700";
|
||||||
|
};
|
||||||
|
|
||||||
|
"${stateDir}/config/postoverflows/s01-whitelist/matrix-whitelist.yaml"."L+".argument =
|
||||||
|
((pkgs.formats.yaml { }).generate "crowdsec-matrix-whitelist.yaml" {
|
||||||
|
name = "tetsumaki/matrix";
|
||||||
|
description = "custom matrix whitelist";
|
||||||
|
whitelist = {
|
||||||
|
reason = "whitelist false positive for matrix";
|
||||||
|
expression = [
|
||||||
|
"evt.Overflow.Alert.Events[0].GetMeta('target_fqdn') == '${config.services.matrix-conduit.settings.global.server_name}'"
|
||||||
|
"evt.Overflow.Alert.GetScenario() in ['crowdsecurity/http-probing', 'crowdsecurity/http-crawl-non_statics']"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}).outPath;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue